CSS - Css Trouble - Extending Background Color To Bottom Of Div, Etc.
I'm in the midst of redeveloping my site's look and feel using CSS. I'm having a moderate amount of luck so far, but I've run into a problem.
I'm testing using Firefox 1.0 PR, but I've seen this behaviors in other Mozilla-based browsers. Example 1: URL. As you will probably see, the white background only extends to the bottom of the one DIV. The only way I was able to get the white background to extend to the bottom of the two DIVs was to use an image in one of the container DIVs. Example 2: URL. Of course, then the problem is still that it doesn't extend all the way to the bottom of the browser unless it's filled entirely with content. The effect I'm looking for is something like this: URL. My CSS is here URL. First, if anyone can help me figure out how to get the background to extend evenly, without an image, that would be great. If there's a way to make the page always extend to the bottom of the browser, I'd love to hear about that, too. Thanks in advance for any help you can offer. Similar TutorialsI'm trying to do alternating colors in a table using CSS and I'm having some trouble. My header row works fine, but the normal rows don't pick up the color change. here is my CSS: Code: table.metadata-table { empty-cells:show; border-width:1px; border-spacing:0px; border-style:solid; border-color:#A1A1A1; border-collapse:separate; } table.data-table td, th { text-align:center; border-width:1px; padding:3px; border-style:solid; border-color:#A1A1A1; } tr.data-header td, th{ background-color:#788A51; color:#FFFFFF; font-size:9pt; } tr.data-row1 td { background-color:#FBF8E0; font-size:8pt; } tr.data-row2 td { background-color:DBD594; font-size:8pt; } I've also tried dropping the preceding element type(ie: .metadata-row1 instead of tr.metadata-row1) and using id's instead of classes(tr#metadata-row1) with no success. Here is the html application: html Code: Original - html Code <table class="data-table"> <tr class="data-header"> <th>Header 1</th> <th>Header 2</th> <th>Header 3</th> <th>Header 4</th> </tr> <tr class="data-row1"> <td>cell 1-1</td> <td>cell 1-2</td> <td>cell 1-3</td> <td>cell 1-4</td> </tr> <tr class="data-row2"> <td>cell 2-1</td> <td>cell 2-2</td> <td>cell 2-3</td> <td>cell 2-4</td> </tr> <tr class="data-row1"> <td>cell 3-1</td> <td>cell 3-2</td> <td>cell 3-3</td> <td>cell 3-4</td> </tr> </table> <table class="data-table"> <tr class="data-header"> <th>Header 1</th> <th>Header 2</th> <th>Header 3</th> <th>Header 4</th> </tr> <tr class="data-row1"> <td>cell 1-1</td> <td>cell 1-2</td> <td>cell 1-3</td> <td>cell 1-4</td> </tr> <tr class="data-row2"> <td>cell 2-1</td> <td>cell 2-2</td> <td>cell 2-3</td> <td>cell 2-4</td> </tr> <tr class="data-row1"> <td>cell 3-1</td> <td>cell 3-2</td> <td>cell 3-3</td> <td>cell 3-4</td> </tr> </table> The table rows pick up the right font-size attributes, and the data-header row works right and all the cells pick up the right border attributes, but the regular rows aren't showing the background-color. Any ideas? Much thanks It's hard for me to explain this so bear with me. This is the page in question. The right side is my float. If it is longer than the left side, then it continues, but the white background does not. I've tried doing height: 100% and so forth and can't get it to stretch. I've tried reversing the float assigning it to the left side and it appears fine in Net/Moz, but IE won't run it right. I don't really want to use float but I can't find another way to do it. I'm redoing the site from tables to CSS to make it cleaner. Floating has always been a problem but I've found ways to deal with it. Now, I'm realizing how finicky it is on different browsers. Any suggestions or alternatives to float? The heights of both sides may change at any point so I don't really want to use any position elements. Will I have to? Thanks in advance. Tim The problem that I am having stems from attempted compatability for 1. IE/other browsers, and 2. Not scrolling or having an absurd amount of dead space on different resolutions. Given that I'm currently using a 16:9 laptop, anything that I make for my resolution is very likely to scroll vertically on anything else. I would like to preface this by saying that, while I am a young person and am .. relatively web savvy, I'm also pretty miserable at CSS. I'll pick it up whenever I need to use it, but these times generally end up being a year plus apart, and so I generally .. forget everything that I picked up the last time, and have to re-learn. I am very good at nesting tables, and using an absurd number of them to get things to look how I want, but .. I really want to get away from that. CSS is cleaner and less .. well, less flat out dumb than using seven tables in one page to align things the way you want them? The Actual Problem I Have: (Do ignore the hideously coloured background, the green/blue combo is temporary until I get the code working properly. Anyway, so apparently I can't post URLs so: clocktock.com is the website in question, code on it is Code: <html> <head> <link rel="stylesheet" type="text/css" href="poing.css"> <link rel="icon" type="image/png" href="img/RL16.png"/> <title>[ eroding.net ]</title></head> <body> <table cellspacing="0" cellpadding="0" class="main" height="100%" width="100%" valign="bottom"><tr><td width=100% align=center valign="bottom"> <table border="0" cellspacing="0" cellpadding="0" height="90%"> <tr><td background="img/top_left.png" width=14 height=39></td> <td background="img/top.png" width=622 height=39><img src="img/top_left2.png" border=0></td> <td background="img/top_right.png" width=14 height=39></tr></td> <tr><td background="img/left.png" width=14 height=1></td> <td bgcolor="black" width="700" height="800" border=0 cellspacing=0 cellpadding=0 background="img/table_bg_grunge.png" valign="top"> <br><br> <center> aaa <br><br> </center> </td><td background="img/right.png" width=14></tr></td></table> </tr></td></table> </body></html> CSS Code: body { font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; font-family: Tahoma, Arial; background-color: #0F0F0F; color: #424242; background: url(img/damask.png); background-attachment: fixed; background-repeat: repeat; margin-bottom: 0px; vertical-align: bottom;} table { color: #424242; font: 11px Tahoma, Arial; margin: 0px; } sm {font-size: 0.9em; } a:link { color: #424242; } a:visited { color: #595959; } a:hover { color: #424242; text-decoration:none; } a:active { color: #424242; } What I would, ideally, like to have is for the box to take a percentage of space. Say, vertically 80 or 90%, and then a blank remainder on the top. Horizontally, say, 10 or 15% on either side and then 70 or 80% for the "box." But, google as I might, I just can't find the right CSS commands to do it. It just gets funny looking and shrinks all my border images (Though I erased the code that caused that). Is it possible to use 2 backgrounds with CSS? E.g. I want one background which is going to be used for the top of my website layout and one background for the bottom. This would allow me to extend the content of the website, without "distorting" the background. I used tables in the pas and this was very easy to do, however I don't know how to do this with CSS. I don't even know if this is possible. Also this brings me to the next CSS related problem; with HTML tables it was possible to extend the tables when e.g. a lot of content was added. Is this also possible with CSS? E.g. you would set the td height to 100% and the text (and the rest of the design) would expand without problems... I hope my post makes any sense. It's kinda hard to explain what I mean. IE is adding 8-10px of padding to the bottom of a div that I am placing a background-image in. It renders fine in ff, but because I am trying to match 3 parts of an image up to make one whole (I have reduced margin and padding to 0 on all 3 divs) there is this white gap between the divs?! Any ideas? Hi all. This is my first time posting ever so please be gentle. On my website I have background image with stripes and grey. I want it to go all the way down the bottom of the page. Currently the background image stops where the content ends. I have tried height:100%; and that solves the problem, but creates another if the user has a smaller browser window. Can someone please help me out? Page URL: leannemarie.com/testing_index.php CSS: leannemarie.com/css/testing_main.css Thanks LeAnne Hi, I have made a page using <div> tags. <div id="page"> <div id="leftmenu"> </div> <div id="mainarea"> </div> </div> My problem is that sometimes, the leftmenu is longer than the main area(1) and sometimes its the opposite- the main area is longer than the leftmenu(2). I want them both to be of the same height. (3) How can I do this? Plz Help! I have pasted the style codes for the 3 tags below. (1) (2) (3) #mainarea { background-color:#FFFFFF; float:left; position:relative; right:0pt; width:630px; } #leftmenu { background-color:#EEEEEE; float:left; left:0pt; position:relative; width:140px; } #page { background-color:#FFFFFF; position:relative; width:770px; } Hi there people, I have a question about CSS but before I start off asking this question I'll introduce myself. I'm a new user of this great forum, my name is Dwight and I'm a student on the "Graphical Lyceum Amsterdam" where I follow the education for "Multimedia Designer". Ok so now you know me a little, I'll start off asking my question. Question: I have to change the layout for a html page that askes for information from different asp pages, but that's not my problem . The problem is that I have to make some td's a different color -the background that is- but the problem is that I can't change the html page itself (it is automaticly generated and I don't have permission to change it). So my question is can someone tell me how I can change the color of some (not all!) td's with CSS without making classes? Tnx, Dwight Having an issue with the background color in a div. The color shows up in I.E. but not in Firefox. I have a div with a width of 100%. Inside the div is an unordered list with two list items. Here is the css: div#nav { width: 100%; margin: 0; background-color: #EAE9E4; } #nav ul {margin: 0; padding: 0; } #nav li { list-style: none; float: left; margin: 0; padding: 0; width: 15%; font-size: 11px; line-height: 20px; white-space: nowrap; } Essentially this will be a navigation aid below the banner of the webpage. The list items will contain anchors which will appear as "buttons". The containing div extends to the end and I want it to have a background color. Any help appreciated. Hi, I am trying to apply a background color to an item other than the body but I cannot make it display in IE 6 or 5.5. I have tried applying it to both <div>'s and <p>'s. Does IE not support the background-color property outside of the page background? i wanted usersto choose their own style sheet by giving them different links like red, green, blue which will take them to different layouts or background color page. the problem was that worked only for that particular page but if they click on any link or menu from that page it will take them back to the default color. is there any way that i can set so that their choice will stay throught their surfing ? any thoughts ? hanks Hey Guys! I'm going absolutely bonkers trying to find out how to change the color of the background of a certain element on my site. I installed Vanilla forums on my site and am trying to customize the css script. If you look at the page, you will see an annoying white in the body. I am trying to make the background of that #F6F6F2. Could you guys possibly put me in the right direction? Thanks! Here is a link to my page: shipswatchdotcom/forum/vanilla/aaa.html Here is the css script: Code: #Body { margin: 0; width: 99.9%; position: relative; background: #F6F6F2; } #Head { background: #B8D4B8; padding:0; margin: 20px 20px 0; text-align: left; position: relative; } div.Popup h1, div.Popup h2, div.Connect h1, div.Connect h2 { background: #F6F6F2; border-bottom: 1px solid #3b5998; } .Banner { padding: 10px; text-align: left; position: relative; background: #F6F6F2; } .Banner ul { background: #B8D4B8; padding: 0; margin: 0; } .Banner ul li { display: inline; padding: 0; margin: 0; } .Banner ul li a { font-weight: bold; padding: 3px 6px; font-size: 11px; color: #336633; display: inline-block; } .Banner ul li a:hover { background: #E5F0E5; } .Banner ul li a.SignOut { font-weight: normal; position: absolute; top: 10px; right: 10px; } .Banner ul li a span { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; padding: 1px 2px 0 1px; background: #F6F6F2; border-right: 1px solid #F6F6F2; border-bottom: 1px solid #F6F6F2; color: #F6F6F2; font-size: 9px; position: relative; top: -3px; } #Content { float: none; width: auto; margin: 0 280px 0 10px; background: #F6F6F2; } #Panel { float: right; margin-right: 10px; background: #F6F6F2; } #Panel div.SearchBox input.InputBox { width: 200px; margin-right: 4px; background: #F6F6F2; } div.SearchBox { margin-bottom: 6px; } body.Profile div.SearchBox { display: none; } body.Profile #Content { float:none; width: auto; margin: 0 10px 0 280px; background: #F6F6F2; } body.Profile #Panel { margin: 0 0 0 10px; background: #F6F6F2; } form.Activity textarea { width:99%; background: #F6F6F2; } #Foot div { width: auto; background: #F6F6F2; } body.Post #Content { width: auto; margin:0 20px; background: #F6F6F2; } #ConversationForm textarea.MultiComplete, #ConversationForm .TextBox, #MessageForm textarea, div.Comment div.CommentForm, div.Comment div.CommentForm textarea, div.CommentForm textarea, #DiscussionForm input.InputBox, #DiscussionForm textarea { width:99%; background: #F6F6F2; } #ConversationForm form { border: none; } div.Preview div.Message, ul.MessageList div.Message { clear: none; } #DiscussionForm form { background: #F6F6F2; border: 1px solid #ccc; } div.MessageForm, div.Tabs { background: #F6F6F2; border-bottom:1px solid #ccc; } /* Tabs */ div.Tabs { background: #F6F6F2; padding: 0; border-bottom: 1px solid #aaa; } div.Tabs ul { padding: 0 8px; white-space: nowrap; } div.MessageForm { padding: 8px 8px 5px; } div.MessageForm div.Tabs { padding: 0 8px; } div.Tabs li a, div.Tabs li a:link, div.Tabs li a:hover, div.Tabs li a:active, div.Tabs li a:visited { font-size: 11px; margin: 0; border: none; border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; background: #F6F6F2; color: #336633; text-decoration: none; padding: 8px 10px; line-height: 11px; } div.Tabs li a:hover { text-decoration: underline; } a.Active, div.Tabs li.Active a { background: #F6F6F2; color: #336633; margin: 0; border: 1px solid #aaa; border-bottom: none; border-radius: 3px 3px 0 0; -moz-border-radius: 3px 3px 0 0; -webkit-border-radius: 3px 3px 0 0; display: inline-block; font-size: 12px; line-height: 12px; font-weight: bold; text-decoration: none; padding: 6px 10px; position: relative; top: 1px; } div.Tabs li a span { line-height: 1; font-size: 80%; padding: 0 3px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; font-weight: normal; background: #F6F6F2; color: #4A7023; margin: 0 0 0 4px; } div.DiscussionsTabs div.SubTab { font-size: 11px; border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; border-top: 1px solid #aaa; background: #F6F6F2; margin:0; padding:4px 8px; } div.HeadingTabs ul { margin: 8px 0 0; } body.Discussion a.Bookmark { margin: 6px 2px; } div.Preview { border: 1px solid #aaa; background: #F6F6F2; margin:0 0 8px; padding: 8px; } .Foot { background: #F6F6F2; border: none; } div.MorePager a, div.MorePager a:link, div.MorePager a:visited, div.MorePager a:active, div.MorePager a:hover { border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; background: #F6F6F2; border: none; color: #4A7023; line-height: 1; padding: 0; text-decoration: none; } div.MorePager a:hover { color: #4A7023; text-decoration: underline; } body.add #Content { margin: 0 10px; background: #F6F6F2; } /* Panel Boxes */ #Panel div.Box { border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; background: #F6F6F2; padding: 0; } div.Box h4 { color: #4A7023; } ul.PanelActivity, ul.PanelInfo { border-top:1px solid #ccc; } ul.PanelActivity li, ul.PanelInfo li, ul.PanelInfo li.Active { background: #F6F6F2; border-bottom: 1px solid #ccc; } ul.PanelInfo li.Active { background: #F6F6F2; } #Status { border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; background: #eee; color: #000; line-height: 1.6; padding: 3px 6px; margin: 0 0 8px; } body.Profile ul.PanelInfo { border: #F6F6F2; } body.Profile ul.PanelInfo li { margin: 0; padding: 0; } body.Profile ul.PanelInfo li a { font-size: 12px; display: block; padding: 0 6px; background: #F6F6F2; } body.Profile ul.PanelInfo li a:hover { background: #F6F6F2; } /* Sign In Page */ body.Entry #Content { text-align: center; margin: 0 auto !important; } body.Entry #Content div.Box { background: #F6F6F2; border: 0; } div.Methods { border-left: 1px solid #ccc; } /* Messages */ div.DismissMessage { background: #F6F6F2; border: 1px solid #ccc; padding:6px 8px; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } div.DismissMessage a.Dismiss:hover { color: #000; } div.Warning { background: #d00; border: 1px solid #b00; color: #F6F6F2; text-shadow: 1px 1px 1px #444; } div.Warning a.Dismiss { color: #F6F6F2; } #Content div.Box { color: #000; background: #F6F6F2; border: 1px solid #F6F6F2; } body#dashboard_entrycontroller_signin div.Box { border: none; } /* Autocomplete */ .ac_results { border: 1px solid #d7d8da; color: #000; border-top: 0; background-color: #F6F6F2; } .ac_results li { border-bottom: 1px solid #d7d8da; } .ac_lastitem { border-bottom: 0 !important; } .ac_results strong { background: #F6F6F2; } .ac_over strong { background: #F6F6F2; } .ac_over { background: #3b5998; color: #fff; } I am trying to use background-image to emulate using a background="" in a cell. I am getting the image to show up using background-image: url(url); but it repeats. when i add background-image: url(url) no-repeat; the image doesn't show up, even once. What am I doing wrong? Can someone please tell me why the background2.jpg is not repeating vertically on this page in Firefox? This is the page: http://tinyurl.com/57sqrq And the CSS reference to it: Code: #content { padding: 0px; margin: auto; width: 1024px; min-height: 630px; background: url(images/background2.jpg) top center; } Thank you. What is wrong with this? I can't seem to see any of the background colors in Firefox or Camino? I have tried setting the background color in the body, and by enlosing the rest of the elements within a containing "main" div... but neither seem to work. Any ideas? What is wrong with this? I can't seem to see any of the background colors in Firefox or Camino? I have tried setting the background color in the body, and by enlosing the rest of the elements within a containing "main" div... but neither seem to work. Any ideas? http://buffalonationsmuseum.ca Right now the property is just "background" but I have tried... background-color: I'm using Wordpress 3.0.4 with the WP Remix theme 3.0 for my website. URL: joelwyant.com I want to be able to add a page to the site during the Christmas season. To make it standout more, I'd like that specific page to always have a different background color in the navbar than the other "normal" pages. I have the CSS for the navbar style, but I don't know where to begin to make it specific to just that one page. In other words, how do I create CSS that overides the normal navbar background color for just that one specific page? Any thoughts, suggestions, or guidance is much appreciated! Joel On the main page of my site, I have a "slogan box" with a width set to 40%. This is outlined and has a background color. In IE, it outlines and colors in the blank space up to 40%, the desired effect. But in Firefox and Mozilla, it outlines only up to where the text stops. Here's the main css behind it: #slogan { border-bottom:2px solid black; border-right:2px solid black; border-left:2px solid black; background-color:#ABAABB; font-family:comic sans ms; width:40%; } Attactched is the screenshot from IE and firefox. How can I make it look like it does in IE for all browsers (i.e., what is the correct code?) The full code can be seen here. Here is my code: Code: body { background-color: yellow; margin-left: 20%; margin-right: 20%; border: 1px dotted gray; padding: 10px 10px 10px 10px; font-family: sans-serif; } None of the attributes such as background color, margins, border, padding are showing up when I test it out. Can someone help me? Hello, I can't seem to figure out how to get the body of this page to be white... you can see the page at: www.brandontutmarc.com/vlr and the attached CSS is at: www.brandontutmarc.com/vlr/viva.css Here is what I'd like it to look like: http://www.brandontutmarc.com/vlr/vlr1.jpg Any help is GREATLY appreciated... |