Reputation: 481
I'd like to know what's the best way to create a background-based website. I'm using Bootstrap and the thing that's bothering me is how can I predict the height of the div tag that holds the image? Please suggest the simplest way to perform this
<div style="background-image: url('img/bg.jpg'); background-size: 100%; width: 100%; height: 500px; ">
</div>
How the background should look like:
Upvotes: 0
Views: 300
Reputation: 286
In CSS, you can use vw and vh, as a percentage of the view. So if you say:
div {
height: 100vh;
}
This div would take up the full vertical space of the view. vw is for width.
Upvotes: 2