CSS - Background Not Showing Up In Container... Please Help!
Hey guys, I've recently started working on my css and for some reason my background image isn't showing up in my container. Any idea why?
CSS Code: Original - CSS Code /* CSS Document */ * { margin: 0; padding: 0; } body { font-size: 62.5%; background: #344149; } p, li { font: 1.2em/1.8em Tahoma, sans-serif; margin-bottom: 10px; } h1 { font: 2.0em Tahoma, sans-serif; color: white; height: 0px; } h2 { font: 1.8em Tahoma, sans-serif; color: green; margin-bottom: 10px; } ul { margin-left: 25px; } img { border: none; } #page-wrap { background: black; min-width: 780px; max-width: 1260px; margin: 10px auto; width:expression(document.body.clientWidth < 782? "780px" : document.body.clientWidth > 1262? "1260px" : "auto"); } #page-wrap #inside { margin: 10px 10px 0px 10px 10px; padding-top: 10px; padding-bottom: 10px; } #main-content { background: transparent url(/Images/Background_Content.jpg) no-repeat top right; padding-left: 180px; padding-right: 180px; padding-top: 20px; } #header { background: #000000; text-align: center; } #left-sidebar { background: transparent url(/Images/Background_Content.jpg) no-repeat top right; width: 150px; float: left; padding-left: 15px; padding-top: 20px; } #right-sidebar { background: transparent url(/Images/Background_Content.jpg) no-repeat top right; width: 150px; float: right; padding-right: 15px; padding-top: 20px; } #footer { background: #267f23; text-align: center; padding-top: 20px; padding-bottom: 20px; color: white; } /* CSS Document */ It's the Background_Content.jpg that isn't loading for some reason. It resides in the Image folder located in the same directory as the html file. Oh and the reason I had it included so much was to test to see if it was just the main-content that wouldn't load it. The main content should include the left-sidebar and right-sidebar right? Please help! Similar Tutorialshello all. thanks for your time. i am having some issues with a background image & color not showing up in a container div. here is the snippet from the CSS where the background image and color are defined. you can view the full CSS http://americanwalkincoolers.com/test/css/site.css Code: #container { background: url('./img/faux_bg.gif') repeat-y top left #496d9d; width: 960px; height: 100%; margin-left: auto; margin-right: auto; margin-top: 0px; margin-bottom: 0px; padding: 0px; } and the page is he http://americanwalkincoolers.com/test/index.html i am attempting to cheat on the layout by placing a background color/image that will make the right column extend the length of the page. currently the right column has a graphic that says "featured products" followed by a gap that runs the length of the container. can anyone help me? bonus points if you can explain to me why the BG color & BG image aren't showing up from the container. thanks again. The container should put a 1px solid border around the website, and it does in IE, however, in FF it just puts a border around the top couple pixels. Here is the website, http://www.sdtars.com/development/index.php I can't figure out how to get the #container's height to take on the height of the website. Hi I have searched on this subject, and found the Faux Column articles, but I have failed to make use of these. The following page shows the problem LINK And CSS The text in the container div leads off the bottom of the page. The CSS is a bit of a mess at the moment because I have been messing with it trying to get this to work. I need the background of the container div to extend to the bottom of the content div. I have set min-height and heights for the body and html tags, and then for the container, as I know that the height is only taken into account if the parent has a height too. This does not work. Any suggestions? Thanks Jake Look at this page - http://certified.tmhdesign.com/about.asp I have a div called container, then in that div one called header, content_right, content_left, and footer. What is frustrating me is that I have to hard code a min-height for the left and right colums and if you scroll down you'll see where the background color of the body appears below the right column which I want to be white. When I specify the color of the container that does not fix the issue. Any help would be appreciated. Thanks. Hoping someone can help me out as I'm still pretty new to the whole web design thing. I'm using CSS to create a container wrapper. As you can see from the code I have a bottom, top and center image. When I was using JPEG images everything lined up correctly, however I needed to switch to PNG image files (to take advantage of transparency) and now the top and bottom sections of the wrapper are offset. Here is a live link: storrepictures.weebly.com/projects.html -Please find an image of the resulting problem he http://i.imgur.com/YnTS8.png -This is how it looks when I use JPEGs instead of PNGs: http://i.imgur.com/2WMFN.png Here is my CSS wrapper code: Code: #wrapper { background: url(containerbg.png) center repeat-y; } #wrappertop{ background: url(containertop.png) top center no-repeat; } #wrappertbtm{ background: url(containerbtm.png) bottom center no-repeat; padding-bottom: 65px; } And here is the HTML: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>{title}</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!--[if lt IE 7]> <style> #content { height:400px !important; } </style> <![endif]--> </head> <body class="wsite-theme-light"> <div id="wrappertop"> <div id="wrapper"> <div id="header"> <div id="headerleft">{logo max-height="60"}</div> <div id="navigation">{menu}</div> </div> <div id="content">{content} <div id="footer">{footer} <div id="wrappertbtm"> </div> </div> </div> </div> </div> </div> </body> </html> I've been working on converting to css for table-like layout. I have the three column variety with a header. Around all 4 is a container to keep things ship shape. My issue is that even though I've specified a background colour for the container it doesn't seem to override the body color making the column lengths uneven. 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" xml:lang="en" lang="en"> <head> <title>mrhodges.net: A web site for Mr. Hodges classes</title> <style type="text/css" > body { background-color: #014e82; text-align: center; font-family: Georgia, serif; } #container { width: 90%; margin: 10px auto; background-color: #ffffff; text-align: left; } #banner { background-color: #014e82; padding: 1px; } #banner p.title { font-size: 2.5em; color: #ffffff; background-color: #014e82; text-align: center; margin: 0; padding: 0 0 5px 0; } #banner ul { list-style-type: none; text-align: center; padding: 0 0 10px 0; margin: 0; font-family: Verdana, arial, sans-serif; font-size: 10pt; color: #ffffff; } #banner ul li { display: inline; } #banner ul li a { text-decoration: none; padding: 0; } #banner a:link { color: #ffffff; padding: 0; } #banner a:visited { color: #ffffff; padding: 0; } #banner a:hover { color: #ffffff; text-decoration: underline; padding: 0; } #banner a:active { color: #54b818; text-decoration: underline; padding: 0; } #leftnav { float: left; width: 160px; margin: 0px; padding: 3px 5px 5px 5px; background-color: #fff; } #leftnav ul { margin: 0; padding: 0; list-style-type: none; } #leftnav a { display: block; color: #049; background-color: #fff; text-decoration: none; padding: 0 0 0 5px; } #leftnav a:hover { background-color: #ddd; color: #049; } #rightnav { float: right; width: 160px; margin: 0px; padding: 3px 5px 5px 5px; background-color: #fff; } #middle { margin-left: 160px; margin-right: 160px; padding: 10px; } </style> </head> <body> <div id="container"> <div id="banner"> <p class="title">mrhodges.net</p> <ul> <li><a href="http://www.cbc.ca/news/">CBC News</a> |</li> <li><a href="http://dictionary.reference.com/">Dictionary</a> |</li> <li><a href="http://www.fmcsd.ab.ca">FMCSD</a> |</li> <li><a href="http://www.google.ca">Google</a> |</li> <li><a href="http://www.mymcmurray.com">mymcmurray</a> |</li> <li><a href="http://www.theweathernetwork.com/weather/cities/can/Pages/CAAB0124.htm">Weather</a> |</li> <li><a href="http://en.wikipedia.org/wiki/Main_Page.html">Wikipedia</a></li> </ul> </div> <div id="leftnav"> <ul> <li><a href="overview.html">Course</a></li> <li><a href="overview.html">Overview</a></li> <li><a href="outline.html">Outlines</a></li> <li><a href="outline.html#modules">Modules</a></li> <li><a href="projects.html">Projects</a></li> <li><a href="rap.html">RAP Program</a></li> </ul> <br /> <ul> <li>Safety</li> <li>Consent</li> <li>.pdf form</li> </ul> <br /> <ul> <li><a href="dates.html">Dates</a></li> <li><a href="dates.html#term">Term</a></li> <li><a href="dates.html#plc">PLC Days</a></li> <li><a href="dates.html#holi">Holidays</a></li> <li><a href="dates.html#inter">Interviews</a></li> <li><a href="dates.html#mod">Module</a></li> <li><a href="dates.html#exam">Exam</a></li> </ul> <br /> <ul> <li><a href="http://www.mrhodges.blogspot.com">Daily Log</a></li> <li><a href="http://www.mrhodges.blogspot.com">Class Log</a></li> </ul> <br /> <ul> <li><a href="contact.html">Contact</a></li> <li><a href="contact.html">School</a></li> <li><a href="contact.html">Mr. Hodges</a></li> </ul> <br /> </div> <div id="rightnav"> <ul> <li>link</li> <li>link</li> <li>link</li> <li>link</li> <li>link</li> <li>link</li> <li>link</li> <li>link</li> <li>link</li> <li>link</li> <li>link</li> </ul> </div> <div id="middle"> <p>The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. </p> </div> </div> </body> </html> Hi, my css is probably a mess as I've been hacking things together for a few days. my site:jasondaydesign.com I have a div where my content divs are contained. In firefox & chrome, the background for the div shows fine. In IE, the background does not show. I'm not sure where the css issue is that's causing this. Could someone point me in the right direction for solving this? Thanks! Hi: I have the following in my CSS file: PHP Code: #body { background: url('images/columns.gif') repeat-y; text-align: left; } The problem is that the background image is not showing up un MS Internet Explorer. It works fine in Firefox. Is this a bug? Do I need a hack? For some reason no matter how I structure the code, I cannot get a background image to show up and I'm not sure why. Here is my current code:
Code: background: #cccccc url(/dir/bg.png) repeat-y; I've checked multiple sites just to verify that my code is correct, and it is. I've also tried the code another way: Code: background-color: #cccccc; background-image: url(/dir/bg.png); background-repeat: repeat-y; The image is uploaded to the correct directory as well. Any ideas? This puzzles me for this is the first time EVER that it is not working. I have "background-image" coding and NONE of those images are even showing up, yet when i add them on the index file as a normal image all is well... Any ideas? I'm trying to use stylesheets to make a fixed, no-repeat background. It is working in Mozilla 1.0, but it's not showing up right in IE 5.5. Any ideas why? The site is at http://www.people.virginia.edu/~bjl6d/journal.html. The part that I put in my style sheet is: .journaltext { font-family: "Book Antiqua", Garamond; font-size: 12px; font-weight: normal; color: #000000; background-image: url(../images/layout/Layout_r2_c2.jpg); background-repeat: no-repeat; background-attachment: fixed; background-position: left top} Everything is perfect in Mozilla, but when I view it in IE, the background is not fixed. It doesn't repeat, which is good, but it's still not fixed. Any ideas what's wrong here? My page works great in firefox, but in IE the top navigation div (top_navigation) SHOULD have a background color of red for testing perposes, but the color doesn't change! It looks like its inheriting the background color #e4dfd7 from the css body tag. I've tried using an inline style, or using !important, nothing works, and I have to make this available in at least IE6 and up. Thanks in advance for any help! html code -> cosmosristorante dot com / ox / index.asp Hi all, I haven't been working with CSS that long and I've searched for a fix but couldn't get anything to work. I can't get a background color to display in Firefox but it does in IE. Inside my "mainwrap" I have two columns and for some reason when I set my background to white for the "mainwrap" it just doesn't show up in Firefox. Here's xhtml code: xhtml Code: Original - xhtml Code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="css/main.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="toparea"> <div id="header"></div> <!--end header--> <div id="menuarea"> <div id="menubox"> </div> <!--end menubox--> </div> <!-- end menuarea--> </div> <!--end toparea--> <div id="middlearea"> <div id="mainwrap"> <div id="topwrap"></div> <!--end topwrap--> <div id="leftcolumn"> <div id="content"></div> <!--end content--> <div id="recentwork"></div> <!--end webwork--> </div><!--end leftcolumn--> <div id="rightcolumn"></div> <!--end rightcolumn--> <div id="bottomwrap"></div> <!--end bottomwrap--> </div> <!--end mainwrap--> </div> <!--end middlearea--> <div id="bottomarea"></div> <!--end bottomarea--> </body> </html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="css/main.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="toparea"> <div id="header"></div> <!--end header--> <div id="menuarea"> <div id="menubox"> </div> <!--end menubox--> </div> <!-- end menuarea--> </div> <!--end toparea--> <div id="middlearea"> <div id="mainwrap"> <div id="topwrap"></div> <!--end topwrap--> <div id="leftcolumn"> <div id="content"></div> <!--end content--> <div id="recentwork"></div> <!--end webwork--> </div><!--end leftcolumn--> <div id="rightcolumn"></div> <!--end rightcolumn--> <div id="bottomwrap"></div> <!--end bottomwrap--> </div> <!--end mainwrap--> </div> <!--end middlearea--> <div id="bottomarea"></div> <!--end bottomarea--> </body> </html> Heres the CSS: css Code: Original - css Code /* CSS Document */ body { background-image: url(../images/bottombg.jpg); background-repeat: repeat; font-family: Tahoma, sans-serif; margin: 0; } /* Begin top area */ div#toparea { width: 100%; height: 128px; background-image: url(../images/topareabg.jpg); background-position: top; background-repeat: repeat-x; float: left; } div#header { width: 800px; height: 100px; background-image: url(../images/headerbg.jpg); margin-left: auto; margin-right: auto; } div#logo { float: left; margin-top: 25px; margin-left: 5px; } div#tagline { margin-top: 37px; margin-left: 5px; float: left; } div#menuarea { width: 800px; height: 25px; margin-left: auto; margin-right: auto; } div#menubox { float: right; } .buttonbox { float: left; } .buttonbox img { border: none; } /* Begin middle area */ div#middlearea { width: 100%; background-image: url(../images/middleareabg.jpg); background-repeat: repeat; float: left; } div#mainwrap { width: 800px; margin-left: auto; margin-right: auto; background-color: #FFFFFF; } div#topwrap { width: 800px; height: 20px; background-image: url(../images/topNavbg.jpg); float: left; } div#leftcolumn { width: 550px; background-color: #FFF; float: left; } div#content { width: 500px; margin-left: 10px; margin-top: 10px; } div#content p { font-family: Tahoma, Arial, sans-serif; font-size: 13px; line-height: 20px; margin-bottom: 15px; } div#recentwork { width: 540px; height: 250px; background-color: #666666; margin-left: 10px; } div#rightcolumn { width: 250px; background-color: #FFF; float: left; } div#bottomwrap { width: 800px; height: 25px; background-image: url(../images/bottombgNav.jpg); float: left; } /* Begin bottom area */ div#bottomarea { width: 100%; height: 200px; background-image: url(../images/bottombg.jpg); background-repeat: repeat; float: left; } /* Text styles */ h1 { font: 100 normal 22px/normal Tahoma, Arial, sans-serif; text-transform: none; color: #999999; } .tagline { font-family: Tahoma, Arial, sans-serif; font-size: 12px; color: #999; } /* CSS Document */ Thanks for your time! The only way i can get my backgroud image to show is to explicitly state my body elements within each document. If I put them in css file and refer each page to that css file, my background image does not work, but all the other elements in that css file do. Why? JOhn Hello, I have been trying to figure this out, but have been unsuccessful. I am using a modalPopupExtender, but when the popup comes up, my background is still active. I suspect it has to be something in my css file, but would appreciate some help on this. I suspect it is the css that is causing this, but cannot figure out what. TIA! Here is the code for the MPE: <cc1:ModalPopupExtender ID="MPE1" runat="server" TargetControlID="btnShowModalPop" PopupControlID="divPop" BackgroundCssClass="modalBackground" PopupDragHandleControlID="panelDragHandle" DropShadow="true"/> Here is the code in my css file: .modalBackground { background-color:Gray; filter:alpha(opacity=70); opacity:0.7; } .modalPop { background-color:Gray; border-width:3px; border-style:solid; border-color:Black; padding:0; width:250px; color:White; } .drag { background-color:#ff0000; cursor: move; border: solid 2px white; } I found the issue by referencing a blank css file and slowly adding statements in. It was a combination of the following which prevented the backgroundcssclass to not be shown propertly: #body div div { background: url(images/body_tr.gif) top right no-repeat; } #body div div div { background: url(images/body_bl.gif) bottom left no-repeat; } #body div div div div{ background: url(images/body_br.gif) bottom right no-repeat; } #body div div div { background: url(images/body_bg.gif) bottom left no-repeat; } #body div div div div { background: url(images/body_bg.gif) bottom right no-repeat; } #body .inner div { background: none; } I ended up add these bg imgs in my master page div tags directly and is working fine.....for now :P Edit/Delete Message Hi all, I've got a jpg background image using CSS and it's not displaying in Opera, but it is in absolutely every other browser back to IE 5.0. If I change the image to a gif, it displays fine. Is there any reason why the jpg wouldn't display in Opera? Hi everyone, I have a design I am working on a design, which has a image for a background, well the image does not show, I am not sure why, it just shows white text. Anyway here is my code. Code: #logo{ background-image: url('logo.png'); background-repeat: no-repeat; } #logo .text{ letter-spacing: -0.1em; font-weight: bold; font-size: 21px; text-align: left; color: #FFFFFF; } That does not work, however, this does. Code: <img src="logo.png" alt="Logo" /> Any suggestions? Hi, I have some simple CSS for a div tag, inwhich there should be a tiling background image. Here is the CSS code: Code: #mainContent{ z-index:5; padding:0; margin: 2px; background-image: url(images/common/bodybg.gif); background-repeat:repeat-y; height:100%; } Then I have my div tag: <div id="mainContent"> which holds 2 other divs, both without backgrounds. Yet my tiling background doesn't show. Is there anything wrong with my code? I have checked the image path etc, but can't figure it out. Here is the site: http://www.caillouette.com/SouthernLiving/ thanks |