CSS - Floated Elements Disrupting Background Image Of Body?
Hello DevShed CSS Help Forum,
I have a wierd problem (seems I have a knack for that ) with a design I'm working on. When you first go to this page there is some disruption around the two floated columns in the background image that is assigned to the body tag: (Right now the page is only working in non-IE browsers, but I don't know any developers that regularly use IE anyways...LOL) http://www.spidersend.com/new_site/newsite4/test6.html However if you refresh the page or click to another tab and then back to that page it corrects itself. Once I remove the sidebar and the float property from the css on the main content area the issue is gone so it has to be something to do with that. Has anybody experienced this before? I just find it odd that it doesn't stay messed up, but corrects itself, even if you refresh and clear the cache. Confusing and wierd. Any ideas? Theories? Any and all ideas are much appreciated. Here is the CSS: Code: body { background-color: #FFFFFF; padding: 0px; margin: 0px; font-family: "arial"; background-image: url('images/bottom_slice.png'); background-repeat: repeat-x; background-position: bottom center; } div#header { background-image: url('images/header_slice3.png'); background-repeat: repeat-x; height: 198px; width: 100%; } div#header-content { width: 680px; margin: 0px auto; } div#top-navigation { width: 680px; margin: 0px auto; position: relative; bottom: 16px; color: #FFFFFF; font-family: "arial"; font-size: 16px; padding: 0px; } div#content { width: 850px; float: left; } div#content-header { background-image: url('images/content_bg_top.png'); width: 850px; height: 30px; } div#content-footer { background-image: url('images/content_bg_bottom.png'); width:850px; height: 32px; } div#content-area { background-image: url('images/content_bg_slice.png'); padding-left: 18px; padding-right: 18px; } div#adbar { width: 157px; float: right; } div#adbar-header { background-image: url('images/sidebar_top.png'); width: 157px; height: 30px; } div#adbar-footer { background-image: url('images/sidebar_bottom.png'); width: 157px; height: 26px; } div#adbar-area { background-image: url('images/sidebar_slice.png'); padding-left: 5px; padding-right: 5px; } div#sidebar { float: right; clear: both; position: relative; right: 10px; background-color: #d2e7f0; width: 300px; -moz-border-radius: 5px; padding: 5px; margin-left: 15px; color: #0c577a; } div#sidebar2 { float: right; clear: both; position: relative; right: 10px; background-color: #d2e7f0; width: 300px; -moz-border-radius: 5px; padding: 5px; margin-left: 15px; margin-top: 20px; color: #0c577a; } div#content-wrapper { width: 1007px; margin: 0px auto; } Similar TutorialsHi everyone, this is my first post and I hope it's easily resolved. I'm new to CSS and working through CSS - The Missing Manual while slowly overhauling an old table-based web journal on the side. I'm trying to do the following: Left - navbar (~200px) Center - journal postings (~600px) Right - fixed image (~200px) // I want this to always be in sight I've gotten the first two nailed down nicely, but I'm having a really hard time with getting the fixed image to work. In extreme shorthand, the code relationship looks like this: <body> <nav-journal-image-wrapper width=1000> <nav-journal-wrapper width=800> <nav width=200> <journal width=600> </njw> </njiw> With the extra 200px of width in the final wrapper, I've been able to get the background image to be fixed and show nicely to the right of my navbar and journal post by making it the same 1000px in width. If the window is stretched, everything stays where it belongs - you just see more body background color. The problem is, when the window is condensed the final wrapper - despite having a set width - also is squeezed and my background image recedes under the journals. What I don't understand is why my navbar and journals seem impervious to small windows, but the wrapper around them with the background image is not? My code validates, and the relevant parts of the CSS start now: Code: <style type="text/css"> body { background-color:#333; } /* without this wrapper, the background in #nav-post-portrait-wrapper aligns with the screen right, not the wrapper's right */ #final-wrapper { background-color:red; width: 1034px; margin: 0 auto 0 auto; padding: 0; } /* this gives me an extra 200px on the right to show the fixed background image */ #nav-post-portrait-wrapper { margin: 0; padding: 0; width: 1034px; /* sets the max but doesn't seem to be preventing collapse */ background-color: white; background-image: url(CSS-TESTING/background-portrait-2.png); /* the image is also 1034px wide - I want this wrapper's width to be frozen! */ background-repeat: no-repeat; background-position: top; background-attachment:fixed; } /* this groups the navbar and postings together */ #nav-and-post-wrapper { background-color:#0F0; margin: 0; padding: 0; width: 828px; /* prevents collapse */ } /* begin nav sidebar CSS code */ #mainNav-wrapper { float: left; top: 0; margin: 0; padding: 0; height: 312px; width: 210px; } ul#mainNav { list-style: none; margin: 0; padding: 0; text-decoration: none; width: 200px; border-left: 2px solid #930; border-top: 2px solid #930; border-right: 2px solid #930; } ul li { width: 200px; margin: 0; padding: 0; height: 60px; border-bottom: 2px solid; border-bottom-color:#930; } /* end nav sidebar CSS code */ /* begin journal post CSS code */ #post-wrapper { margin-left: 214px; } .post { background-color:#6F9; border: 2px solid #930; width: 600px; height: auto; margin: 20px 0 0 0; padding: 0; } /* end journal post CSS code */ </style> <body bgcolor="#FFFFFF"> <div id="final-wrapper"> <div id="nav-post-portrait-wrapper"> <div id="nav-and-post-wrapper"> <div id="mainNav-wrapper"> <ul id="mainNav"> <li><a href="aboutme.htm" id="nav-about-me"></a></li> <li><a href="journalmain.htm" id="nav-journal-main"></a></li> <li><a href="beverageguide.htm" id="nav-beverage-guide"></a></li> <li><a href="guestbook/index.php" id="nav-graffiti"></a></li> <li><a href="contact.htm" id="nav-contact"></a></li> </ul> </div> <div id="post-wrapper"> <div class="post"> la la la </div> <!-- closes post div class --> <div class="post"> la la la </div> <!-- closes post div class --> <div class="post"> la la la </div> <!-- closes post div class --> <div class="post"> la la la </div> <!-- closes post div class --> <div class="post"> la la la </div> <!-- closes post div class --> </div> <!-- closes post-wrapper div id --> </div> <!-- closes nav-and-post-wrapper div id --> </div> <!-- closes nav-post-portrait-wrapper div id --> </div> <!-- closes final-wrapper div id --> </body> Thank you very much! Hello all, I'm having a bit of trouble with a list of relative, floated <li> elements, each containing a single absolutely positioned div that appears on hover. I'm using the :hover pseudo-class currently but I will use JavaScript for IE6 once it displays correctly. The code is below. The problem is that the <div> appears on top of it's parent element but behind all other elements. Code: #wrapper-body ul.staff-list{ list-style-type:none; padding-top:10px; position:relative; } #wrapper-body ul.staff-list-team{ width:313px; padding-top:0; padding-bottom:15px; margin-bottom:20px; border-bottom:1px solid #d7e3a9; } #wrapper-body ul.staff-list li{ float:left; width:230px; position:relative; padding:8px 0 8px 15px; z-index:1; } #wrapper-body ul.staff-list-team li{ width:151px; padding-left:0; padding-left:5px; } #wrapper-body ul.staff-list-team li.right{ padding-left:5px; } #wrapper-body ul.staff-list-clerks li{ float:none; width:310px; padding-left:5px; } #wrapper-body ul li.highlight{ background-color:#f4f6ec; } #wrapper-body ul.staff-list li p{ padding:0 0 9px 0; margin-left:91px; } #wrapper-body ul.staff-list li small{ padding:0 0 5px 0; margin-left:91px; } #wrapper-body ul.staff-list-clerks li span{ color:#A6302B; display:block; float:left; } #wrapper-body ul.staff-list-clerks li span.clerk-name{ width:140px; } #wrapper-body ul.staff-list-clerks li span.clerk-phone{ width:120px; background:url(../img/structure/clerks-phone.gif) 0 2px no-repeat; padding-left:23px; } #wrapper-body ul.staff-list-clerks li a.clerk-email{ display:block; float:left; height:16px; width:16px; background:url(../img/structure/clerks-mail.gif) 0 3px no-repeat; } #wrapper-body ul.staff-list li div.staff-list-detail{ display:none; background:url(../img/structure/staff-list-bottom.gif) left bottom repeat-x; padding-bottom:3px; margin-top:-15px; left:4px; z-index:10; top:15px; position:absolute; } #wrapper-body ul.staff-list li div.staff-list-detail a{ background:url(../img/structure/staff-list-bullet.gif) no-repeat 0 4px; padding-left:8px; } #wrapper-body ul.staff-list li:hover div.staff-list-detail{ display:block; } An image of what is happening below: Thanks for reading! Hi, I have a question about setting up the Body background-image via a linked external stylesheet. I have a index.html file and a myStyle.css file. I want to setup the background to load an image file, test.JPG. When I embed the following in my index.html, I see the background show up: ** inside index.html file ** <BODY STYLE="background-image: url(test.JPG);"> blah </BODY> BUT, when I define my background in the externally linked myStyle.css file, the background does not load: ** inside myStyle.css file ** BODY { background-image: url(test.JPG); } ** inside index.html file ** <LINK REL="stylesheet" TYPE="text/css" HREF="myStyle.css"> <BODY> blah </BODY> </LINK> Please help. thanks! Hello, I had a site exactly how I wanted to and messed up a css file. I am almost back to where I was but I am having an issue with the background image of the body element. Please look at this layout - Client Website . Notice how the hardwood floor does not go all the down? I have the image sized to 1500 pixels high and yesterday I did not have this issue. Also, when I outline elements in FF I see the body element seems to fall short. Any help would be appreciated. Tom #bg-one { background: white url(some.png); } #bg-two { background: white url(someother.png); } =========== ... </head> <body id=bg-one"> ... ... </head> <body id=bg-two"> Hi All Need some help with a positioning/alignment problem - divs not vertically aligning with body background image in IE: http://www.flatsinbraunton.co.uk/ce/ 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>Colin Essery Carpets</title> <style type="text/css"> html { font-family:Helvetica,Arial,sans-serif; } body { font-family:Helvetica,Arial,sans-serif; text-align: center; background-image:url(images/bg-body.jpg); background-repeat:repeat-x; } #container { position: relative; margin-left: auto; margin-right: auto; width: 800px; text-align: left; } #logo { position:absolute; left:0px; top:78px; width:327px; height:102px; } #headstrap { position:absolute; left:327px; top:78px; width:473px; height:102px; } img { border-style: none; } </style> </head> <body> <div id="container"> <div id="logo"> <a href="index.php"><img src="images/logo-main.gif" alt="Colin Essery Carpets - North Devon" width="328" height="102" /></a> </div> <div id="headstrap"> <img src="images/head-strapline.gif" alt="Colin Essery Carpets - North Devon" width="473" height="102" /> </div> </div><!--END CONTAINER DIV --> </body> </html> Any help welcome thanks Rich Hi guys, Is it possible in CSS to change the colour / image of the page background dynamically. So that as you hovered over different links , the background of the page changed. I know you can do this in JS but how would you do it in CSS? I was kinda thinking something like: a.linkname:hover, a.linkname:focus body { background-color:#00FF00; } but thats just a guess and doesnt work lol. Many Thanks, Alvin. I'm working on a pet project on the off chance that I could be hired by a small business referral organization in the city where I live, so this isn't super urgent. I'm also not a web developer by trade, more IT, so if I make any obvious mistakes, feel free to point them out. I've got a simple absolute-positioned two-column layout and a two-color background that I want to tile vertically behind it. The problem seems to be that the browsers ( IE and FF, haven't tried chrome/safari/opera) seem to think that the body ends at the bottom of the logo I set on top, and won't tile it beyond the bottom of the image. HTML: 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> <link rel="stylesheet" type="text/css" href="css/stylesheet.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Hub City Business Network | Word-Of-Mouth Business Referrals in Hattiesburg, Mississippi | Home</title> </head> <body> <div id="content"> <div id="logo"><a href="index.htm"><img src="images/hcbnlogo1transparency.png" alt="Hub City Business Network" /></a></div> <div class="left"> <div id="navigation"> <ul> <li><a href="index.htm">Home</a></li> <li><a href="members/index.htm">Members</a></li> <li><a href="contact.htm">Contact Us</a></li> </ul> </div> <div id="leftinfo"> <p>We meet for breakfast every Tuesday,<br /> 7 - 8:30 AM. <br /> at the Neal House at<br /> 1311 East Hardy St.</p> </div> </div> <div class="right"> <p>Hub City Business Network (HCBN), is a Hattiesburg-based business networking group that meets every Tuesday for breakfast at 7:00 till 8:30 A.M. Our membership is composed of some of the finest and best-respected business men and women in Hattiesburg. Our networking model is predicated on the idea that people do business with people they know, trust, and like. Our members know that they can confidently refer business to a member and the referral will be handled in a timely, professional manner. In addition, we encourage members to meet outside of the weekly meetings for one-on-one Strategic Marketing Sessions (SMS). An SMS usually takes the form of a lunch or coffee, and gives members time to discover in a more relaxed environment things about other members that don't surface at the regular weekly meetings. </p> </div> <div id="footer"> <p>Site built by Robert Greenstreet</p> </div> </div> </body> </html> CSS: Code: html { width:100%; } #logo img { margin:10px 0px 0px 20px; width:400px; height:100px; } img { border:0px; } a:link { color:#29497f; } a:visited{ color:#5dd0c0; } body { width:650px; margin-left:auto; margin-right:auto; background-color:#29497f; } #content { /*height:500px;*/ width:650px; background-image:url('../images/bg1.png'); background-repeat:repeat-y; background-attachment:fixed; background-position:center; margin-top:-10px; } .left { position:absolute; left:auto; top:120px; width:15em; margin-left:12px; padding-left:0px; } .left ul { list-style-type:none; margin-left:-33px; font-family:sans-serif; } #leftinfo { margin-left:10px; width:9em; } .right { position:absolute; left:auto; top:120px; width:27em; margin-left:12em; font-family:sans-serif; } .right p { color:#000000; } #memberlist ul { margin-left:-40px; } #memberlist a:visited{ color:#6a92d4; text-decoration:none; } #footer { position:absolute; top:400px; width:650px; margin:0 auto; } Also, I'm working on getting that footer centered about 30px from the bottom of the page, without running up into whatever content may be above it. I think I might be able to figure that one out on my own, though. Like I said, no rush. This isn't a paid gig Hello, I'm trying to achieve an effect using a background image with an inline element. Specifically, I have certain hyperlinks that I want to display a graphical arrow to the right of. Essentially, it looks something like: Hyperlinked text here >>> Where ">>>" is actually a small graphic approximately 20 pixels wide. I don't want to place the image inline, because it's a visual effect and users don't need to "interact" with it. And it's also tied in with the style of the site, so controlling it through CSS is very attractive. I figured out that if I add about 20 pixels of padding to the right of the ANCHOR element, I can use the graphic as a CSS background image. Looks good in IE5+ and Mozilla-based browsers (not concerned with NS4), as long as the ANCHOR text is on one line. Problem is, when the text of the ANCHOR element breaks across two or more lines, I lose the image in IE. Of course, Mozilla-based browsers handle it perfectly -- it's just Microsoft's little problem child that's giving me fits. Anyone else have any luck using a background image on an inline element that spans two or more lines? I can't find any documented hacks or the like to help me out. Any help is greatly appreciated! -Chris I have two items (text) floated left. But when I hit print preview the second text label "wraps" under the first so the are both aligned left. I would like to keep positions fixed when viewing and printing. Happens in both FF and IE. Thanks, Doug Does such a thing exist... what I mean is that div {background-imageimage.png);background-attachment:fixed;} would work in IE (like it does in mozz) Does anyone know of any hacks/workarounds/techniques to get this to work in the brilliant IE? Cheers All but the last image disappear in IE6 (works in FF and Safari). I searched the web for a bug fix but have not found anything that works. Any assistance would be greatly appreciated. Thanks in advance. Here is the live link: http://www.crossmediamgmt.com/HelpwithIE6bug.html Here is my code: Code: <style> #news{ float: left; width: 179px; height: 332px; padding-top: 30px; } #news ul{ margin: 0; list-style: none; text-decoration: none; } #news a { display: block; text-decoration: none; } #news img{ border: none; } #news a#Mar08{ width: 179px; height: 20px; background: url(../imagesjp/March_2008.gif)0 0 no-repeat; } #news a#Mar08:hover{ background-position: 0 -20px; } #news a#Sep07{ width: 179px; height: 20px; background: url(../imagesjp/september_01.gif)0 0 no-repeat; } #news a#Sep07:hover{ background-position: 0 -20px; } #news a#Aug07{ width: 179px; height: 20px; background: url(../imagesjp/august_2007.gif)0 0 no-repeat; } #news a#Aug07:hover{ background-position: 0 -20px; } #news a#May07{ width: 179px; height: 20px; background: url(../imagesjp/may2007.gif)0 0 no-repeat; } #news a#May07:hover{ background-position: 0 -20px; } #news a#Apr07{ width: 179px; height: 20px; background: url(../imagesjp/april2007.gif)0 0 no-repeat; } #news a#Apr07:hover{ background-position: 0 -20px; } #news a#Feb07{ width: 179px; height: 20px; background: url(../imagesjp/february_01.gif)0 0 no-repeat; } #news a#Feb07:hover{ background-position: 0 -20px; } #news a#Nov06{ width: 179px; height: 20px; background: url(../imagesjp/november.gif)0 0 no-repeat; } #news a#Nov06:hover{ background-position: 0 -20px; } #news a#Aug06{ width: 179px; height: 20px; background: url(../imagesjp/august2006.gif)0 0 no-repeat; } #news a#Aug06:hover{ background-position: 0 -20px; } #news a#Jul06{ width: 179px; height: 20px; background: url(../imagesjp/july.gif)0 0 no-repeat; } #news a#Jul06:hover{ background-position: 0 -20px; } #news a#Jun06{ width: 179px; height: 20px; background: url(../imagesjp/june.gif)0 0 no-repeat; } #news a#Jun06:hover{ background-position: 0 -20px; } #news a#May06{ width: 179px; height: 20px; background: url(../imagesjp/may_2006.gif)0 0 no-repeat; } #news a#May06:hover{ background-position: 0 -20px; } #news a#Apr06{ width: 179px; height: 20px; background: url(../imagesjp/april2006_01.gif) 0 0 no-repeat; } #news a#Apr06:hover{ background-position: 0 -20px; } </style> </head> <body> <div id="news"> <img src="../images/news_img.jpg" alt="News" width="179" height="62" /> <ul> <li><a href="news_sealing_selling_cracks.html" id="Mar08"></a></li> <li><a href="news_maximizing_every.html" id="Sep07"></a></li> <li><a href="news_print_solution.html" id="Aug07"></a></li> <li><a href="news_americanprinter.html" id="May07"></a></li> <li><a href="news_printer&mediabuyer.html" id="Apr07"></a></li> <li><a href="news_printingnews.html" id="Feb07"></a></li> <li><a href="news_printing_impressions.html" id="Nov06"></a></li> <li><a href="news_dallas_branchout.html" id="Aug06"></a></li> <li><a href="news_dallas_growingprinter.html" id="Jul06"></a></li> <li><a href="news_dallas_businessgernal.html" id="Jun06"></a></li> <li><a href="news_media_wins.html" id="May06"></a></li> <li><a href="news_visionaries.html" id="Apr06"></a></li> </ul> </div> </body> </html> Hi all, I would like to be able to have the body background change when moving from page to page. Is it possible, without javascript. Code: body { margin: 0px; padding: 5px 0px 5px 0px; background: url(blue2.jpg) fixed; } { Specifically the surrounding blue2.jpg that frames the page. page link css link Thanks. Before I state the problem, let me say that I am working towards properly validated html and css. There are a couple tables in my design that I put in just to show the boss something pretty! They will be gone soon. I have 3 places on the page where I'm using images as links to effect behavior with javascript or forms. My menu's going down the left side of this template has +/- "buttons" to toggle nested lists on and off. By using margin-top:-14px they are lining up slightly higher then needed in FF, slightly lower then needed in IE and way to high in Safari. If i set the margin-top to 0, then I get it lined up nicely in safari and IE and FF are off. The images inside of the <li>'s This is the css code I believe to be relevent css Code: Original - css Code .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } div.redbox img.plusminus { float:right; margin:-16px 3px 0 0; padding:0 0 0 0; height:10px; } .clearfix:after { html Code: Original - html Code <li id="item1" class="border-bottom clearfix"> <a href="/store/category/50">T-SHIRTS</a> </li> <li id="item2" class="border-bottom clearfix"> <a href="/store/category/51">PANTS</a> <a onclick="toggle('item2');"><img src="/images/closed.gif" alt="closed image" class="plusminus" class="plusminus" id="img_item2" /> </a> <ul id="ul_item2" class="closed"> <li class="sidebarsub"> <a href="/store/subcategory/325">PROTECTIVE</a> </li> </ul> </li> <li id="item1" class="border-bottom clearfix"> <a href="/store/category/50">T-SHIRTS</a> </li> <li id="item2" class="border-bottom clearfix"> <a href="/store/category/51">PANTS</a> <a onclick="toggle('item2');"><img src="/images/closed.gif" alt="closed image" class="plusminus" class="plusminus" id="img_item2" /> </a> <ul id="ul_item2" class="closed"> <li class="sidebarsub"> <a href="/store/subcategory/325">PROTECTIVE</a> </li> </ul> </li> Is this a common thing in CSS that there might be a tutorial out there on how to fix it? I've looked at using overflow and that doesn't seem to fix the problem. the link for the page... Template Thanks for having a look My problem is that I need to get the Body Background color that is in a css file using php to then introduce this color to an applet. My CSS file has: BODY { FONT-SIZE: 12px; COLOR: #6699ff; BACKGROUND-COLOR: #ffffff; SCROLLBAR-FACE-COLOR: #FFFFFF; SCROLLBAR-HIGHLIGHT-COLOR: #CC6699; SCROLLBAR-SHADOW-COLOR: #CC6699; SCROLLBAR-3DLIGHT-COLOR: #CC6699; SCROLLBAR-ARROW-COLOR: #CC6699; SCROLLBAR-TRACK-COLOR: #FFFFFFF; SCROLLBAR-DARKSHADOW-COLOR: #CC6699; FONT-FAMILY: "Times", serif; } But I use different CSS so very time I change the file I need to know in the php page what BACKGROUND-COLOR it has. I haven't succeed in getting the Javascript's DOM to tell me what the body's background color is... Here's the code I got Code: mybody = document.getElementsByTagName("body"); alert(mybody.getAttribute("background-color")); //alert(mybody.style.backgroundColor); Nice references I looked up from are http://www.mozilla.org/docs/dom/technote/tn-dom-table/ http://www.sitepoint.com/print/rough-guide-dom http://www.mozilla.org/docs/dom/domref/dom_style_ref.html http://developer.apple.com/internet/webcontent/dom2ii.html i have a problem dynamically setting the html background color when i initially set it with css. if i have a javascript function: function changeColor() { document.bgColor = '#FFFF00'; } and call it when i click a button the background color changes like you'd expect. but if i initialize the background color like this: body{background-color: #FF0000;} and then later call my javascript function to change the background color like before, it doesn't do anything. what's going on here? and how can i initialize the background color and still be able to dynamically change it? thanks On page - URL address blocked I have an img floated to the left, with some text floating around the right side. After this image, I have an h2, styled to clear:both, with a top-margin: 3em. With this floated image preceding, when the image is longer than the paragraph or other text floating around it, and the bottom of the image is "sitting on top of" the h2, the browser ignores the 3em top margin on the h2, unless I include a br, styled to clear:both. So, I can solve the problem with this clearing break, but it sort of chafes me. This doesn't look like typical collapsing margin. I'm not losing the overlapping margin between the two elements, I'm losing all of the margin! The page is coded with the breaks in place. I can re-create the "issue" using Firebug to remove the br tag. Suggestions? Thanks in advance. The text in the <p> isn't wrapping around the image in IE. Works fine in FF. What am I doing wrong? Code: <div class="floatright"><a href="./images/storyimages/1192298760_15.jpg"><img class="storyimage" border="0" src="./images/storyimages/thumbs/1192298760_15thumb.jpg" alt=""></a><br>This is a caption</div> <p> Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse viverra, orci venenatis consectetuer faucibus, purus nibh feugiat libero, nec pulvinar nulla orci ut lectus. Ut pellentesque pharetra erat. Proin quis lacus ut sapien ullamcorper consectetuer. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse viverra, orci venenatis consectetuer faucibus, purus nibh feugiat libero, nec pulvinar nulla orci ut lectus. Ut pellentesque pharetra erat. Proin quis lacus ut sapien ullamcorper consectetuer. </p> This is all in the main_col_right <DIV>. Here's the CSS: Code: .floatright { float: right; margin: 0 10px 10px; } #main_inner_wrap { margin:0 auto; width:690px; } #main_inner_wrap p { font-family: Geneva, Verdana, Arial, Helvetica, sans-serif; font-size: .9em; line-height: 1.4em; padding:0 10px; min-height: 100%; } #main_col_left { float:left; width:150px; color: #330; line-height: 1.5em; } #main_col_right { margin-top: 0; float:right; width:540px; color: #330; background:url("./images/news_bg.gif"); background-repeat: repeat-y; } Hello, first post here... I have an image floated left, with an unordered list (ul) next to it. Problem is, the margin values I set for the list are totally ignored, so the list bullets end up overlapping the image. Seems the only solution is to set margins on the image, but that also pushes away non-overlapping content, like the h3 that is above the list and positioned fine. Any ideas? Everything works fine if/when I float the list left, but that seems draconian... Code: css Code: Original - css Code img.alignleft { margin-right:0.5em; display:inline; float:left; } ul, ol, dl { line-height:1.5em; margin:0 0 1em 1em; }
HTML4Strict Code: Original - HTML4Strict Code <p><img src="" width="295" height="400" class="alignleft"/></p> <h3>A Sampling of Workshops We Have Brought to Nonprofits</h3> <ul> <li>An Introduction to Social Media for the Nonprofit</li> <li>An Introduction to Storytelling for the Nonprofit</li> <li>Using Social Media and Digital Storytelling in the Classroom</li> </ul> <p><img src="" width="295" height="400" class="alignleft"/></p> |