CSS - Problems With Making A Vertically Fluid Design
I'm trying to renovate my existing site "deepwaterchurch dot com", and part of it involves making the box on the site able to expand as more content is added to the content area. My best attempt at my new code is at "deepwaterchurch dot com slash next". I have successfully made the top of the design, but I can't figure out how to repeat the border section on the lower left and right (the part that will actually expand) in response to more content being added, then finish the bottom off with the lower border. I have created the files "leftedgelow.png", "rightedgelow.png", and "bottomedge.png" to use.
Here's the code I have so far: <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>LAYOUT</title> </head> <body style="margin:0px 80px 0px 80px; color:#FFFFFF; background-image:url(images/water.jpg);"> <div id="container" style="width:956px; margin:0px auto -1px auto;"> <div id="topedge" style="background-image:url(images/topedge.png); width:850px; height:15px;position:relative; left:53px;"></div> <div id="leftcolumn" style="background-image:url(images/leftedge.png); float: left; width: 79px; height: 641px;"></div> <div id="rightcolumn" style="background-image:url(images/rightedge.png); float: right; width: 79px; height: 641px;"></div> <div id="content" style="background:#000000; float: left; width: 797px; height:800px;">CONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br />CONTENTCONTENT<br /></div> </div> </div> </body> </html> I'd love some advice, as I'm very much a hobbyist at this. P.S. I know it's dirty to have inline CSS code, but it's much simpler at this stage to tweak. Thanks. Robin Similar TutorialsI'm trying to make a box (graphic) that will expand vertically as more content is added. I've made my border with flourishes and shadows, so a purely CSS box design isn't an option... Here's an exploded view of what I'm looking to do: ________________ |.........................| |.........................| |.........................| Top section that is static |.........................| |.........................| |.........................| Middle section with vertically |.........................| repeatable graphic |________________| Bottom section that closes it off Here's my code so far... Code: <div id="container" style="width:956px; margin:0px auto -1px auto;"> <div id="topedge" style="background-image:url(images/topedge.png); width:850px; height:15px;position:relative; left:53px;"></div> <div id="leftcolumn" style="background-image:url(images/leftedge.png); float: left; width: 79px; height: 641px;"></div> <div id="rightcolumn" style="background-image:url(images/rightedge.png); float: right; width: 79px; height: 641px;"></div> <div id="content" style="background:#000000; float: left; width: 797px; height:800px;">THIS IS THE CONTENT AREA</div> </div> </div> This code only makes the top half of the design, I can't seem to make the middle and bottom parts work. I'd appreciate any suggestions. Thanks. A random thought popped into my head today about whether it matters if a site is fluid or static with regards to accessibility. Wherever possible I do try to design fluid sites but is there anything wrong with a static design if you then add an extra CSS file for handheld devices etc? Is it possible to set a maximum width that a fluid design can expand to? I have a regisration form that needs to work from 640x480 upwards but I don't want the form to infintely get wider and wider. I would like it to cap out at 1280x1024 resolution. thanks. 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. I have problem whereby i want a container div with the width at 100% and a inside div that which is the same width but minus 10px on both sides. How can you get the inside div to be of fluid width to the container div with the 10px either side. Thanks. I'm having problems with a fluid three column layout. I started with the layout from Realworldstyle and ended up with this. The strange thing is that it seems to stay wider than the window, no matter what size the window is. There's also the right end of the top border in the right DIV, which is a few pixels short. Any suggestions? http://midnighttweaker.50megs.com/test.htm Hello, I came to this forum for help a couple months ago and was very impressed with how my questions were answered, so I hope nobody minds me coming around again. I've begun to create a stylesheet for my website that is completely fluid, rather than the 500px wide container my old stylesheet has. I've run into a couple problems that may or may not be related: 1) In my header div, I have an <h1> element and a <ul> that I'd like to be on the same line, but they're on different ones. 2) Both Firefox and Safari draw unnecessary scroll bars (both vertical and horizontal). 3) Sometimes my footer div will inch up from the bottom of the screen, where I'd hoped to leave it anchored. Here is a test html: http://www.bsuto.com/test.html and here is the css: http://www.bsuto.com/fluid.css Thanks! -Brian Link he rpisolution dot com/test/ Ok, the fixed-fluid-fixed part of the layout seems to work ok in the latest firefox and IE7 but it's broken in IE6 and possibly other versions. Could you guys take a look at the css? rpisolution dot com/test/css/style.css and see if you see what is breaking it in IE6, i thought I had put a hack that was supposed to fix the issues. btw, i know the CSS is probably ugly. sorry about that. thanks hi guys, having a few problems laying out div's on my page.... http://www.coltontooling.co.uk/test.php (all the css is in style tags in the page itself) I have one div surrounding all content called wrapper, which just centers the page. Then I have the orange bar and menu bar, and the white div which is called main content. My problem is trying to get the last grey bar to sit nicely at the bottom of the page. I placed it at the bottom of the white maincontent div with a negative margin-bottom, but as you can see (in firefox at least) it hovers almost at the bottom, but not quite far down enough. No matter what I change the margin-bottom to, it will not move down any further. My other attempt was to put it outside the maincontent div at http://www.coltontooling.co.uk/2.php , but as you can just about see it sits at the top behind the maincontent div. I could move it down manually from here but then it wont match any dynamic content in the maincontent box. Am i missing something obvious here? I'm pretty stumped thanks a lot, tom I'm trying to construct a complex 3-column CSS layout. I would like the center column to be fixed-width, and the outer columns to split the remainder of the document's width. All 3 columns should be able to contain centered or floated block elements and accept mouse events. Currently, I have approached this problem two nearly-successful ways. The first was to float the outer columns, but then I have no way to make them fill out. The second was to float the outer columns, then set them both to 50% with the appropriate margin set to half the width of the center column, but then I lose mouse event support in the center column because of the margins. The relevant CSS follows: Code: html { height: 100%; width: 100%; } body { margin: 0; height: 100%; width: 100%; } #left { float: left; height: 100%; /* 2nd attempt width: 50%; margin-right: 305px; */ } #right { float: right; height: 100%; /* 2nd attempt width: 50%; margin-left: 305px; */ } #center { margin: auto; height: 100%; width: 610px; } HTML-wise, the div order is #left, #right, #center. Does anyone know of a way to work around this? Good morning all, iv been fiddling with css for a couple months now, and iv done a couple pages and i want to do a more advanced style layout Im running into some float problems, im hoping somone can think of a better way to do this. heres a picture of what im roughly immaginging my page layout to look like. The problem i run into is having the 3 nav boxes on the right they seem to mess up any floats in the main window where content would go. heres a picture of how the problem looks: Its like i want to clear the floats inside the main content div, but not clear the div floats outside. Im a bit stumped can anyone help me out, would be happy to explain more or provide css source. any suggestions on a better way to do this. Problem page: http://www.ilumos.co.uk/site/?page=events Working page: http://www.ilumos.co.uk/site/ Style: http://www.ilumos.co.uk/site/style/styleDefault.css Hi all, I'm trying to make the glowyness (inside div#wrap) on the right side of the page extend to the bottom of the viewport/window, even if there isnt enough content (see problem page above) but the trouble is that when I apply height: 100% (with the same in a parent element) IE refuses to scroll the longer pages. Is there anoter way to make div#wrap fill the window? Thanks Hi, I haven't done any .css in a while so this might be a really dumb question I could have figured out by myself but... I'm trying to make a 3 column webpage using wordpress . I've colored the three columns blue, yellow, and red. I can get the blue and red to the relative position I want, but the red one is stuck below the two others even though I want all three on the same level. I can't quite figure out what's preventing that red column from positioning itseld higher... Any thoughts? look at my site. it is very boxy and almost TOO structured. is there a design trick i can use to mix it up a little? specific examples would be greatly appreciated. I am useing bon rouge's 3 columns 100%: http://bonrouge.com/3c-hf-fluid.php In IE, at some resolutions (1280x1024) the footer has a small 1pxish margin at the bottom. Any idea how to fix this? I am a total newbie to CSS + DIV. I have a logo that I am trying to piece together for a fluid page. The middle image is already in place, and I have it set to 100% width. I have one div, called "header." I need to know how to place the other 2 images at the right and left hand sides. They will, of course, be the static images, and the middle will be dynamically sized by the browser. Here is my CSS, so far for this portion: #header { position: absolute; top: 0px; right: 0px; margin: 0px; padding: 10px; background: url(images/CATScreenMiddle.png); width: 100%; height: 265px; font-family: verdana, arial, helvetica, sans-serif; font-size: 25px; Thanks for any help, in advance. Hi guys, need some help for my layout. What I am trying to do is set a div to: When screen width is <1024 x 768 width should be fluid When screen width is >1024 x 768 width should stay at within 1024 (viz. 970) to avoid the long hard-to-read paragraphs. Any ideas? Preferbably no javascript as I want it to change as the browser resizes without refreshing, like when the width is set to 100%. Hello! I'm here after much googling, and I am bashing my head against the wall, so any help is appreciated: Footer and header, fixed size, attached to top and bottom of screen. I want the center div to be a fluid height to sit between the header and footer, and if the content extends beyond that, I want it to scroll within the div, not the page. Here, I'm linking to a picture to explain more clearly: portlandworkshop-dot-com-slash-projects-slash-divs-dot-jpg (it won't let me direct link.. durrr) Nothing I do seems to fix this conundrum... Can ANYONE point me in the right direction? I need to create a layout that is 100% width. 2 columns. The right column is 300px and and left column (content) takes up the rest. I need content to be first in the code because of float clearing. Thanks for any help! Hi all, I have a three column fluid layout that works reasonably well. However, I'm running into situations where people want to use these ridiculous tables that are way too big. What happens in those cases is that the middle column tends to just write itself on top of the right column. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Three columns</title> <style type="text/css"> body { font-size:1.1em; background: #0081b3; padding-bottom: 2em; text-align: center; } .clearfix:after { content: "."; display: block; height: 0; font-size: 0; clear: both; visibility: hidden; } .clearfix { display: block; } * html .clearfix { height: 1px; } .clearfix { display: block; } #base { border-top: 1px solid #ffffff; border-bottom: 1px solid #ffffff; background: #DFDFDF; } #main_block { margin: auto; text-align: left; } #content { padding: 10px; padding-top: 2em; clear: both; } #container_1, #container_2 { margin: 0; padding: 0; } .three_column #middle_content_template { margin: 0 210px; } #left_content { padding: 25px 10px 25px 10px; float: left; width: 185px; } #right_content_template { float: right; width: 200px; margin: 0; padding: 0; } #left_content, #middle_content_template, #right_content_template { padding: 10px; } </style> </head> <body> <div id="base"> <div id="main_block"> <div id="content"> <div id="container_1"> <div id="container_2" class="three_column"> <div class="clearfix"> <div id="left_content"> <p>Left box o' content.</p> </div> <div id="right_content_template"> <p>Right box o' content.</p> </div> <div id="middle_content_template"> <table> <tr> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> <td><p>Header</p></td> </tr> </table> </div> </div> </div> </div> </div> </div> </div> </body> </html> What I'd like is for the middle column to just expand as wide as it needs to be and have the whole page expand as a result, pushing the right column properly to the right. Additionally, I'd like the gray box to expand with it. Is this possible? |