CSS - Making Body Content Dissapear Behind Image
This is what I would like to accomplish (though, vertical scrolling..)
http://www.csszengarden.com/?cssfile=037%2F037%2Ecss Must look at it with mozilla, btw.. doesn't work in IE. I can't figure out how the hell that person did that. Here is what I have so far... Forgive all the extra tags I don't need. I've been trying everything I can think of... h1{ position: absolute; top: 0px; left: 0px; z-index: 99; background-image: url(top.png); background-repeat: no-repeat; background-attachment: fixed; background-color: transparent; height: 358px; width: 800px; visibility: visible; background-position: top left;} h2{ position: fixed; top: 0px; background-image: url(sidestar.png); background-repeat: repeat-y; background-attachment: scroll; height: 6000px; width: 40px; z-index:1;} H1 is the code for the image I want to be on top, H2 is the "body" I want to disappear behind the image. When that is loaded, the image stays fixed in location, but the body scrolls on top of it, eating the image from the bottom. Any ideas what is wrong? If you have firefox, you can check out what is happening he http://www.fatboyraceworks.com/webnik/ Similar TutorialsHere is my problem. I need to make a menu and a body of a page end at the same pixel, so that they look neat and so that a footer can go underneath. Right now, I'm trying to make a div which contains the menu and the body and making the heights of both 100% so if one is longer than the other, the div should automatically be as long as the other. However, my outer div seems non-existant (0px high) for some reason, even though both the menu and the body are nested in it and have content. Anyone have a solution? Hello, I'm working on a website for a client: http://evoxdesigns.com/rimlox/ http://evoxdesigns.com/rimlox/rimlox.css My current problem is getting the body to scale to 100% height. At the moment, it stretches to 100% of the browser window, which is great, but if if the content within all the nested divs expands to a height larger than that of the screen, the background does expand with it. In my troubleshooting, I gave the body a 1px border and found out that the body remains at the fixed size of the window even though the content within it expands. I tried messing with the overflow property, all to no avail. I'd appreciate any help I can get on this one. Hi, I'm working on a website for a church and we're near completion, but I'm having trouble getting the site to display properly in IE7 on Windows XP and a few other browsers according to browsershots.org. CSS and XHTML both validate at w3c.org. I've ripped this thing apart and put it back together with no luck. The really weird thing is the Home page looks fine, but in the rest of the pages the body content gets pushed below the left and right navigation bars. Is it a CSS float problem? Margins or paddings??? Home page: Looks OK in IE7, at least on my machine - http://www.stlukeslutheran.com/index_temp.php Ministry page: Content is pushed to bottom of page - http://www.stlukeslutheran.com/mini...ns_ministry.php The CSS files are at http://www.stlukeslutheran.com/css/main.css and http://www.stlukeslutheran.com/css/common.css. Would anyone be willing to take a look? Thanks in advance. 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! Hi. I'm having a funny problem where using 100% height makes the content div scrollable, even when there's no actual content in it. I am trying to make my content div be 100% height of the window size, so I have the following css: Code: html, body { background: #FFFFFF; margin: 0px; padding: 0px; height: 100%; font-family: Trebuchet MS, Helvetica, sans-serif; } #wrapper { background: #FFFFFF; position: relative; width: 100%; height: 100%; margin: 0px auto; } #header { background-image: url("images/h-bg.png"); background-repeat: repeat-x; margin: 0px auto; padding: 0px; width: 960px; height: 107px; } #header .logo { margin-left: 10px; } #header .bg_l { float: left; } #header .bg_r { float: right; } #nav { background-image: url("images/n-bg.png"); position: relative; margin: 0px; width: 100%; height: 143px; text-align: center; } #nav a { float: left; outline-style: none; width: 240px; height: 156px; } #nav_btn_wrapper { width: 960px; margin: 0px auto; } #content { position: relative; background-image: url("images/c-bg.png"); background-repeat: repeat-y; width: 930px; height: 100%; margin: 10px auto 0px auto; padding: 10px 15px 0px 15px; font-size: 12pt; } As you can see I have height: 100% in every parent element from container up. Without the height set to 100%, the container div just cuts off, which is bad because I'm using a glowy background on it, and it just cuts off abruptly. I have used this method before on another design, but it worked only cos the wrapper and the container were both white, so when the container chopped off, the wrapper would continue, and it would look seemless. See www.landmarkmeds.com to see the problem in action. I have tried to remove the margin on the content div, but that only moved it up a bit. Also, looking at it in firebug, it reports the height as the correct value, and even shows the ruler down to the bottom of the browser window. Why then it allows me to scroll I don't know! I'm sure it's something stupid I've missed, but please help! I'm having a problem in IE6 when I make the browser window narrow so that all the images cannot fit horizontally. The page is at: URL In other browsers Firefox win/mac, Safari, things work ok if I make the browser window narrow so that some of the images in the right section (#section1) will not fit. The images get clipped and a horizontal scroller appears. But in IE6/Win, the whole table of images gets dropped down. I thought the issue was related to: Internet Explorer and the Expanding Box Problem URL But trying overflow:hidden; in #section1 did not help. Any help would be greatly appreciated. Thanks- YamaMon Hey New to the site, I thought it would be a good place to ask a question or two... I am trying to have a repeating background as well as an overlapping body image at the top. I keep failing, I can only get one or the other working. Here is the only part I know works 100% Code: <style type="text/css"> body { margin:0px; 0px; 0px; 0px; background: url(images/topbg1.png) no-repeat 50% 0%; min-height:106px; position:relative; } </style> Any help you can give I would greatly appreciate, 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 Hey guys, I'm working with firefox and just checking things out in IE to make sure nothing to major pops out. One such thing did come out and I discovered that when I highlight the text of a link the :hover background appears, it normaly doesn't otherwise...although it doesn't follow all my rules here is some code. Code: /*splash.css*/ #splash p a:hover{ background-image:url('/image/splash_hover.png'); background-repeat:no-repeat; color:#000; } /*index.html head*/ <!--[if ie 6]> <style> * html #inner_wrap { top:35%; } #splash a:hover{ background-image:url('/image/splash_hover.png'); background-repeat:no-repeat; color:#000; position:relative; top:2em;/*otherwise the same, I gota push the link down farther for IE, 6 anyway*/ } #jbc_vc{ display:none;/*because it pushes the enter link off the page*/ } </style> <![endif]--> The background image is repeated even thought it's not in firefox, and I have to highlight the text for the background image to even apear. Does anyone know what error is being triggered here? Link To Site Dear CSS Guruz If you goto this page in IE and scroll down you will notice the text "Power, Safety, Simplicity, etc" Dissapears! This does not happen in Firefox. It could be a javascript issue but Im not really sure. Anybody have any clues what could cause this? Louis 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; } 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. hello, Im running a website that uses the hover css style to change the button from a darker colored text to a lighter colored text (two different images) but when I go to the web page and hover over it it disappears, only for a second but its still annoying, and then replaces it with the new image. is there any way to get rid of this brief disappearance? 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. Im new to the forums and Im hoping someone would be able to help me and I hope Im posting in the correct forum. I recently redesigned my site with Adobe Dreamweaver utilizing CSS. Both the HTML and CSS validates. I have tried to search for my problem but havent found it already addressed. I had CSS before but my old software didnt support it as well. Im still learning a lot about the CSS so my problem might be minor, but I just dont have enough knowledge yet to know or to even begin to fix it. The site appeared fine in IE. I didnt think (stupid I know) to test it in firefox. Recently I did and noticed it did not show the top header, the right menu or did it allow you to scroll down the page. Ive read elsewhere that part of my problem may be due to having this at the top of my page Code: <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%> but if I remove that, then the site looks the same in IE as it does in Firefox. Here is a link to the index page of my site. I currently have the above line of code in the page so you can see what it is suppose to look like. Please view this in both browsers so you can see what its suppose to look like (IE) and how firefox is displaying it: http://www.herbal-connection.com/index.htm Here is a copy of my css: Code: table.sale { border-collapse: separate; background-color: white; text-align: center; vertical-align: middle; width: 30em; margin-left:auto; margin-right:auto; } img { border-style: none; } body { text-align: center; color: #FFFFFF; background-color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 95%; } .twoColFixRtHdr #container { width: 1043px; margin: 0 auto; border: thin solid #000000; text-align: justify; background-color: #FFFFFF; font-family: Georgia, "Times New Roman", Times, serif; color: #000000; } .twoColFixRtHdr #header { background-image: url(herbalconnectionlogo1.gif); HEIGHT: 82px; background-repeat: no-repeat; overflow: visible; position: fixed; } .twoColFixRtHdr #header h1 { FONT-FAMILY: Georgia, "Times New Roman", Times, serif; COLOR: #004278; font-size: 30px; background-color: transparent; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 5px; } .twoColFixRtHdr #header H2 { FONT-FAMILY: Georgia, "Times New Roman", Times, serif; COLOR: #006397; background:transparent; vertical-align: top; font-size: 20px; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 5px; } .twoColFixRtHdr #mainContent { background-color: #FFFFFF; padding-right: 20px; padding-left: 20px; position: fixed; width: 860px; font-family: Georgia, "Times New Roman", Times, serif; font-size: medium; color: #000000; } .twoColFixRtHdr #mainContent h1 { PADDING: 0em; FONT-FAMILY: Georgia, "Times New Roman", Times, serif; FONT-SIZE: x-large; text-align: center; COLOR: #004278; MARGIN: 1em; background-color: #FFFFFF; } .twoColFixRtHdr #mainContent h2 { PADDING: 0em; FONT-FAMILY: Georgia, "Times New Roman", Times, serif; FONT-SIZE: large; text-align: center; COLOR: #004278; MARGIN: .1em; background-color: #FFFFFF; } .twoColFixRtHdr #mainContent h3{ FONT-FAMILY: Georgia, "Times New Roman", Times, serif; COLOR: #004278; font-size:medium; text-align:center; background:transparent; margin-top: .5px; } .twoColFixRtHdr #mainContent h4{ FONT-FAMILY: Georgia, "Times New Roman", Times, serif; color:#B22222; font-size:medium; text-align:center; background:transparent; margin-top: .5px; } .twoColFixRtHdr #mainContent a:link { color: #B22222; font-weight:bold; background-color: #FFFFFF; } .twoColFixRtHdr #mainContent a:visited { color: #B22222; background-color: #FFFFFF; } .twoColFixRtHdr #mainContent a:hover { color: white; background: black; } .twoColFixRtHdr #mainContent a:active { color:#B22222; background-color: #FFFFFF; } .twoColFixRtHdr #sidebar1 { float: right; width: 140px; background-color: #D7DEE4; text-align: center; position: fixed; background-position: top; font-family: Georgia, "Times New Roman", Times, serif; color: #000000; } .fltrt { float: right; margin-left: 8px; width: 0px; } .fltlft { float: left; margin-right: 8px; width: 0px; } .clearfloat { clear:both; height:0; font-size: 1px; line-height: 0px; } .center { text-align: center; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; font-family: Georgia, "Times New Roman", Times, serif; font-size: medium; color: #000000; background-color: #FFFFFF; } .hrule { border-bottom-width: 0.04em; border-bottom-style: solid; border-bottom-color: #000000; padding-top: 0em; padding-bottom: 1em; } I appreciate all input anyone can give, just please dont get to high techy with me as Im still learning. This is my business site and now I see why my sales have declined since probably a lot of people cant see the site properly. Please let me know if you need any other details. Thanks, Pamela Hi ppl, I am new to CSS, and I need help... I have this code in my word-press footer.php ,what I want is to turn image that i put as footer image(footer.jpg),into image-link to other page, I tried something like this but dont work... Code: div id="footer" onclick="SOME PAGE'> <a href="<?php bloginfo('url'); ?>"> <img src="images/footer.jpg" alt="<?php bloginfo('name'); ?>" /> ...but something i do wrong, below is a original code that i want to edit! Code: ?php /** * @package WordPress * @subpackage Default_Theme */ ?> <hr /> <div id="footer" role="contentinfo" style="vertical-align:bottom;"><div style="vertical-align:bottom;"><table width="735" border="0" align="right" cellpadding="0" cellspacing="0"> <tr> <td height="190" align="left" valign="bottom"> </td> </tr> <tr> <td height="43" align="left" valign="bottom"> </td> </tr> <tr> <td><div align="right" style="margin-right:20px; color:#333333;">Copyright by <a href="<?php bloginfo('url'); ?>/"> <?php bloginfo('name'); ?> </a> 2010. - 2014. All rights reserved.</div></td> </tr> </table> </div> </div> </div> <?php /* "Just what do you think you're doing Dave?" */ ?> <?php wp_footer(); ?> </body> </html> I am trying to get the background image for #feature-stripe to be fluid. I want it to expand and contract equally with the images just above and below it. The other images are in the #banner & #main-center. I can't seem to get the #feature-stripe to do the same. Also, I am using the #main-left as a placeholder for position. I tried to eliminate it, but things to line back up like I think they should. Side note: I am using XHTML 1.0 Strict DTD. Any help or if someone could point me in the right direction I would appreciate it. CSS Code: Original - CSS Code body { margin: 0px 0px 0px 0px; padding: 0px; background: #431111; } #main-right { width: 20%; float: left; background: url('column_background2.png') repeat; overflow: hidden; padding-bottom: 5px; } #main-right p{ padding: 5px 10px 5px 10px; } #main-center { width: 60%; float: left; margin-left: auto; margin-right: auto; background: #000; padding-bottom: 0px; } #main-center #img { margin-left: 0%; } #main-left { width: 10%; float: left; /*background: #fff; */ padding-bottom: 10px; } #banner { background: #000 url('front-basket_1.png') no-repeat; height: 9.7em; width: 80%; margin-left: auto; margin-right: auto; color: gold; } #banner #right { float:right; width: 25%; height: 9.7em; background: url('column_background2.png') repeat; margin:0px 0px 10px 10px; } #banner #right p{ padding: 5px 10px 5px 10px; } #feature-stripe { background: #5B0E0E url('front-basket_2.png') no-repeat; background-position: 12.7% 0%; height: 20px; } body { Code: XHTML <div id="banner"><div id="right"></div></div> <div id="feature-stripe"></div> <div id="main-left"></div> <div id="main-center"><div id="img"><img src="front-basket_3.png" alt="" /></div></div> <div id="main-right">This is the main right</div> Edit: Currently I am getting this to work in Firefox. I will worry about the others later. Therefore, I may be back with more questions later. This may be a stupid question, but is there an easy way to make a div have an image on the left and content on the right... BUT then also make sure that, if the image's height is larger than the div, the div still covers the bottom. I know you can use a "float killer" div, however if I want a float killer on EVERY div class of this type, is there some easy way to tell the css to ALWAYS include code at the bottom? Also what method would a good coder use to vertically align the content on the right so that there isn't a lot of empty space? Thanks |