View Full Version : Strang Issue with 2 CSS tags

12-26-2010, 01:06 AM
1st I want to thank you for your reply before hand.

You can see the issue here: http://lcudhost.com/samples/bmart/

On my page the dark blue box at the top of the page should be bellow the logo and the business name. When I tried to find the issue I added this to the menu bar's css bracket:

top-margin: 20px;

That then moved the entire page down 20 px. I have no idea what is going on, please help.

Link to my Style Sheet: http://lcudhost.com/samples/bmart/layout.css

Here is a copy of the code in my index.php:

<title>B-Mart Inc.</title>
<link href="layout.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
background-color: #3f3f3f;
<div id="wrapper">
<div id="header">
<div id="logo"><div id="bmartname"></div></div>
<div id="menubar"></div>

12-26-2010, 01:47 AM
Add clear:both; to your menubar CSS.

Is this what you was trying to achieve?

12-26-2010, 01:48 AM
In the code that I posted I have one to many </div>'s and that IS NOT in the live code.

12-26-2010, 01:50 AM
Hello wesslayneb,
You have no DocType - :eek:
Your #logo is 250px wide but you are trying to place 400px wide #bmartname inside it. The box model (http://www.w3.org/TR/CSS2/box.html) shows how whatever you place in a container should not exceed that containers size... margin/padding/border all count when figuring sizes too.

Adding clear to that #menubar will make it act better -
#menubar {
background: url(images/menu.png) no-repeat;
height: 50px;
width: 1000px;
margin-left: 150px;
margin-right: 150px;
margin-top: 20px;
clear: both;
} /*note missing bracket*/