CSS - Negative Margins With Floats Chopping Off In Ie6
Floating an element left, with negative margins cuts off portions of the element in IE6. Looks fine in FF and IE7.
Page he URL Removed by poster XHTML: Code: <div class="miniContainer logos"> <h3>Logos</h3> <div> test </div> </div> CSS: Code: .miniContainer h3 {font: bold 11px Arial,Sans-Serif; color: #000000; background-color: #ffffff; margin: -17px 0 0 -3px; padding: 0 5px; float: left;} .miniContainer {border: 1px solid #EEEEEE; margin: 0; padding: 10px; float: left;} .logos {width: 125px;} .features {width: 100px; margin-left: 10px;} Is there a workaround for this? I understand why it's happening, but can't figure out a hack for it. Similar TutorialsI am having a problem with negative margins in IE7. On my website: commentsandcapers I am trying to get IE7 to display the right two boxes in the same way that Firefox displays them?? I have tried a few thing including position: relative in a whole bunch of places, none of which works. Do any of you have any idea how to correct this problem? Thanks! I'm working on a set of tabs within tabs (or subtabs). My code is something like this: Code: <ul class="tabs" <li class="selected">1</li> <li>2</li> <li>3</li> <li>4</li> </ul> <div class="tab_content"> <ul class="subtabs"> <li class="selected">1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>6</li> </ul> Now, "tab_content" has padding of 10px, because the subtabs won't always be there. But I don't want the padding on the subtabs, so I was giving them a negative margin of -10px. This works in all browsers but IE, which applies everything but the right margin, leaving a white gap. See the image I'm attaching to see what the problem looks like. Anyone know of easy fixes for this? Hello, I used a negative value for the position of a div on this site: Code: www.godynamic.nl Everything is like it have to be in mozilla browsers but in IE the image is partly beneath the upper layer and hidden. I tried z-index but this will only work with absolute position types. Is there IE hack for this? Thanks for helping. I am having trouble getting safari to recognize my negative margins. It works in IE6,7 and Firefox. I am trying to center the page but to get the first 327 pixels on the left and last 327 on the right to be a negative margin and my center column to have a 1000px fixed width. Here is my css. Any help would be great! .bkg-tile-left { background-image: url(/images/bkg-tile-left.jpg); background-repeat: repeat-y; width: 327px; text-align: left; float: left; overflow: visible; } #bkg-tile-right { background-image: url(/images/bkg-tile-right.jpg); background-repeat: repeat-y; width: 327px; background-position: right; text-align: right; float: right; clear: both; padding-right: -327px; } #bkg-right { background-attachment: scroll; background-image: url(/images/bkg-img-right.jpg); background-repeat: no-repeat; background-position: left top; height: 100%; } #bkg-left { background-attachment: scroll; background-image: url(/images/bkg-img-left.jpg); background-repeat: no-repeat; background-position: right top; height: 100%; } #box1 { margin-left: -327px; margin-right: -327px; position:relative; } AND HTML <body> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" id="box1"> <tr> <td valign="top" class="bkg-tile-left" height="100%"><div id="bkg-left"><IMG SRC="images/spacer.gif" WIDTH=327 HEIGHT=718></div></td> <td valign="top"><table id="Wrapper" cellpadding="0" cellspacing="0"> <tr> <td id="print_header"><dtml-var standard_print_header ><img src="images/spacer.gif" width="1px" height="1px"></td> </tr> <tr> <td><dtml-var standard_html_header2></td> </tr> <tr> <td><table width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top" id="BreadCrumb"><dtml-var standard_html_breadCrumb></td> </tr> </table></td> </tr> <tr> <td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <dtml-if standard_html_sidebar> <td valign="top" id="body_content2"><dtml-var body_content2></td> <td valign="top" id="Sidebar2"><dtml-var standard_html_sidebar2></td> <dtml-else> <td valign="top" id="body_content2"><dtml-var body_content2></td> </dtml-if> </tr> </table></td> </tr> <tr> <td id="Footer2" ><dtml-var standard_html_footer2></td> </tr> </table></td> <td valign="top" id="bkg-tile-right"><div id="bkg-right"><IMG SRC="images/spacer.gif" WIDTH=327 HEIGHT=718></div></td> </tr> </table> </div> </body> Does anyone know how to get this code to display correctly in Opera?
HTML4STRICT Code: Original - HTML4STRICT Code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=8"> <style type="text/css"> p { } .mouse { display: inline-block; padding: 6px; margin: -6px; } .mouse:hover { background: #888; border: 2px solid black; padding: 4px; } </style> </head> <body> <p>A <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span> <span class="mouse">test test test</span></p> </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" I has attached some screenshots of my results. When I hover over an element on the right or left edge of the screen, the background and border that results clips because of my negative margins. I'm redoing the layout of my site (www.brohawk.com) using floating divs with negative margins to produce a fluid left column and a fixed right column. I followed an article on A List Apart for the basics and got it working fairly nicely. As a matter of fact, the site works beautifull in Mozilla/Firefox and with minmal errors in NS7. I've even got all but the forums working in Opera. I haven't even begun to work on making it IE compliant. Saving the worst for last. Anyhow, on all the pages except the forums, the divs line up perfectly. However, on the forums page, the right div doesn't stay up top, instead it wraps around under the left div. However, I still get all the space to the right of the left div where the right one should go. Anybody with Opera should be able to check it out and see what I mean. Anyhow, can anybody tell me why it won't float properly on that one page, but it works on all the others? apologies if this has been asked and answered already - i did a search of the board but didn't find a clear solution. what i'm trying to do seems simple enough, but isn't turning out that way. lets say i have a page background of some color (e.g., orange). then i have a main container div that is centered with auto margins, and has a white background. i want this main container to start at 100px from the top (so 100px of orange shows above it), and the white background should expand to the bottom of the page - without scrollbars. if i set it's height to 100%, the 100px top margin is added to the 100% height of its parent (body + html), so it acts as if there's 100px of substance beneath the viewport and therefor shows scrollbars. i had assumed a negative bottom margin set for the same amount as the top margin would work, but alas it does not. obviously i don't want to just force-hide scrollbars by overflow:hidden or position:asbolute/fixed - if content in the container forces it to expand, it should do that. otherwise, even if there's very little content - or even none - it should expand to the bottom of the page. i've attached a very basic (non-working) example - any insight would be appreciate. not looking for a hack - i'm looking for the best way to handle this with best-practices. tyia 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" xmlns:v="urn:schemas-microsoft-com:vml" > <head> <style type="text/css"> html { height : 100%; } body { margin : 0; background : #F90; height : 100%; } div.wrapper { margin : 100px auto -100px auto; width : 500px; background : #FFF; height : 100%; } </style> </head> <body> <div class="wrapper"> </div> </body> </html> In Internet Explorer 6, the following HTML and CSS with negative margins causes the first letter of the heading to disappear: Code: <html> <head> <style type="text/css" media=screen> #siteBody { position: absolute; top: 100px; left: 100px; width: 700px; margin-left: 2em; } h1 { margin-left: -1em; } </style> </head> <body> <div id="siteBody"> <h1>This is the heading</h1> <p> This is the content. </p> </div> </body> </html> There are ways to get the negative margin to work in IE properly, but at a loss of functionality. For instance, if I remove the width property from the siteBody CSS, and change the position to 'relative', the letter will appear. Also, if I remove the div and just place the 'siteBody' id on the body tag, then the first letter will appear. Any help is greatly appreciated as I've been searching for a solution for a couple of days now. Thanks, ---atomgiant i am trying to display a form from a website inside an iframe the problem is, this form displays perfectly in IE: but it displays wrong in FF: heres the CSS: Code: #container{ width: 380px; height: 288px; overflow: hidden; border: 3px solid #4398d4; } #container iframe { width: 800px; height: 600px; margin: -305px 0px 0px -40px; } heres the HTML: Code: <div id="container"> <iframe src="http://wow.eroticagateway.com/signup/signup.php?step=signup&qualify=1&site=226&nats=NzUxNjg6MzoyMjY" scrolling="no" frameborder="0"></iframe> </div> any idea why this is happening? 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? Doctype: XHTML Strict. Platform & browsers: Tested on Windows XP using IE 6.0 (with SP2), Opera 7.54 and FireFox 1.0 HTML: Code: <div id="wrapper"> <p>Wrapper</p> <div id="floatRight"> <p>Float Right</p> <p>Dummy Text</p> <p>Dummy Text</p> <p>Dummy Text</p> <p>Dummy Text</p> <p>Dummy Text</p> <p>Dummy Text</p> <p>Dummy Text</p> <p>Dummy Text</p> <p>Dummy Text</p> </div> <div id="leftHuggerNotFloated"> <p>Hugging Left This is really really long text just to see if the text wraps properly and does not disappear behind the right floated div which is yellow.</p> </div> <div id="footer"> <p>Footer</p> </div> </div> #floatRight and #leftHuggerNotFloated are positioned side-by-side. Note that #floatRight comes first in the source. As you will see later, #leftHuggerNotFloated is not floated at all. The problem occurs only when #floatRight is longer than #leftHuggerNotFloated. The CSS: Code: /***************************** Some preliminary CSS to remove the relavent cross-browser inconsistencies for convenience. ******************************/ body { margin: 0px; padding: 0px; } p { margin: 0px; } /***************************** Actual CSS. Background colors are for convenience. #wrapper is given height: 1% because IE6.0/Win may occassionally not display #leftHuggerNotFloated without first highlighting it. ******************************/ #wrapper { background: red; height: 1%; } /*********************** Note, #leftHuggerNotFloated is positioned to the left of #floatRight but is NOT floated to the left. *************************/ #leftHuggerNotFloated { background: blue; clear: left; } #floatRight { background: yellow; clear: right; float: right; width: 200px; } #footer { background: #cccccc; clear: both; /* margin-top: 50px;*/ /* margin-top: 200px;*/ } Here is how the browsers all display it. No problem. When #footer is given a top margin of 50px, the problems begin. IE and Opera display it the same but FF doesn't appear to show any difference. I'm no expert when it comes to vertical (and collapsing) margins but I'm inclined to go with FF here. I think that #footer's top margin should be with respect to the previous staticly positioned element which is #leftHuggerNotFloated. IE and Opera appear to be taking the floating div as the reference point. Now here is where things get stranger. When I increase #footer's margin to 200px, suddenly IE agrees with FF and takes #leftHuggerNotFloated as the reference point while Opera continues to do it's own thing and measure the top margin from the floating div. So my questions a 1. With a top margin of 50px, am I right to assume that FF is displaying the page correctly? 2. Without changing the order of the HTML, are there any CSS techniques to get the browsers to agree on the reference point for #footer's top margin? (padding seems to achieve a similar effect though, assuming that I don't want to make use of #footer's border or background color in any way). I know a few ways of solving this problem by moving the source code around but right now that's not what I want to do. The reason I'm not floating #leftHuggerNotFloated is because I want the div to stretch to fill whatever horizontal space is available between the left side of the screen and #floatRight. With float, I'll need to specify a horizontal width (which I will not know in advance) otherwise the div will simply be as wide as the content it contains. I even tried messing around with negative margins. I made some progress but all the browsers started showing things differently. Yesterday I was able to get my page to validate with strict XHTML and get it looking exactly how I want it to in Firefox: http://www . restonheights . com/ However, the design falls apart a bit in IE6. Viewing in it IE6 causes the feedback div to grow causing a left-right scroll bar. Scary things also happen if you reduce the width of your browser. Again, it behaves perfectly in FF. Can anyone recommend an IE hack that would get that feedback div to behave? 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? So I have a body div which has a left and right div(columns). I need to add 2 more divs inside the left div. But, these 2 divs have to unordered lists in them. I know my CSS is pretty average if not worse. My layout looks fine except for when I add 2 divs.. I have the float:left with %50 widths.. Screen shot of how my layout looks. img209.imageshack.us/img209/2913/idear.gif I did not add any clear tags to my css.. which I think might be what's causing the issue. Side note: In IE compatibility view the top of the page has a gap and so does the right of the page.. the logo and footer are both 100% width and the top div has a -negative margin to close the gap, it looks fine without compatibility view, and fine in firefox, and chrome. XHTML passed validation and so did CSS. This is before even messing with the columns. I didn't do anything with the unordered lists. Maybe i should ask how to correctly make my layout first.. Because what I've been doing is just adding new divs where I see fit, and then going back to edit the CSS till it works. Thanks for helping me out! BTW: what book would you recommend me getting.. I understand basics of CSS and I think I'm good with XHTML, I just need to get a better definition of CSS than w3schools has to offer. Thanks again. I have floating items inside of floating items. The problem is I cannot clear my floating items in the middle column because that ruins the other columns. How can I clear floats in the middle column? Do you have any better ideas to make my layout work? I have attached in image of how the layout should work. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title</title> <style type="text/css"> #content { display: block; margin: 0 5px; padding: 0 10px; border-top: 1px solid #0B4867; } .content100 { width: 100%; padding: 0px; margin: 0 .5% 0 .25%; display: inline; background: #ffeeee; } .content50 { width: 48.75%; display: block; float: left; margin: 0 .5% 0 .25%; padding: 0px; background: #eeffee; } .content33 { width: 32.25%; display: block; float: left; margin: 0 .5% 0 .25%; padding: 0px; background: #eeeeff; } </style> </head> <body> <div id="content"> <div style="margin: 0px 215px; padding: 0px; border: 0px; display: block;"> <div class="content100"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus viverra malesuada turpis. Sed iaculis justo sed turpis. Nulla malesuada turpis sed nibh. Mauris dui quam, cursus at, sollicitudin a, auctor quis, ligula. Vivamus varius blandit velit. Sed eu nibh. Vestibulum sit amet massa. Maecenas elementum massa ac ligula. In vitae massa ut dui facilisis lacinia. Maecenas tristique pede in elit. Duis ultricies aliquam metus. Mauris neque. Nunc nec lectus eu metus rhoncus imperdiet. Etiam egestas semper nunc. Nunc pretium tincidunt felis. </div> <div class="content50"> <h2>Row 1, Column 1</h2> In nec est pretium elit eleifend semper. Suspendisse potenti. Nunc bibendum sollicitudin ante. Aliquam facilisis mi quis turpis. Nullam aliquet. Sed eget urna in metus mattis luctus. Sed nunc. Maecenas est. Morbi ullamcorper eros non magna. Donec auctor, orci pretium rutrum eleifend, pede arcu pretium dui, vitae vestibulum ante odio sit amet dui. Aliquam fringilla velit sit amet magna. Proin cursus, elit quis faucibus fermentum, diam tellus rhoncus nulla, ut iaculis orci velit id metus. Pellentesque diam metus, dapibus eu, vestibulum quis, elementum id, turpis. Morbi elementum, quam non rhoncus hendrerit, metus lacus bibendum ante, vitae sodales velit est eu neque. </div> <div class="content50"> <h2>Row 1, Column 2</h2> This column is not very high. </div> <div class="content100"> Donec sed velit mollis erat consequat ornare. Donec accumsan, sapien a posuere tristique, felis turpis tristique odio, nec accumsan velit ipsum eu tellus. Duis vel felis. Maecenas in arcu nec nisi cursus consectetuer. Ut ac felis. Mauris aliquet lectus quis nisl. Aliquam quis urna quis diam facilisis imperdiet. Curabitur sit amet eros. Curabitur purus. In arcu magna, bibendum varius, elementum non, cursus eget, nulla. Etiam vulputate velit. Sed interdum leo in ligula. Sed non justo id odio bibendum tincidunt. Sed dictum, ipsum eget blandit luctus, nisi felis rhoncus nisl, sodales imperdiet neque quam id mauris. </div> <div class="content33"> <h2>Row 2 Column 1</h2> Felis turpis tristique odio, nec accumsan velit ipsum eu tellus. Duis vel felis. Maecenas in arcu nec nisi cursus consectetuer. Ut ac felis. Mauris aliquet lectus quis nisl. Aliquam quis urna quis diam facilisis imperdiet. Curabitur sit amet eros. Curabitur purus. In arcu magna, bibendum varius, elementum non, cursus eget, nulla. Etiam vulputate velit. Sed interdum leo in ligula. Sed non justo id odio bibendum tincidunt. Sed dictum, ipsum eget blandit luctus, nisi felis rhoncus nisl, sodales imperdiet neque quam id mauris. </div> <div class="content33"> <h2>Row 2 Column 2</h2> This column is not as high as the previous one. </div> <div class="content33"> <h2>Row 2 Column 3</h2> </div> <div class="content100"> Nunc vel arcu. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam luctus tellus luctus magna. Aenean tellus sapien, venenatis id, hendrerit sit amet, lacinia sed, ante. Nullam metus. Sed cursus lobortis orci. Etiam suscipit, tellus ut rutrum mollis, urna libero ultrices lectus, non hendrerit quam elit id leo. Quisque sollicitudin, mi id imperdiet sollicitudin, orci enim rutrum nibh, non adipiscing diam augue commodo nunc. Maecenas erat massa, sagittis eu, sagittis at, commodo nec, dolor. Aliquam erat volutpat. Donec nisl erat, vulputate id, dictum non, vulputate egestas, sapien. Fusce non justo eu felis imperdiet placerat. Suspendisse mattis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ac tellus eget risus varius vehicula. In ante. </div> </div> </div> </body> </html> 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. In FF3 this code behaves correctly but not in IE6. The main content disappears. Any ideas why and how to fix it? Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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> <style type="text/css"> * { margin: 0; padding: 0; } body { background-color: #00FF00; } #wrapper { font-size:0.8em; font-family:"Arial"; position: relative; min-width:960px; } #container { margin: 0 auto; width: 960px; background-color: #fff; } #header { background-color: #0033FF; width:960px; padding-bottom:50px; height: 152px; } #contentWrapper { margin-left: auto; margin-right: auto; width: 85%; margin-top: -60px; z-index: 1; position: relative; background-color:#FFF; min-height:500px; padding-left:20px; padding-top:20px; } #mainContent { float:left; width:50%; } #services { padding-left:60px; float:left; } #footer { clear:both; background-color: #CC0033; clear: both; } </style> </head> <body> <div id="wrapper"> <div id="container"> <div id="header"> <p> Header: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec semper, eros a iaculis elementum, nisl orci vehicula odio, in sollicitudin libero sapien ac nibh. Etiam quis arcu sit amet felis vestibulum dignissim et sed augue. Maecenas commodo ornare urna non lacinia. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent libero dui, egestas id mattis sollicitudin, suscipit eget arcu. Vestibulum aliquet tempus dui, ut laoreet dolor imperdiet at. Vivamus eu porttitor arcu. Fusce sed lorem diam, sit amet condimentum risus. Aliquam commodo mi at orci mollis et mollis tortor varius. Fusce posuere turpis non diam placerat pretium. Vestibulum porttitor tristique molestie. Suspendisse dui libero, lacinia id commodo eget, facilisis vel purus. Aliquam viverra elementum turpis ac vulputate. </p> </div> <div id="contentWrapper"> <div id="mainContent"> <p> Header: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec semper, eros a iaculis elementum, nisl orci vehicula odio, in sollicitudin libero sapien ac nibh. Etiam quis arcu sit amet felis vestibulum dignissim et sed augue. Maecenas commodo ornare urna non lacinia. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent libero dui, egestas id mattis sollicitudin, suscipit eget arcu. Vestibulum aliquet tempus dui, ut laoreet dolor imperdiet at. Vivamus eu porttitor arcu. Fusce sed lorem diam, sit amet condimentum risus. Aliquam commodo mi at orci mollis et mollis tortor varius. Fusce posuere turpis non diam placerat pretium. Vestibulum porttitor tristique molestie. Suspendisse dui libero, lacinia id commodo eget, facilisis vel purus. Aliquam viverra elementum turpis ac vulputate. </p> <p> Header: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec semper, eros a iaculis elementum, nisl orci vehicula odio, in sollicitudin libero sapien ac nibh. Etiam quis arcu sit amet felis vestibulum dignissim et sed augue. Maecenas commodo ornare urna non lacinia. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent libero dui, egestas id mattis sollicitudin, suscipit eget arcu. Vestibulum aliquet tempus dui, ut laoreet dolor imperdiet at. Vivamus eu porttitor arcu. Fusce sed lorem diam, sit amet condimentum risus. Aliquam commodo mi at orci mollis et mollis tortor varius. Fusce posuere turpis non diam placerat pretium. Vestibulum porttitor tristique molestie. Suspendisse dui libero, lacinia id commodo eget, facilisis vel purus. Aliquam viverra elementum turpis ac vulputate. </p> <p> Header: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec semper, eros a iaculis elementum, nisl orci vehicula odio, in sollicitudin libero sapien ac nibh. Etiam quis arcu sit amet felis vestibulum dignissim et sed augue. Maecenas commodo ornare urna non lacinia. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent libero dui, egestas id mattis sollicitudin, suscipit eget arcu. Vestibulum aliquet tempus dui, ut laoreet dolor imperdiet at. Vivamus eu porttitor arcu. Fusce sed lorem diam, sit amet condimentum risus. Aliquam commodo mi at orci mollis et mollis tortor varius. Fusce posuere turpis non diam placerat pretium. Vestibulum porttitor tristique molestie. Suspendisse dui libero, lacinia id commodo eget, facilisis vel purus. Aliquam viverra elementum turpis ac vulputate. </p> </div> <div id="services"> <ul> <li>test 1</li> <li>test 2</li> <li>test 3</li> </ul> </div> </div> <div id="footer"> <p> Footer: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec semper, eros a iaculis elementum, nisl orci vehicula odio, in sollicitudin libero sapien ac nibh. Etiam quis arcu sit amet felis vestibulum dignissim et sed augue. Maecenas commodo ornare urna non lacinia. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent libero dui, egestas id mattis sollicitudin, suscipit eget arcu. Vestibulum aliquet tempus dui, ut laoreet dolor imperdiet at. Vivamus eu porttitor arcu. Fusce sed lorem diam, sit amet condimentum risus. Aliquam commodo mi at orci mollis et mollis tortor varius. Fusce posuere turpis non diam placerat pretium. Vestibulum porttitor tristique molestie. Suspendisse dui libero, lacinia id commodo eget, facilisis vel purus. Aliquam viverra elementum turpis ac vulputate. </p> </div> </div> </div> </body> </html> Hi. I have a top menu bar which is positioned below an image. The size of the image is stopping the menu bar from being further up, but I cant make the image smaller. Is there a way to put negative padding on the image to make the menu bar sit further up (effectivly on the image). To sum it up, here is an image: http://img40.imageshack.us/i/helpo.jpg/ Here is a link to the website: http://hiq.identityprojects.co.uk Here is the code for the image: Code: h1#logo a { display: block; text-decoration: none; color: #FFFFFF; font-size: 250%; width: 283px; height: 92px; padding-bottom:-20px; background: url(../images/logo.png) no-repeat; text-indent: -99999px; } The red is my stab in the dark to get it to work, which didnt work. Id really appreciate it if someone could enlighten me. Hi. The main gallery image is pushed down from the top of the logo on the page below: http://zombiemod.com/rm/nina2/main.php?g2_itemId=14 I want to move this block on the right up. I believe this uses the main-image-container div as shown below, but when I put a negative top margin on this div it doesnt move. The is the CSS I tried for the main-image-container div: Code: margin-top: -70px; This is the HTML: Code: <div id="content"> <div id="main-image-container" {if $theme.imageCount == 0}style="display:none"{/if}> {if $theme.imageCount > 0} <div id="slideshow-controlsx"> <ul id="control-buttonsx"> <li><button id="controls-left"><img src="{g->theme url="images/controls-left.png"}" alt="{g->text text="Left"}" /></button></li> <li><button id="controls-play"><img src="{g->theme url="images/controls-right.png"}" alt="{g->text text="Play"}" /></button></li> <li><button id="controls-right"><img src="{g->theme url="images/controls-right.png"}" alt="{g->text text="Right"}" /></button></li> </ul> </div> Why didnt my negative top margin work? |