Image Text Blocks
<!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>
<h1>image text Blocks</h1>
<p>How to place text blocks over an image:
</p>
<div class="continer">
<img src="hero.jpg" >
<div class="text">
<h4>Nature</h4>
<p>How to place text blocks over an image:
</p>
</div>
</div>
</body>
</html>
CSS image text Blocks Style
.continer{
position: relative;
font-family: Arial, Helvetica, sans-serif;
}
.text{
position: absolute;
bottom:20px ;
right:20px ;
background-color: black;
color: white;
padding-left:20px ;
padding-right:20px ;
}
img{
width:100% ;
}
No comments:
Post a Comment