Reputation: 77
enter image description here I want to set the background image which will display at complete viewport mode. I have achieved this through body tag.
body { background-image: url(/picture.jpg); }
I also want to add text below the background image which will come at another section in the same webpage. But since I have used background image using body tag, I couldn't able to write further texts after the image. How could I achieve it? Please help. Thanks
Upvotes: 0
Views: 1396
Reputation: 91
<body>
<div class="image">
<img></img>
</div>
<div class="text">
<!-- Your required text comes here -->
</div>
</body>
<style>
.image{
width: 100%;
height: 100%;"
}
img{
some style
}
.text{
some style
}
</style>
Upvotes: 0
Reputation: 544
A good idea would be slightly modifying your HTML structure.
<body>
<div class="content-wrapper">
<!-- All your HTML goes here -->
</div>
<div class="text-wrapper">
<!-- Your required text comes here -->
</div>
</body>
Then you can modify your CSS.
body .content-wrapper { background-image: url(/picture.jpg); }
Hope that helps.
Upvotes: 1