CSS - Padding/margins
ok im having a no brainer and i cant figure out what i did wrong, can someone take a look at this and tell me how to remove the space below. im posting a link, it has the css text posted on the page with the menu im working on that im having difficulty with.
thanks in advance, Trizen www dot cooperativecreditsystems slash Untitled-2 dot html apparently being a new user i cant post links but just add the dots as dots and you should be able to find it. Similar TutorialsHi, I am shifting from table-based layouts to CSS layouts and having a hard time with padding and margins. In the code given below, I had placed the DIV bodypan within the parent DIV mainpan to create a box look. I had given the padding and margins of both the DIVs accordingly. But in IE6,the child DIV bodypan is not displayed as intended. The top and right borders of the inner DIV is streched more than the bottom and the left borders. In FireFox, only the right border is getting streched. Any help in solving this issue for both IE6 and FireFox will be very much appreciated. Code: <html> <head> <title>My page</title> <style type="text/css"> .mainpan { float:left; width:450px; height:370px; display:block; border:1px solid #000000; margin-left:auto; margin-right:auto; padding:10px 10px 10px 10px; background:#BABB99;height:100%; overflow:hidden; } .bodypan { width:410px; height:330px; margin:10px 10px; background:#FCFAE6; color:#3D3C2C; padding:10px 10px 10px 10px; border:1px solid #FF0000; } </style> </head> <body> <div class="mainpan"> <div class="bodypan"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p> </div> </div> </body></html> thanks, Rajkhowa Please bear with this CSS learner...again Am trying to understand why IE adds extra spacing at times, while other times doesn't. As opposed to Firefox doing it right all the time. Is there something I'm doing wrong or missing? Here is my code(all comments included) Code: <html> <head> <title>Dude's Work Web Page</title> <style type="text/css" media="screen"> body { background: #999; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0px; padding: 0px; text-align: center; /*IE hack for margin: auto;*/ } #area { background: #F5F5F5; display: table; width: 776PX; margin: 0 auto; padding: 0px; text-align: left; } #header { float: right; width: 100%; margin: 0; padding: 0; background: white; } #header img { margin: 5px 0 5px 5px; padding: 0; height: 67px; width: 440px; border-style: none; } #header h2 { float: right; text-align: center; font-size: 18px; width: 38%; border: 3px solid black; margin: 15px 5px 0 0; } #toplinks { background: #D3D3D3; margin: 0; padding: 0; line-height: 25px; } #toplinks a { display: block: float: left; padding: 0 10px; margin: 0 2px; color: darkblue; text-decoration: none; font-size: 16px; font-weight: bold; vertical-align: middle; border: 4px double gray; } #toplinks #firstlink { margin-left: 10px; } #toplinks a:hover { background: white; color: blue; } #menu { float: left; margin: 20px 5px 0 5px; background: white; width: 20%; border: 1px solid black; border-width: 0 1px 1px 1px; } #menu a { display: block; text-decoration: none; border-top: 1px solid black; padding: 5px; margin: 0; font-size: 12px; color: black; } #menu a:hover { font-weight: bold; background: #EEE; } #maincontent { float: left; margin: 0; padding: 0; width: 78%; background: white; color: #191970; font-size: 15px; text-align: justify; } #maincontent h2 { font-size: 20px; text-align: center; padding-top: 20px; } #maincontent h3 { font-size: 18px; padding-left: 15px; } #maincontent p { padding: 0 20px; line-height: 1.3em; } #maincontent img { float: right; width: 132px; height: 90; margin: 0 20px 0 0; padding: 0; border-style: none; } #maincontent ul { padding-bottom: 30px; } #maincontent li { padding: 0 20px 5px 5px; line-height: 1.3em; } </style> </head> <body> <div id="area"> <div id="header"> <h2>Serving blah blah State Since blah</h2> <a href=""><img src="Logo.gif" alt="Logo" title="Logo" /></a> </div> <!-- end header --> <div id="toplinks"> <a href="" id="firstlink">First top link</a> <a href="">Second</a> <a href="">Third</a> </div> <!-- end toplinks --> <div id="menu"> <a href="">Link</a> <a href="">Link</a> <a href="">Link</a> <a href="">Link</a> <a href="">Link</a> <a href="">Link</a> <a href="">Link</a> <a href="">Link</a> </div> <!-- end menu --> <div id="maincontent"> <h2>My Margin or Padding or Whatever Dilema.</h2> <p>I am getting oh so very confused regarding why IE is adding extra space from the sides on only SOME of my images/div/headings and not others---as opposed to Firefox doing everything perfectly. This is pretty much my exact stripped down page. Notice below list of Minor Annoyances plaguing me. Yeah, sure, I could simply let things be cause, hey, it still works...but I am nagged why perfect browser harmony cannot be attained.</p> <h3>List of Minor Annoyances</h3> <ul> <li>Notice in top header section: IE makes my h2 with border twice the width from the right than I would like. </li> <li>In top header section: Logo looks great on left and top, but twice the space from bottom in IE.</li> <li>Top links: spacing is perfect in both browsers(go figure).</li> <li>Onto side menu: space from top is perfect. IE space on left side is twice what's wanted.</li> <img src="" alt="Front Desk" id="frontdesk" /> <li>Now image sitting here to right: IE puts no padding between letters and image. I could add margin: ; to the img, but that further increases my firefox space.</li> <li>And, well, okay, that's it. Just wanna understand this IE extra spacing thing.</li> </ul> </div> <!-- end maincontent --> <br clear="all" /><!-- without this little <br /> NS6 and IE5PC do not stretch the frame div down to encopass the content DIVs --> </div> <!-- end area --> </body> </html> Any input/advice is appreciated...Thanks, James Btw, can I size these code boxes? It's huge. I am looking for a way to color the padding/margin/border of all the elements on my page, so that I can, with a quick look, see how the elements are interacting with eachother. If you have used firebug, then you know what I mean, because in Firebug, when you hover over an element in "inspect" mode it shows the margins and padding in different colors. I have heard of diagnostic CSS before, but have never seen anything quite like this. Does anyone know how Firebug does it, or know of anything similar? Hi all! I am a bit of a newb to CSS, and could certainly use some help on this slight problem that I can't seem to figure out. Here is the link. And the code is at the bottom as well. If you look closely you will see that in the main page content, the text to the right of the quote is just a little bit further right than text below the quote. I must admit that I find a bit of CSS still quite confusing. I could certainly use any help that all of you could provide. Thanks in advance! Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> body { margin: 0px; background: #006600; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: medium; text-align: left; color: #FFFFFF; text-decoration: none; } div#head { background: #FFFFFF; width: 100%; height: 100px; } div#menu { text-align: right; font-size: 12px; font-weight: bold; position: absolute; top: 88px; right: 50px; color: #000000; font-variant: small-caps; } div#title { text-align: right; font-size: x-large; margin: 25px; margin-right: 50px; font-style: oblique; } div#quote { text-align: center; font-size: large; width: 200px; margin-top: 50px; margin-left: 10px; float: left; } div#content { margin-left: 250px; padding-left: 25px; padding-right: 25px; border-left: 1px solid #FFFFFF; } </style> </head> <body> <div id="head"> </div> <div id="menu"> Link 1 | Link 2 | Link 3 </div> <div id="title"> Welcome to CLA </div> <div id="quote"> "This is a quote from some guy who said something profound."<br /> - Leonardo da Vinci </div> <div id="content"> <p>Established at the University of California, Irvine in November of 2001, The da Vinci Research Center for Learning Through the Arts builds on the expertise and combined knowledge of faculty in the Arts disciplines, Education, Social Ecology and Medicine to study the nexus of relationships between arts education, aspects of cognitive and social development, civic engagement, and public policy information.</p> <p>The center fosters interdisciplinary studies that involve appropriate faculty from several other parts of the campus as well as from other institutions.</p> <p>For more information please contact us: </p> <blockquote> (949) 824-8942<br /> Wendy Lee, Assoc. Director<br /> Claire Trevor School of the Arts<br /> University of California<br /> Irvine, CA 92697-2775 </blockquote> </div> </body> </html> I'm using the following code below to try and get a CSS template that I can use on sites to make them as consistent as possible across browsers. I've done fairly well (I think), but I'm having trouble with odd stubborn space around textarea's and other form elements. Any suggestions on how to remove these margins/padding? Both CSS and HTML is validated OK. Code: /* CSS Document */ /* TAG DEFAULTS */ HTML { font-size:100%; /* IE correction */ /* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-IE browsers */ height:100%; margin-bottom:1px; color:#352819; font-family:"Times New Roman", Times, serif; } BODY { /* Text-Sizing with ems: (URL address blocked: See forum rules) */ font-size:1em; background-color:#FFFFFF; margin:0; } TABLE { font-size:100%; /* IE correction */ border-collapse:collapse; border:0px none; } H1, H2, H3, H4, H5, H6, P, BLOCKQUOTE { margin:5px 0 10px; line-height:100%; } H1 {font-size:2em;} H2 {font-size:1.5em;} H3 {font-size:1.25em;} H4 {font-size:1em;} H5 {font-size:.75em;} H6 {font-size:.55em;} INPUT, SELECT, TEXTAREA, TH, TD { font-size:1em; font-family:"Times New Roman", Times, serif; margin:0; padding:0; } INPUT, SELECT, TEXTAREA { border:1px solid #352819; } TEXTAREA { overflow: auto; width:300px; height:100px; } FORM, LI {margin:0;} UL {list-style-type:disc;} LI LI, LI P, TD P, BLOCKQUOTE P {font-size:1em} OL, UL { margin:0; padding:0; padding-left:23px; } A:LINK {color:#a47832;} A:VISITED {color:#a47832;} A:HOVER {color:#e5a135;} /* END TAG DEFAULTS */ Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Style Test</title> <link href="css/style.css" rel="stylesheet" type="text/css"> </head> <body> <table> <tr><th>Cell TH 1</th><th>Cell TH 2</th></tr> <tr><td>Cell TD 3</td><td>Cell TD 4</td></tr></table> <h1>This is H1</h1> <h2>This is H2</h2> <h3>This is H3</h3> <h4>This is H4</h4> <h5>This is H5</h5> <h6>This is H6</h6> <p>This is P</p> <UL> <LI>List Item 1</LI> <LI>List Item 2 Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped</LI> <LI>List Item 3</LI> </UL> <OL> <LI>List Item 1</LI> <LI>List Item 2 Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped Wrapped</LI> <LI>List Item 3</LI> </OL> <form action=""> <div><input value="Input" name="name" type="text"><input value="Input" name="name" type="text"><br> <input value="Input" name="name" type="text"><br> <input value="Input" name="name" type="text"> <select name="stuff"> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select><br> <select name="stuff"> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select> <select name="stuff"> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> </select><br> <table style="border:1px solid #000000;"><tr><td> </td></tr></table> <textarea name="myarea" cols="100" rows="5">This is my text area</textarea><textarea name="myarea" cols="100" rows="5">This is my text area</textarea><br> <table style="border:1px solid #000000;"><tr><td> </td></tr></table> <textarea name="myarea" cols="100" rows="5">This is my text area</textarea><br> <table style="border:1px solid #000000;"><tr><td> </td></tr></table> <input type=submit name=submit value="My Button"> <input type=submit name=submit value="My Button"><br> <input type=submit name=submit value="My Button"> </div></form> <div><a href="contact.shtml">Hyperlink</a></div> <blockquote><div>This is a blcokquote This is a blcokquote This is a blcokquote This is a blcokquote</div></blockquote> </body> </html> Hi! Could some experienced CSS developer please confirm this: All paddings, and right and left margins, always combine (what I mean is if you have a left object with a 5px right margin and a right object with a 5px left margin, the distance between the two will be 10px). However, bottom & top margins never combine. Is all this true? I am having a problem where I have a <div> that holds my body image, margin: 0 auto; Inside that is my content <div> with margin:15px; but this is visually dropping the background image's margin by 15px. The problem compounds every time I add another margin/padding requirement into the rest of the <div>. Code: html, body { margin:0px; padding:0px; background-image:url(images/interface/background.png); } #body_image { width:935; margin:0 auto; padding:0px; background-image:url(images/interface/body.png); background-repeat:no-repeat; background-position:center; } #container { width:904px; height:750px; margin:15px; } #slug { height:15px; } Code: <div id="body_image"> <div id="container"> <div id="header">Header</div> <div id="nav">Nav</div> <div id="sidebar">Sidebar</div> <div id="content">Content</div> <div id="footer">Footer</div> </div> </div> The extent of my CSS is a few tutorials online and the class I took 10 years ago where the teacher said "Here's CSS, you can't do much more than change your font size and color with it... on to tables!" Thought it'd only be fair to give you a little background. Hi All, This seems to be a bit of a recurring problem for me in a lot of the new CSS designs I'm trying... but it seems that IE interprets both padding and margins differently than how firefox interprets them. Sometimes it seems to do it the same, and other times differently. Take a look at this: http://zeroonedesign.com/beta/newsite/index.html CSS he http://zeroonedesign.com/beta/newsite/style.css Now look at it first in Firefox (the desired effect) and then in IE. IE seems to be incapable of understanding this particular piece of the code Code: #menu {padding-top:140px;text-align:left;padding-left:38px;} #menu ul{margin:0px;} #menu ul li{display:inline;margin-right:10px;padding:5px 7px 5px 7px;color:#fff;} #menu ul li a{color:#fff;font-size:10pt;text-decoration:none;} #menu ul li a:hover{color:#fff;font-size:10pt;border-bottom:3px solid #fff;} #menu ul li a.selected{color:#f88000;font-size:10pt;border-bottom:2px solid #f88000;} Ideas? Help? I know the box model is different for IE than it is for FF but I've tried the box model hack and it doesn't seem to do anything. Hello, Is there a way to have padding (say 15px) all around a cell, but allow for expections, like having one div element float:left and align far left against cell border while everything else is inset 15px. ie. Code: <style> #menubox { float:left; margin-left:15px; margin-bottom:7px; } .main_cell { padding:15px; } </style> <body> <table width=600 border=0 cellpadding=0 cellspacing=0> <tr> <td valign=top class="main_cell"><div id="menubox">table with menu items taht is achored far left against cell wall</div> Some text that wraps around "menubox" but needs to be padded around cell walls.</td> </tr> </table> </body> Thanks, Rey Hey everyone, I am making a design to kill some time, and I have come across a problem. I have a menu at the top which has no top padding unless I give it padding of 87px. I find this very odd, and it happens in every browser( Firefox 2.0.0.3, Opera 9, IE6-7 ); is it a bug in CSS itself or am I doing something wrong? Here is my code, maybe I am missing something. html4strict Code: Original - html4strict Code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <title></title> <style type="text/css"> body { background-color: #082567; color: #FFFFFF; margin: 0; padding: 0; font-family: verdana,tahoma,"Bitstream Vera Sans",arial,helvetica,sans-serif; font-size: 12px; text-align: justify; } #top-menu { background-image: url( http://secretgeek.net/Gradient.aspx?Direction=H&Length=130&StartColor=082567&EndColor=0C39A1&Format=jpeg ); background-repeat: repeat-x; height: 130px; } #top-menu h1 { float: left; font-weight: bold; letter-spacing: -3px; font-size: 31px; padding: 5px; } #menu { float: right; list-style-type: none; text-align: center; } #menu li { display: inline; } #menu a { background-image: url( http://secretgeek.net/Gradient.aspx?Direction=H&Length=130&StartColor=082567&EndColor=0C39A1&Format=jpeg ); background-repeat: repeat-x; color: #FFFFFF; padding: 50px; } #menu a:hover { background-image: url( http://secretgeek.net/Gradient.aspx?Direction=H&Length=130&StartColor=0C39A1&EndColor=082567&Format=jpeg ); background-repeat: repeat-x; } </style> </head> <body> <div id="top-menu"> <h1>ryon.hunter</h1> <div id="menu"> <ul> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> </ul> </div> </div> </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" I validated it and it validates fine, any suggestions? according to the css 2.1 spec if you specify the margin/padding of an element in ems then it takes the measurement from that element's font size, this means that * { font size: 1em; } h1 { font-size: 1.5em; margin-bottom: 1em; } gives h1 a margin of ... 1.5em ... which sucks. and is counter intuitive IMO. how is one supposed to go about having fixed margin spaces when using scalable fonts? now i know that margins overlap so theoretically setting p { margin-top: 1em; } instead would work, but only where a p lies under a h1. if i had a h1 then a h2 then a p then how large would the gap be between the h1 and the h2? and how would i control that reliably? the only way around this i can think of is this * { font-size: 1em; /*let's say this equates to 10px on the device it's being viewed on*/ } h1 { font-size: 1.5em; /*...then this would be 15px*/ margin-bottom 0.67em; /*..this would be 67% of 15px = 10px!*/ } h2 { font-size: 1.2em; /*12px*/ margin-bottom: 0.83em; /*83% of 12px = ... 10px!*/ } p { margin-botton: 1em; } Now, when i scale the font size all the margins should scale in accordance with the <p>. at least, according to my understanding of the spec. i'll try it in the next couple of hours (first thing monday morning just got to work)... anyone else thought of a scalable friendly alternative? Hello. I'll preface this by saying that it's probably a common problem with a simple solution, but I've searched all over the net for a solution and come up empty. It's very possible that I'm using the wrong search terms, however. Anyway, on to the issue I'm having. I recently rebuilt a page using CSS with divs -- prior to that it had been using several nested tables and the code was getting pretty unwieldy -- and it looks great in most of the latest browsers. Except, of course, IE. The way the page is set up, I have two container divs floated left, each one using 48% of the available width, with a 1% margin on each side. It looks perfect in every browser except for IE. In IE it seems that the only style definition that it cares to acknowledge is the float left, so both container divs get forced together on the left side with no space in between. It's not unreadable, but it's not what i want either. Here's the style definition: Code: .newsTypeSection{ width:48%; float:left; margin-right:1%; margin-left:1%; display: inline; } the display:inline; was something i added later as it seemed to be a proposed fix from another site. It didn't make a difference that I could see, so I just left it. Here's an image that shows the difference. The top example is what it should look like. It looks perfect in every browser but IE. URL The bottom is what shows up in IE8, and probably other version of IE as well. Can anyone help me with this? It's beyond frustrating. Please let me know if you need more information. I can't link to the page because it's not public at the moment. Hi All, I am very new to CSS and i am working on preparing a document of an existing CSS. Can someone tell me if the margins are set as this, margin:0px 31px 0px; Is it top,right and bottom? Thanks Prena i have a left margin of 5px on the navigation links that pushes them away from the edge. however. However, for Corporate Leadership and board of directors, the second line does not indent. How can I fix this? http://zettalogica . com/fulcrum/index.html Also, if anyone has an opinion, do you think it would be better to keep the text for that line the same size as the other links, or would you make the text smaller so that the bar itself is the same height as all the others in the navigation. Thank you Hey there. A friend of mine was giving me a hand with the coding for http://myspace.com/457343540 but unfortunately I can't get in contact with him atm, so I thought I'd as here. As you can see in the link provided, firefox display the margins I want, but IE throws them off a bit. I've tried a few different things, but after a couple hours I've given up trying on my own lol. Another issue is the page is obviously stretching off the page (?idk) as the scroll bar goes off the side. Code: <style> { Music Player Properties } .i {display:none;} table table td.text div object {position:absolute; top:1140px; left:50%; margin-left:-30px;} table table td.text div object object {position:static; margin-left:0px;} { Background Properties } table, tr, td { background-color:transparent; border:none; border-width:0;} body { background-color:000000; background-attachment:scroll; background-position:top center; background-repeat:no-repeat; background-image: url(http://bnesfinest.net/tomm/myspace/tioc/bg.jpg); border-top-width:0px; border-bottom-width:0px; border-left-width:0px; border-right-width:0px; border-color:none; border-style:solid; padding-left:0px; padding-right:0px;} .samohtlogo{ position:absolute; width: 100px; top: 20px; left: 20px; text-align: left; z-index: 10;} .menu{ width: 959px; height: 136px; position: absolute; top: 591px; z-index: 2; overflow: visible; margin-left: -480px; left: 50%;} .header { width: 959px; height: 422px; position: absolute; top: 169px; margin-left: -480px; z-index: 0; overflow: visible; left: 50%;} .memberstop { width: 959px; height: 403px; position: absolute; top: 727px; margin-left: -480px; z-index: 0; overflow: visible; left: 50%;} .thealbum{ width: 422px; height: auto; position: absolute; top: 1130px; z-index: 2; overflow: visible; margin-left: -480px; left: 50%;} .musicbg{ width: 541px; height: auto; position: absolute; top: 1130px; z-index: 0; overflow: visible; margin-left: -62px; left: 50%;} .shows{ width: 959px; height: auto; position: absolute; top: 1513px; z-index: 0; overflow: visible; margin-left: -480px; left: 50%;} .reverbshows{ width: 959px; height: auto; position: absolute; top: 1550px; z-index: 2; overflow: visible; margin-left: -445px; left: 50%;} .featvideo{ width: 959px; height: auto; position: absolute; top: 1535px; z-index: 2; overflow: visible; margin-left: -50px; left: 50%;} .R { Div Counter Acts } .friendSpace div { overflow:visible !important; height:auto !important; position:static !important; background:none !important; } .friendsComments div { overflow:visible !important; height:auto !important; position:static !important; width:auto !important; background:none !important; } html body.bodyContent table tbody tr td table.friendsComments tbody tr td.text table tbody tr td table tr td{ background-color: !important; text-align: left; vertical-align: top; overflow: visible !important; font-size: 11px !important; line-height: 12px !important; text-transform: none !important; text-align: justify; letter-spacing: 0px; color: e7e2c5!important; margin: 10px !important; padding: 20px 20px 12px 0px; border-bottom: 1px dotted dimgrey !important; border-color: 50433d!important; _line-height: 16px !important; } html body.bodyContent table tbody tr td table tbody tr td.text table.friendSpace tbody tr td.text table tbody tr td table tr td table tr td a{ width: 110px !important; overflow: hidden; letter-spacing: 0px; font-size: 10px !important; line-height: 12px; display: block; color:50433d!important; margin: 0 !important; padding: 0 !important; text-align: center !important; margin-left: 1px !important;} .friendSpace { position: absolute !important; z-index: 4 !important; width: 800px !important; margin-left: -320px; _margin-left: -400px; top: 0px !important; margin-top: 1860px !important; } .friendsComments { position: absolute !important; z-index: 6 !important; margin-left: -35px; _ margin-left: -400px; width: 833px !important; top: 0px !important; margin-top: 2755px !important; } .friendsComments a img {border: 3px; border-color: 50433d; border-style: solid;} .friendsComments table {width: 800px; align: justify; position:relative; left:0px; } .friendSpace a img {border: 4px; border-color: 50433d; border-style: solid;} </style> I am having a heck of a time with this side sub-menu. I cannot seem to get the left margins to be equal in IE 6, 7 or 8? My html: Code: <!-- show_menu2 --> <ul id="sub_menu" class="menu" style="margin-left:-5px;position: relative; background-color:#CFF"> <li><a href="#" class="menu-expand menu-first navlev2" title="Project">Add-ons Project</a></li> <li><a href="#" class="menu-expand menu-parent navlev2" title="What Modules">Modules</a> <ul class="ullev3"> <li><a href="#" class="menu-sibling menu-first navlev3" title="Modules Here">Module</a></li> <li><a href="#" class="menu-sibling navlev3" title="Admin Tools">Admin Tools</a></li> <li><a href="#" class="menu-current navlev3" title="Random">Code Snippets</a></li> <li><a href="#" class="menu-sibling menu-last navlev3" title="Droplet of Link">Droplets</a></li> </ul> </li> <li><a href="#" class=" navlev2" title="AMASP">AMASP</a> </li> <li><a href="#" class=" navlev2" title="Templates">Templates</a> </li> <li><a href="#" class="menu-last navlev2" title="Backend Pages">Backend Themes</a></li> </ul> </div> <!-- end of subnavigation --> My CSS: Code: #submenu { padding: 0; /* [disabled]width: 247px; */ /* [disabled]position: relative; */ /* [disabled]left: -15px; */ } #submenu a { text-decoration :none; color :#5b9acf; padding-left :12px; display :block; background-image: url(../images/bullets_micro/square3.gif); background-repeat: no-repeat; background-position: 2px 50%; } #submenu a:hover { color :#003366; background-image: url(../images/bullets_micro/square1.gif); background-repeat: no-repeat; /* [disabled]background-position: 4px 50%; */ } #submenu a:active { border: none; } #submenu a.menu-current { font-weight :bold; color :#003366; background-image: url(../images/bullets_micro/asst3.gif); background-repeat: no-repeat; background-position: 4px 50%; } #submenu ul { margin-top: 0; margin-right: 0; margin-bottom: 0px; /* [disabled]margin-left: -25px; */ /* [disabled]position: relative; */ /* [disabled]left: -10px; */ } #submenu ul li { padding :5px 0; /* [disabled]line-height :1.4em; */ font-size :12px; list-style-type :none; border-bottom :#cccccc 1px solid; } #submenu ul li.a { padding: 0px 10px; } #submenu ul li li { border-bottom :none; padding-bottom :0px; font-size :11px; } #submenu ul li li a:link, #submenu ul li li a:visited { color :#003366; background-image: url(../images/bullets_micro/diamond4.gif); background-repeat: no-repeat; background-position: 2px 50%; } #submenu ul li li a:hover { background-image: url(../images/bullets_micro/diamond.gif); background-repeat: no-repeat; /* [disabled]background-position: 4px 50%; */ color: #6DB9FA; } /* ====================== */ My test page: (pardon the blue background I just added this to see the container.) http://new.ssmarts.org/page.html Thanks so much. I thought I had this worked out before with the help of this forum, but it seems to be back again! In IE 6 (and maybe others, who knows. I am running Ubuntu =/ ) there is a big gap between the top horizontal nav and the comic. http://www.jjsunshines.com/ Any help would be greatly appreciated! I'll even trade you php help! Hi Guys, I have a question about me not understanding how margins work... I am quite perplexed...I am trying to remove the white space between borders of table cells. I am using: Code: td { margin: 0; } But there is still white space between the cells...how do I make no space between the cells? Code is located he http://www.taipeitripper.com/senshin_center/training_schedule.html Thank you, Evan Jerkunica Hello, I have the following issue. I need to create a full screen gray div with another white div inside it, positioned with 5 pixel margin. Basically it looks like a white div with 5px border around it. That wouldn't be a problem after i set body and html height to 100%, but here's what breaks: i add the first gray div (relatively positioned) and make it's min-height: 100%, then add lots of text and see if it autoexpands. It does! Now i add another absolutely positioned white div inside of it and set its position to 5px from each side. And now everything breaks ... doesn't autoexpand ... at least in opera. Here's the css: Code: body, html { width: 100%; height: 100%; margin: 0; padding: 0; } #maindiv { position: relative; left: 0; top: 0; width: 100%; min-height: 100%; background: #777777; } #fullscr { position: absolute; left: 5px; top: 5px; bottom: 5px; right: 5px; background: #FFFFFF; } <div id="maindiv"><div id="fullscr"> lots of text with linebreaks </div></div> Does anyone have any ideas how to make it work? Hi, My current code is designed to have a flexible number of columns depending on the width of the screen. It is just divs with a left and right margin: HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link rel="stylesheet" type="text/css" href="css.css" /> </head> <body> <div><img src="1.jpg" alt="Angry face" title="Angry face" /></div> <div><img src="1.jpg" alt="Angry face" title="Angry face" /></div> <div><img src="1.jpg" alt="Angry face" title="Angry face" /></div> <div><img src="1.jpg" alt="Angry face" title="Angry face" /></div> <div><img src="1.jpg" alt="Angry face" title="Angry face" /></div> </body> </html> CSS: Code: div{ width:120px; height:90px; float:left; background:#999999; margin-left:3%; margin-right:3%; margin-bottom:13px; border-style:solid; border-width:1px; border-color:#e2e2e2; } The trouble is, the right column isnt spaced correctly to the right side of the browser. Ive included an image to show more accuratly what im hoping to achieve. Can anyone help me with this? |