Heor-image
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="STYLESHEET" type="text/css" href="web.css">
<title>web design</title>
</head>
<body>
<div class="hero-image">
<div class="text">
<h1>I am John Doe</h1>
<p>I m a Photographer</p>
<button>Hire me</button>
</div>
</div>
<div>Page infor</div>
</body>
</html>
CSS hero-image Style
body{
height:100%;
margin: auto;
font-family: Arial, Helvetica, sans-serif;
}
.hero-image{
background-image: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0,0.5)url(images.jpg));
height:50%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
}
.hero-image text{
text-align: center;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
color: white;
}
.hero-image button{
background-color: #ddd;
border: none;
color: #000;
outline:0;
text-align: center;
display: inline-block;
padding:10px 25px;
cursor: pointer;
}
.hero-image button:hover{
background-color: #555;
color: white;
}
No comments:
Post a Comment