Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Border problem
12-15-2010, 03:43 PM #1
- Join Date
- Dec 2010
- Thanked 0 Times in 0 Posts
here is the html code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
And here is the CSS code
/* CSS Document */
Now the Question is When I put this code in the #leftpart
the whole page breaks and footer moves down.
Could somebody Explain why???
Please bear with the question as i am very novice.
12-15-2010, 03:50 PM #2
- Join Date
- Aug 2010
- High Point, NC
- Thanked 363 Times in 360 Posts
Could it be that the border is taking up 1px and you have set widths to exactly 50% to your divs which leaves no room for anything else. Try changing #leftpart to width: 49%;
Thats just a guess, but its worth a try.
btw I just confirmed that thats what is going on. If you have two divs floated side by side and they both take up 100% of the space, then adding a border of even 1 px will force the div next to it down, since there is no more room for it there. Do some reading on the box model. You can google it.
You should probably consider using pixels for your widths for right and left part divs.
Also. please use the # button when posting code. Makes it much easier to read when surrounding your code with code tags. Thanks
Last edited by teedoff; 12-15-2010 at 03:58 PM.
Users who have thanked teedoff for this post: