CSS - Simple Div Layout Problem
Quote:
I just started working with CSS again, and I'm having problems coding my layout. The problem is he I'm testing on Firefox. div#wrapper is the problem. EDIT well, after playing with it some more, I have found out that this has no pattern to it at all, its pretty much just producing random results, so infinitely STUPID!!! Seriously. This is something that is so simple, and yet these idiots who come up with this crap make it so difficult. If you want to pad left and right, it shouldn't be this goddamn difficult. Sorry, I'm VERY pissed now, after working on something so basic for so long. I can only get a padding on the right for so far, and then it skips over to completely aligning to the right, while the left is so much farther over, even if it has smaller padding... what the hell. Heres the full code: index.html Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head> <title>Elemental Concepts</title> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body> <div id="wrapper"> <div id="upperwrapper"> <div id="banner"></div> <div id="memberswrapper"> <div id="members"> </div> <div id="membersfooter"></div> </div> </div> </div> </body> style.css Code: body { text-align: center; margin: 0px 0px 0px 0px; background-color: #E8E8E8; } div#wrapper { width: 700px; margin: 0 auto; padding: 0px 50px 0px 25px; text-align: left; background-image: url('mainbg.jpg'); height: 100%; } div#upperwrapper { width: 741px; margin: 0; height: 105px; } div#banner { float: left; width: 471px; height: 105px; background-image: url('banner.jpg'); } div#memberswrapper { float: right; width: 249px; height: 105px; } div#members { width: 249px; height: 98px; background-image: url('membersbg.jpg'); } div#membersfooter { width: 249px; height: 7px; background-image: url('membersfooter.jpg'); } div#wrapper, is the main div, which has a background. I need the insides spaced about 15 px from the left, and 15 px from the right. But for whatever reason, it usually ends up spacing 25 px from the left, and 5 from the right, the more I play with the numbers though, to get the results I want, the more obscure it becomes... it just WILL NOT do what I want, and WILL NOT follow any logical pattern with how it display. Help is really appreciated. I am completely and utterly lost... EDIT 2: Still working on it, and no progress, except the background image keeps disappearing every time I even think about touching the background attribute! I'm about to say **** it, and use tables. This is ridiculous. I just opened up IE6, and it looked even more obscure than it does in Firefox. This makes no sense. I just read a few tutorials on div padding, doesn't mention anything about this. Maybe its the floats causing the problem... but I don't see why elements on the inside could stretch the containing element, if it has fixed size and padding, and that still doesn't explain the IE6 problem's, which I'm not even going to get into now... since I have probably confused you enough already. I seriously think I could write an entire HTML/ CSS parsing engine, in any language, in less time than it would take me to code this layout properly in HTML/ CSS. Ridiculous. Well, I got the top working in Firefox, instead of floating left and right, the banner and memberswrapper, I floated one left, and the other had a left-margin. Though, I am almost 100% sure, the text, and other divs below are not going to align properly, with the edges of the above [banner and memberswrapper]. I am also afraid to see what this looks like in IE6. style.css Code: body { text-align: center; margin: 0px 0px 0px 0px; background-color: #E8E8E8; } div { margin: 0; padding: 0; } div#wrapper { width: 725px; margin: 0 auto; padding: 0 25px 0 25px; text-align: left; background: url('mainbg.jpg'); } div#upperwrapper { width: 741px; margin: 0; height: 105px; } div#banner { float: left; width: 471px; height: 105px; background: url('banner.jpg'); } div#memberswrapper { margin-left: 477px; width: 249px; height: 105px; } div#members { width: 249px; height: 98px; background: url('membersbg.jpg'); } div#membersfooter { width: 249px; height: 7px; background-image: url('membersfooter.jpg'); } Edit Again: Looks just as bad as it did before, in IE6. The background image repeats horizontally, which it should have absolutely no reason to do so, the width is 50 pixels less than the images width, and the padding on the left and the right, are each 25 pixels, accounting for the full image size... and yet the full image and then some is displayed. If screen shots would help, I can take some. Or if you want to see what an impossible layout to code looks like, I can send you a zip of everything. Theres 2 options left, tables or absolute positioning. Similar TutorialsHi really nw to using css just starting out today lol. So i was wondering how i can get the two divs mod1 and mod2 to sit side by side and expand the advBar div height when more and more content gets added to both divs, rather than me specifying a height and floating the two divs inside the advbar div ? any ideas would be great. unless ive lost yas. Code: <body> <div id="level0"> <div id="level1"> <div id="topBar">This is the top navigation bar.</div> <div id="advBar"> <div id="mod1">2323 frwef sdf</div> <div id="mod2">s dfs dfsd fsd fsd f</div> </div> </div> </div> </body> Code: body { margin:0px 0px 0 0px; padding:0; background:#FFF; } #level0 { background:#FC0; } #level1 { padding-left:9px; padding-right:9px; margin-left:300px; margin-right:300px; background:#FFF; } #main { background:#CCC; } #topBar { padding: 10px; background:#FC0; } #advBar { padding: 10px; height: 90px; background:#FFF3AC; } #mod1 { border: 1px solid red; float: left; padding: 10px; background:#FFF3AC; width: 45%; } #mod2 { border: 1px solid red; float: right; padding: 10px; background:#FFF3AC; width: 45%; } Hi, I'm trying to constuct what, in real terms, is a simplistic page layout using CSS-P. Maybe I'm being stupid - but here goes... I am trying to constuct a page as follows: header (viewport width) leftMenu (width 150px) content (as wide as necessary) - top aligned with top of leftMenu footer (viewport width) - underneath the "tallest" of "Left Menu" and "Content" Easy huh? But, as soon as any content is greater than [viewportWidth - 150] (150=width of leftMenu), the content (depending, of course, on the CSS implementation) either slips below the leftMenu, disappears altogether(?), or has the footer right underneath the header with everything else below. I could do this with a simple table construct in under a minute. So please - CSS gurus, can you advise me how to achieve this in CSS, as it seems impossible (10 hours+)? I thought CSS was supposed to make design easy; If I'm not missing something and CSS can't achieve this (common) basic layout - what hope is there? All comments truly appreciated, HEX. Need a bit of CSS guidance I would like somefeed back on what is a good way to structure a page template using CSS I would like the page content to be displayed 780 px width, Centered Header image at top 780 px wide Horzontal Nav below 780 px wide also 2 columns of content below footer at bottom Im sure this is a common layout as I have seen it on many sites. Im just not sure what the optimal way to set it up using divs. SEO being my primary concern Here is the layout: Code: <body> <div id="main"> <div id="header"> headet stuff here </div> <div id="nav"> the nav </div> <div class="content"> <div id="left_content"> left content </div> </cfif> <div id="right_content"> right </div> </div> <div id="footer"> footer </div> </div> </body> STYLE SHEET: Code: #main{ position: relative; margin-left: auto; margin-right: auto; width: 780px; } #header { position: relative; width: 780px; height: 100px; margin: 0; padding: 0; background-color:#8787d5; } #nav { position: relative; width: 780px; margin: 0; padding: 0; border-top: 1px solid #ffffff; background-color:#8787d5; background-image:url(../images/nav_bg.png); } .content { position: relative; top: 0px; left: 0px; border-left: 1px solid #8787d5; border-right: 1px solid #8787d5; border-top: 1px solid #8787d5; border-bottom: 1px solid #8787d5; margin: 0px 0px 0px 0px; background-color:#e9e9f5; } #left_content { position: relative; border-left: 1px solid #8787d5; border-right: 1px solid #8787d5; border-top: 1px solid #8787d5; border-bottom: 1px solid #8787d5; margin: 0px 0px 0px 0px; left: 5px; top: 5px; width: 325px; padding: 0; } #right_content { position: relative; border-left: 1px solid #8787d5; border-right: 1px solid #8787d5; border-top: 1px solid #8787d5; border-bottom: 1px solid #8787d5; top: 5px; left:335px; width: 440px; padding: 0; } #footer { position: relative; padding: 20px 10px 10px 10px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; color: #993300; text-align: center; } THe problem I am having is when I use relative position for left-content and right_content the right content is positioned to right of but at the bottom of the left_contetn div. I can get them to line up correctly using absolute positioning but then the content div that contains them and that also has the border and backgrond color does not expand vertically to to contain the left_content and right_content divs. any help is greatly appreciated thankya Okay I am trying my best to let go of HTML tables and move to the wonderful world of using CSS for layout. I continue to find that, although it may be an archaic way of doing things, most of the time using tables for layout is the quickest and most accurate way for me to get the job done. Please don't hate, because I want to become more knowledgeable at using CSS! So in my latest project I have a problem. I have a navigation bar that stretches always accross my page. In that navigation bar I have two primary things: on the left I have a menu section, and on the right I have a login section. In the past I would have easily implemented the layout with tables, using something like this... <table cellspacing="0" cellpadding="0" style="width:100%;"> <tr style="background-color: black;"> <td align="left">[stuff for my menu section]</td> <td align="right">[stuff for my login section]</td> </tr> </table> The end result would be a solid black navigation bar that would contain the stuff for the menu section on the left and the stuff for the login section on the right. Each would sit inside and flush against its respective side of the containing solid black navigation bar. Also, this navigation bar would automatically adjust its height to contain both sections, no matter how tall. Pretty simple stuff, right? So now I am trying my best to figure out how to do this with CSS. At this point I have only a very crude understanding of how CSS and divs work in layouts. I started out by making a container div... <div id="NavigationBar" style="background-color:black;"> </div> ...then I embedded a div for each section... <div id="NavigationBar" style="background-color:black;"> <div id="MenuSection"> [stuff for menu section] </div> <div id="LoginSection"> [stuff for login section] </div> </div> ...When I ran the page I quickly noticed the output was quite different than what I expected. It showed my black navigation bar, but it stacked the login section along the left side and just under the menu section. So after some reading I discovered I should be able to solve the problem by assigning 'float:left' to the menu section div and 'float:right' to the login section div. And so I did. While this did cause each to appear in the correct location (menu section on the left, login section on the right), it also had an undesirable effect. Each section, after attachment of the 'float' styles, was no longer contained in the parent div. As a result each no longer contained the background color of the parent. And so now, while I have a partial solution, I am still left wondering what I should do to continue on and solve this issue. What I really need is for each section to be *contained* within the parent div and also use its background color, while also aligning properly to the left or right sides of the parent div. In other words, I want the black background color of the navigation bar to be shown behind my menu and login sections. And if my menu should render at 40 pixels high, 300 pixels high...whatever, the containing parent div should adjust to contain it, just like an HTML table would. For me, setting 'height' values for the parent div (essentialy in the background) and then using 'float' styles is not a good solution. What if the menu is rendered using a different font and thus changes heights? And even more important, what if a user does not view the page in standard 96DPI mode? In either case the rendered heights of the menu and login sections could change. If I were using tables this would not be a problem; the table would simply adjust to the needed height, no matter what. How can I get the same effect when using CSS and divs? I am working on this website : http://five-art.com and the code for the nav bar is : Code: <div class="content"> <table><tr><td><h1>[5]Art</h1></td><td class="navtop"> :: <a href="index.php">Call for Submissions</a> :: <a href="ms.php">Mission Statement</a> :: <a href="past.php">Event Archive</a> :: <a href="members.php">Members</a> :: <a href="contact.php">Contact Us</a>.</td></tr></table> </div> I added the table so that I could have two different font sizes without the text going to the next line. What would be the best way to do this with css. Thanks! Hi. I'm making a registration and login pages with some additional information, and I'm wondering how to make them tableless? What I'd do with tables is put table in a table, because I want to do something like this: A 640px (or any other value) width box in the center of the screen, in which there is another box under some text, which is borderless login box. Same would go for the registration box. And without tables - I have no idea how to do it. Not sure if this is the right section, sorry if it isn't. Thanks. I've been working in CSS, man, is it tiresome for a beginner! After much trail and error, I've come up with my first CSS page. Where I'm stuck, is in the area where all the text is. When I put more text into that page, none of the surrounding styles/boxes[?] adjust to the text format (also shown in a link below), and I can't seem to figure out how to center the entire page itself. Sorry, for the stupid questions, I'm a total novice, and can barely understand most of the CSS postings in this forum. Text extending instead of expanding layout: http://rafia.info/css/layers.bad.htm Thanks sincerely, rups27 hey all, i am new to using CSS. (Yes i am very much behind the times). But i am trying to rectify that! Now the problem i am having is that i have a flash object that i simply want to align centered horizontally and it stays centered no matter what. but i would also like to position it y = 100 (x and y positioning) any ideas! Hi all, This is my first post here so go easy on me. Firstly, please look at this: h ttp://digitalformula.net/temp/layout.jpg - I can't post a proper URL since I'm a new user ... sorry for the space at the start of the address. Anyway, the top part is what I have now and the bottom part is what I'm trying to get to. Can someone please assist with the CSS for this? I know just enough CSS to be dangerous but I can't seem to find the right way to put the captions under the images without the image on the right dropping below the image and caption on the left. I've tried all different types of float etc but nothing seems to work - I know it's something I'm doing wrong as this is probably one of the more basic questions posted here. ANY help would be much appreciated! Thanks, digitalformula IE 7 has caused a problem with the layout on our website. The website worked fine with IE 6. http://www.membersequity.com/mcard/ Can anyone help determine what the problem is? Thanks. Hi I'm trying to layout some information on a page that would previously have been designed using a table structu Code: <table> <tr> <td>Item 1 <br /> Item 2 <br /> Item 3</td> </tr> <tr> <td>Item 1 <br /> Item 2 <br /> Item 3</td> </tr> </table> But now have tried to redesign the layout using the following CSS: Code: #boxProdDisplay { width:500px; padding:0; margin:0; } #boxProdDisplay p { width:228px; border:1px solid #CCCCCC; color:#333333; background-color:#F5F5F5; padding:5px 5px; } #boxProdDisplay p.p1 { float:left; clear:left; width:228px; border:1px solid #CCCCCC; color:#333333; background-color:#F5F5F5; padding:5px 5px; } #boxProdDisplay p.p2 { float:left; clear:left; width:228px; border:1px solid #CCCCCC; color:#333333; background-color:#F5F5F5; padding:5px 5px; } #boxProdDisplay p.p3 { float:right; clear:right; width:228px; border:1px solid #CCCCCC; color:#333333; background-color:#F5F5F5; padding:5px 5px; } #boxProdDisplay p.p4 { float:right; clear:right; width:228px; border:1px solid #CCCCCC; color:#333333; background-color:#F5F5F5; padding:5px 5px; } The problem is that it doesn't quite display correctly. The <P> elements are floated correctly, but they only appear after the last <P> tag which has been aligned left. With a table structure I could use valign to send everything to the top of the page. What can I do here? Many Thanks. Hi. I have a "small" problem. I am using NiftyCorners (http://www.html.it/articoli/nifty/index.html) and whenever the corner is added to a nav bar at the top of my page, the link in the nav moves down a bit, making it lower than the rest. I have tried playing with padding, margin, etc but can't seem to get the link position to stay put. I am trying to get my nav bar to work like the one in the below link: http://boardreader.com/pop/films/-/-/90.html?o=90 I am guessing it has to do with the fact that the containing div is blocking it? Any ideas how to prevent the shift in the link position? Code below and Image of problem attached.... Thanks! Code: <table style="width: 100%; height: 100px; padding: 10px;" cellspacing="0"> <tr style="width: 100%;"> <td style="width: 100%"> <script type="text/javascript"></script> <form name="searchform" action="/search.aspx" style="margin: 0pt; display: inline;"> <input name="a" value="f" type="hidden"> <input name="z" value="1" type="hidden"> <div id="logo" style="float:left; top:0px;"> <div> <a href="http://www.x.com" tabindex="-1" class="logoimg"><img src="http://pics.x.com/aw/pics/logos/logo_x45.gif" alt="X" border="0" height="45" width="110" /></a> </div> </div> <div id="mastermenu" style="top:16px; left:128px; border-bottom:solid 1px black; right:15px; position:absolute"> <div> <span><script type="text/javascript">//WRITE LOGIC FOR SIGNIN OR REGISTER HERE</script>Hello! <a href="http://www.x.com/singin/signin.aspx">Sign In</a> or <a href="http://www.x.com/registration/register.aspx">Register</a>.</span></div> <ul id="mastertabslist" style="padding-top:9px;"> <li><a href="../today/today.aspx"><span>Home</span></a></li> <li><a href="../looking/looking.aspx"><span>Community</span></a></li> <li><a href="../search/search.aspx"><span>Search Tools</span></a></li> <li class="help"><a href="#nogo"><span>Help</span></a></li> </ul> </div> <script type="text/javascript"> [SNIP...] </script> <div id="search_main" style="float:right; height: 95px; width:350px; border:solid 1px red; padding-top:5px;"> <div style="float:left; width:50px; height:20px; vertical-align:bottom; margin: 0 5%;">Search in:</div> <div id="div_videos" style="float:left; width:50px; height:20px; padding-left:10px;"><a href="#nogo" id="search_videos" class="" style="cursor:pointer;" onclick="switch_search_videos(this.id);"><span>Videos</span></a></div> <div id="div_images" style="float:left; width:50px; height:20px; background-color:#6699CC;" class="is_menu"><span style="padding-bottom:5px; vertical-align:top; margin-bottom:5px;"><a href="#nogo" class="l_link" id="search_images" style="cursor:pointer;" onclick="switch_search_images(this.id);">Images</a></span></div> <div id="div_profiles" style="float:left; width:50px; height:20px; padding-left:5px;" class="is_menu"><a href="#nogo" class="l_link" id="search_profiles" style="cursor:pointer;" onclick="switch_search_profiles(this.id);"><span>Profiles</span></a></div> <div id="div_forums" style="float:left; width:50px; height:20px; padding-left:5px;" class="is_menu"><a href="#nogo" class="l_link" id="search_forums" style="cursor:pointer;" onclick="switch_search_forums(this.id);"><span>Forums</span></a></div> <div id="search_box" style="background-color:#6699CC; position:relative; width:330px; float:left;"> <span> </span> <input class="query" name="q" type="text"> <input class="submit" value="Search" type="submit"> <a class="adv" href="/index.search.aspx?a=a&x=1">Advanced search</a> <br /> </div> </div> </form> </td> </tr> </table> Hi! Am new here, been doing CSS for a few months now, had a few problems here and there, but overall, is going well I have done this website homepage so far : http://www.moretonhallglass.com/cross/ It works fine on all browsers, except 1! which is IE 6. I have read into bugs for this but have been unable to fix it as yet. The problem is that the middle picture with the painting and descripton it seems to have a break at the top of it and pushes it down the page, have tried all sorts to fix it in the CSS code, but to no avail yet. Anyone know how to fix it? Thanks for your help 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> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Daisy Cross</title> <script type="text/javascript"> <!-- function swap(img, ref) { if (document.images) { document[img].src = ref; } } --> </script> <!--[if IE]> <style> .item { margin: 5px; padding: 10px; } </style> <![EndIf]--> <link rel="stylesheet" type="text/css" href="css/text.css" /> <link rel="stylesheet" type="text/css" href="css/base.css" /> </head> <body> <div id="container"> <div id="header"> <img src="images/top.jpg" width="940" height="129" border="0" alt="Daisy Cross" /> </div> <div id="mid" style="display: inline;"><table border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="3"><img src="images/dcross_01.jpg" width="940" height="24" border="0" alt=""></td> </tr><tr> <td><img src="images/dcross_02.jpg" width="545" height="135" alt=""></td> <td><a href="#" onmouseover="swap('mid1','images/dcross2_03.jpg')" onmouseout="swap('mid1','images/dcross_03.jpg')"><img name="mid1" src="images/dcross_03.jpg" width="194" height="135" border="0" alt=""></a></td> <td><a href="#" onmouseover="swap('mid2','images/dcross2_04.jpg')" onmouseout="swap('mid2','images/dcross_04.jpg')"><img name="mid2" src="images/dcross_04.jpg" width="201" height="135" border="0" alt=""></a></td> </tr><tr> <td colspan="3"><img src="images/dcross_05.jpg" width="940" height="136" border="0" alt=""></td> </tr><tr> <td colspan="3"><img src="images/dcross_06.gif" width="940" height="10" border="0" alt=""></td> </tr> </table></div> <div id="content-container"> <div id="content"> <br /> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td><a href="#" onmouseover="swap('nav1','images/nav2_01.gif')" onmouseout="swap('nav1','images/nav_01.gif')"><img name="nav1" src="images/nav_01.gif" width="130" height="32" border="0" alt=""></a></td> </tr><tr> <td><a href="#" onmouseover="swap('nav2','images/nav2_02.gif')" onmouseout="swap('nav2','images/nav_02.gif')"><img name="nav2" src="images/nav_02.gif" width="130" height="31" border="0" alt=""></a></td> </tr><tr> <td><a href="#" onmouseover="swap('nav3','images/nav2_03.gif')" onmouseout="swap('nav3','images/nav_03.gif')"><img name="nav3" src="images/nav_03.gif" width="130" height="30" border="0" alt=""></a></td> </tr><tr> <td><a href="#" onmouseover="swap('nav4','images/nav2_04.gif')" onmouseout="swap('nav4','images/nav_04.gif')"><img name="nav4" src="images/nav_04.gif" width="130" height="29" border="0" alt=""></a></td> </tr><tr> <td><a href="#" onmouseover="swap('nav5','images/nav2_05.gif')" onmouseout="swap('nav5','images/nav_05.gif')"><img name="nav5" src="images/nav_05.gif" width="130" height="30" border="0" alt=""></a></td> </tr><tr> <td><a href="#" onmouseover="swap('nav6','images/nav2_06.gif')" onmouseout="swap('nav6','images/nav_06.gif')"><img name="nav6" src="images/nav_06.gif" width="130" height="28" border="0" alt=""></a></td> </tr> </table> </div> <div id="aside" class="text"> <img src="images/welcome.gif" width="400" height="42" border="0" alt="Welcome" /> <p> Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam nonummy nibh euismod tinunt ut laoreet dolore magna aliquam erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </p> <p> Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam nonummy nibh euismod tinunt ut laoreet dolore magna aliquam erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </p> <p> Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam nonummy nibh euismod tinunt ut laoreet dolore magna aliquam erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </p> </div> </div><div id="footer"> <img src="images/footer.jpg" width="888" height="60" border="0" alt="" /> </div> </div> </body> </html> CSS : Code: #container { margin: 0 auto; width: 940px; background: #fff; } #header { background: #ccc; padding: 0px; margin: 0 0 0 0px; display: inline; } #header h1 { margin: 0px; } #mid { margin: 0; padding: 0; background: #ffffff; display: inline; } #navigation ul { margin: 0; padding: 0; } #navigation ul li { list-style-type: none; display: inline; } #navigation li a { display: block; float: left; padding: 5px 10px; color: #fff; text-decoration: none; border-right: 1px solid #fff; } #navigation li a:hover { background: #383; } #content-container { float: left; width: 940px; height:auto; background: #fff; } #content { clear: left; float: left; width: 160px; padding: 0px 0; margin: 0 0 0 20px; display: inline; } #content h2 { margin: 0; } #aside { float: right; width: 750px; padding: 10px 0; margin: 0 10px 0 0; display: inline; } #aside h3 { margin: 0; } #footer { clear: left; background: #fff; text-align: right; padding: 0px; } Css Layout Problem -------------------------------------------------------------------------------- This is probably a common question for Css, and I know it's a novice one too, but no matter where I've searched I cannot find a straight answer. Ok, I'm using CSS to layout my page, and I have a big logo at the top that's like 750x150 or something close to that. Looks fine in 800x600 but in the higher resolutions, you guessed it, tonnes of white space. I do not want to center it like people suggest, I want the header to touch both ends of the page, no matter what the resolution. I've used basic CSS styles, like #top {position: absolute; top:0px; left:0px;} for the logo. How would I change that so it will stretch for bigger resolutions?? Thanks My first post here and it promises to be a doozie! I am new to CSS and I have been trying to use it in lieu of tables. So far I have learned a great deal and made great progress, but I'm not here to tell you of my success of course. I am here to tell you my problems! Basically I am trying to create a fluid background. It consists of a 3x3 arrangement of divs. Like this: ABC DEF GHI They are arranged via float:left, and A,D,G all have clear:left. A,C,G,I are the rounded corners with known widths and height, so they are static. All the others (B,D,E,F,H) are fluid. The content is in E and should be the governing factor for the widths and heights of the fluid elements but I cannot seem to figure out how to make, for example, the heights of D and F match the height of E. I am reluctant to post all my code in here because it seems like a lot, but if it would help clarify my problem then I will. I hope my question is clear. I really need help but I don't know how to put it simply. Thanks! Hi, I'm really stuck with a template i'm making. it looks kind of o.k. in firefox Win XP, but it's screwed up in IE6 on Win XP. tried to many ways, but can't seem to solve it. template: http://www.thestateofdesign.com/template.php CSS: http://www.thestateofdesign.com/css/the_state_css.css I want the content [left & right content] to be situated under the headers, of course the left column on the left, and the right column next to the left, with a footer underneath it. in IE the footer and rightcolum move to the right. Tried to use positioning absolute, but that screws up the footer. Any help greatly appreciated, Cheers, Jarra Hello there. I Have a small problem i think. I have an layout which i want to have heights in %. This seems to be difficult. In the attachement i have an example of how it is ment to look. The header should be 135px height. The 2 leftside blocks should be 50% of the page which is left, and not the whole page (viewport). I Don't have an good example, becouse i can't figure it out :S. If someone has an link to somekind of div-builder or fluid design builder etc.. that would be nice . Thx in advanced. I am having a layout issue where if the contents of the left and right columns change, then the middle column increases or decreases in height. See www.eyeongames.com This is how it should look, but if you increase the font or the right or left columns expand, then the middle column shifts up or down. I want the columns to be even across the top. Thanks in advance! Here is the style sheet code I am using. Code: a { background: transparent; color: #ff8f02; text-decoration: none; } a:hover { color: #fff; } body { background: #550a04; color: #d7cf00; font-family: Verdana, Arial, Sans-serif; font-size: 12px; margin: 10px; padding: 0; } form { margin: 0; } h1,h2,h3,h4,h5,h6 { margin: 0; padding: 0; } hr { background: #abc; border: 0 none; color: #abc; height: 1px; margin: 0; padding: 0; } img { border: 0 none; } p { margin: 5px 0px 5px 0px; padding: 0; } th,td { padding: 2px; } div.leftColumn { background: transparent; border: 0px solid #555; left: 10px; padding: 5px; position: absolute; top: 400px; width: 240px; /* Incorrect IE5 value */ z-index: 2; voice-family: "\"}\""; voice-family: inherit; width: 218px; } html>body div.leftColumn { width: 218px; } div.leftColumn2 { background: transparent; border: 0px solid #555; left: 10px; padding: 5px; position: absolute; top: 143px; width: 240px; /*Incorrect IE5 value */ z-index: 2; voice-family: "\"}\""; voice-family: inherit; width: 218px; } div.topColumn { background: transparent; border: 0px solid #555; margin: 0px 200px 0px 130px; min-width: 200px; padding: 0px; position: relative; width: 600px; z-index: 3; } div.middleColumn { background: transparent; border: 0px solid #555; margin: 0px 200px 10px 240px; min-width: 200px; padding: 5px; position: relative; top: -105px; width: 480px; z-index: 3; } div.middleColumn2 { background: transparent; border: 0px solid #555; top: 0px; margin: 0px 200px 10px 240px; min-width: 200px; padding: 5px; position: relative; width: 480px; z-index: 3; } div.rightColumn { background: transparent; border: 0px solid #555; padding: 5px; position: relative; top: 43px; margin: 0px 0px 0px 742px; width: 240px; /* Incorrect IE5 value */ z-index: 1; voice-family: "\"}\""; voice-family: inherit; width: 218px; } html>body div.rightColumn { width: 218px; } div.logoBlock { background: transparent; border: 0px solid #555; left: 10px; margin: 0; padding: 0; position: absolute; text-align: left; top: 10px; width: 210px; /* Incorrect IE5 value */ z-index: 2; voice-family: "\"}\""; voice-family: inherit; width: 125px; } html>body div.logoBlock { width: 188px; } div.copyrightBlock { background: transparent; margin: 0px 200px 0px 200px; min-width: 200px; padding: 0; position: relative; text-align: center; width: 500px; z-index: 3; } *.newItem { color: #ff5500; } *.oldItem { color: #fff; } Here is part of the code. There are multiple index.tpl files with similar code only the content changes, such as when browsing the games. header.tpl Code: <div class="logoBlock"><--- LOGO IMAGE ---></div> <div class="topColumn"><--- BANNER IMAGE ---></div> <div class="leftColumn"> <h3>{HEADER_BLOCK1_TITLE}</h3> <hr /> <p><--- LINKS EDITED OUT ---></p> <h3>{HEADER_BLOCK2_TITLE}</h3> <hr /> <p><--- MORE LINKS ---></p> <h3>{HEADER_BLOCK3_TITLE}</h3> <hr /> <form><--- FORM CODE ---></form> <h3>{HEADER_BLOCK4_TITLE}</h3> <hr /> <p>{HEADER_BLOCK4_CONTENT}</p> <!-- <hr /> <p>{BACKEND_RSS}</p> <p>{BACKEND_TXT}</p> --> </div> <div class="rightColumn"> <table style="width: 100%;background: #d7cf00;"> <tr> <td align="center"><h3><font color="#550a04">Game Updates</font></h3></td> </tr> </table> <p align="center">{GAME_RSS}</p> <!-- <p align="center">{GAME_TXT}</p> --> </div> footer.tpl Code: <div class="leftColumn2"> <table style="width: 100%;background: #d7cf00;"> <tr> <td align="center"><h3><font color="#550a04">Latest News</font></h3></td> </tr> </table> <p>{BACKEND_RSS}</p> <!-- <p>{BACKEND_TXT}</p> --> </div> <div class="copyrightBlock"> <p><--- COPYRIGHT ---></p> </div> </body> </html> index.tpl Code: <div class="middleColumn"> <table style="width: 100%;background: #d7cf00;"> <tr> <td align="center"><h3><font color="#550a04">News Headlines</font></h3></td> </tr> </table> </div> <!-- <div class="middleColumn"> <p>{BACKEND_RSS}</p> <p>{BACKEND_TXT}</p> </div> --> <!-- BEGIN NEWS_BLOCK --> <div class="middleColumn"> <h3>{NEWS_SUBJECT}</h3> <h5>{NEWS_INDEX_RELEASE}</h5> <hr /> <p><--- NEWS TEXT ---></p> <p>{NEWS_SOURCE}</p> <hr /> <p><--- COMMENTS ---></p> </div> <!-- END NEWS_BLOCK --> <div class="middleColumn"><p>{NEWS_INDEX_PAGES}</p></div> |