Reputation: 23
I am creating a design in css & html. But a box which I want to have 100% width leaves ugly space to the right. I have no idea what causes this.
The div tag I want to have 100% width is called #view1.
#view1 {
border: 1px solid #000;
min-height: 300px;
padding: 0; margin: 0;
}
<div id="view1">
Choose the option suiting you best
</div>
I'd really appreciate your help as I've been stuck with this issue for more than one hour now.
Upvotes: 0
Views: 292
Reputation: 12161
Your first div (#first) has width: 100% and padding: 25px ... that results in a width larger than the window's width ... remove the padding or set box-sizing: border-box;
Upvotes: 1
Reputation: 8715
Remove padding: 20px;
from <div id='first'></div>
:
#first {
width: 100%;
min-height: 200px;
text-align: center;
background: url('images/background1.png') #99307f no-repeat;
}
Upvotes: 1