Hi. I'm having an issue with an unordered list (vertical navigation). The problem is that I have a left-border rule going down the side of the navigation and the text doesn't like up with the rule at the top. I'd attached a screen shot, but the problem is on I.E. 7 which I don't have on this computer. You can see what it's doing here http://www.brierscpa.info. It's in the right-hand sidebar. All of the text drops down leaving a huge gap above it. Here is my css:
@charset \"UTF-8\"; body { font: 100% Verdana, Arial, Helvetica, sans-serif; background: #0b1e52; margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */ padding: 0; text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */ color: #000000; background-image: url(images/bcknd.jpg); background-repeat: repeat-x; } .twoColFixRtHdr #wrapper { width: 932px; background-color: #FFFFFF; margin-left: 14px; clear: both; padding-top: 0px; } .twoColFixRtHdr #container { width: 960px; /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */ background: #FFFFFF; margin: 0 auto; text-align: left; background-image: url(images/whiteborder.jpg); background-repeat: repeat-x; max-height: 100%; } .twoColFixRtHdr #logo { width: 340px; padding-left: 20px; height: 40px; padding-top: 35px; } .twoColFixRtHdr #topnav { width: 560px; float: right; padding-top: 74px; } .twoColFixRtHdr #header { background: transparent; height: 115px; background-image: url(images/header_bcknd.jpg); background-repeat: no-repeat; background-position: 438px -18px; } .twoColFixRtHdr #homephoto { clear: both; height: 251px; padding-left: 14px; padding-top: 1px; } .twoColFixRtHdr #profphoto { clear: both; height: 251px; padding-left: 14px; padding-top: 1px; background-image: url(images/professionals.gif); background-repeat: no-repeat; background-position: 14px 0; } .twoColFixRtHdr #servicesphoto { clear: both; height: 251px; padding-left: 14px; padding-top: 1px; background-image: url(images/services.gif); background-repeat: no-repeat; background-position: 14px 0; } .twoColFixRtHdr #taxesphoto { clear: both; height: 251px; padding-left: 14px; padding-top: 1px; background-image: url(images/taxes.jpg); background-repeat: no-repeat; background-position: 14px 0; } .twoColFixRtHdr #contactphoto { clear: both; height: 251px; padding-left: 14px; padding-top: 1px; background-image: url(images/contact.jpg); background-repeat: no-repeat; background-position: 14px 0; } .twoColFixRtHdr #privacyphoto { clear: both; height: 251px; padding-left: 14px; padding-top: 1px; background-image: url(images/flashimages_4.jpg); background-repeat: no-repeat; background-position: 14px 0; } .twoColFixRtHdr #header h1 { margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */ padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */ } .twoColFixRtHdr #sidebar1 { float: right; /* since this element is floated, a width must be given */ width: 215px; /* the background color will be displayed for the length of the content in the column, but no further */ padding: 0px 10px 0px 15px; border-left-style: solid; border-left-color: #FCC34D; border-left-width: 1px; margin-top: 30px; max-height: 100%; } .twoColFixRtHdr #sidebartext { width: 210px; height: 100%; padding-left: 15px; border-left-color: #FBB829; border-left-style: solid; border-left-width: 1px; } .twoColFixRtHdr #mainContent { margin: 0 255px 0 30px; /* the right margin on this div element creates the column down the right side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */ padding: 15px 10px; /* remember that padding is the space inside the div box and margin is the space outside the div box */ } .twoColFixRtHdr #footer { background:#ffffff; width: 932px; margin-top: 0px; margin-left: 14px; clear: both; } .twoColFixRtHdr #footer p { padding: 13px; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */ text-align: center; border-top-style: solid; border-top-width: 1px; margin: 0 15px 0 15px; } .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */ float: right; margin-left: 8px; } .fltlft { /* this class can be used to float an element left in your page */ float: left; margin-right: 8px; } .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */ clear:both; height:0; font-size: 1px; line-height: 0px; } .twoColFixRtHdr #cpalogo { width: 200px; padding-top: 10px; text-align: center; } .twoColFixRtHdr #sidebarsub { float: right; /* since this element is floated, a width must be given */ width: 230px; /* the background color will be displayed for the length of the content in the column, but no further */ padding: 0 10px 0px 5px; height: 100%; clear: both; position: relative; margin-top: 15px; } .twoColFixRtHdr #sidebarsubtext { width: 200px; height: 100%; padding-left: 15px; border-left-color: #FBB829; border-left-style: solid; border-left-width: 1px; position: relative; }
Any help on this is greatly appreciated. I've been noodleing around with this for days!
Thanks for answering my post. I tried adding the code below to the style sheet and it didn't work. Guess I'll have to look at doing a reset. I'm not familiar with this technique. Any pointers?
Any help on this is greatly appreciated. I've been noodleing around with this for days!
Kim
* {margin: 0;
padding: 0;
}
What makes a reset proper or improper?
* {margin: 0;
padding: 0;
}
One that you have complete control over.
The original and still the best http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/