Reputation: 9802
I would like to create a webpage with a big image taking half on the screen like this :
How can i do this with CSS ?
Upvotes: 3
Views: 22446
Reputation: 165
The answer at the top forgot something :
background-repeat: no-repeat;
Since you don't want two image but only one. Final code :
#leftHalf {
background: url(bg-1.jpg);
background-repeat: no-repeat;
width: 50%;
position: absolute;
left: 0px;
height: 100%;
}
Upvotes: 1
Reputation: 1530
Try something like this? (2 divs)
#leftHalf {
background: url(bg-1.jpg);
width: 50%;
position: absolute;
left: 0px;
height: 100%;
}
#rightHalf {
width: 50%;
position: absolute;
right: 0px;
height: 100%;
}
Cheers.
Upvotes: 9