Nov 22, 2009

Basic Css Layout Issue - Floated Cell with similar height

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > CSS (Cascading Style Sheets)

Basic Css Layout Issue - Floated Cell with similar height

moldboy
Okay say I was building a site (what do you know I am!) and I want to use CSS. the problem being I don't know how to make a floated cell be the same height as another. FOr example
CODE

<div id="main">

<div id="left">
just some </br> stuff over </br> here!
</div>

<div id="right">
but...</br> over here </br> I have </br> even more stuff</br> to </br> display</br>
</div>

</div>


now If I float the left to the left and the right to the right and set ther widths so that they will be beside eachother the left div is shorter then the right, which makes sense because there is more content in the right. I want to know how to make them the same height without specisifing the actual height, because it may change.

Comment/Reply (w/o sign-up)

truefusion
If you're under standard-compliant mode, then i dont think you can specify 100% height. But, with certain styles, you can make it seem like it is. For example, if "left" has a border, remove it, and do the same with "right". But, just have "main" with the border.

Comment/Reply (w/o sign-up)

jlhaslip
There is a technique known as "faux columns" which would apply to solve your problem of the height of the left column being less than the Main Content. Look it up at http://www.alistapart.com.
And the other thing you would want to add to the css for the page you list up there would be a margin on the right - hand div that is equal to or greater than the width of the left-hand column. The margin would be in the same direction as the floated column. ie: margin-left. It would be un-neccesary to float the right hand column on the page.

HTML
<div id="main">

<div id="left">
just some </br> stuff over </br> here!
</div>

<div id="right">
but...</br> over here </br> I have </br> even more stuff</br> to </br> display</br>
</div>


Css for the page:
CODE

body { margin:0; padding: 0;}
#main {}
#left { float:left; width:20%;}
#right { margin-left: 20%;}
Plus the code required for the faux-columns.

 

 

 


Comment/Reply (w/o sign-up)

moldboy
QUOTE
There is a technique known as "faux columns"
thanks that's exaclty what I wanted, although I thought there might be a diffrent way as all the sites use this two coloum structure and still have the same height. f there is another way, please tell.

Comment/Reply (w/o sign-up)

jlhaslip
If there was another way that worked and I knew about it, I would have mentioned it.
Also, don't forget a Doc Type Declaration.

Comment/Reply (w/o sign-up)

Tyssen
QUOTE(jlhaslip @ Apr 10 2006, 10:18 AM) *

If there was another way that worked and I knew about it, I would have mentioned it.

http://www.positioniseverything.net/articles/onetruelayout/

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : basic, css, layout, issue, floated, cell, similar, height

  1. Fixed Centred Layout
    Learn how to code that popular Centred/Fixed width layout... (2)
  2. Css Layout Help
    need help with my layout (8)
    http://billy61.trap17.com/divs/modulemaker.php i am rewriting my layout in divs instead of
    tables. the problem i have, is i need the divs with the "L" and "R" in them to extend all the way
    down to the bottom of the "content" div. also, what do i need to do to center the entire thing on
    the webpage? and it appears as though the top center div extends down into the middle div by
    like... maybe 5 px... is this just an illusion or is it really happening? this is the source html
    for the page: CODE "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml....
  3. Css Help 100 % Height
    (6)
    Allright so im working on a page and i need ot to always extent to the bottom of the page go figure
    lol.... However i cant figure out how to do this and have it work... either css or w/e else can be
    used to do it i just cant get it to flaot or sit at the bottom heres what ive got so far
    http://woodlawnwt.com/tdc/duffield-collection.html works in dreamwearver ( i use it for the color
    code and the ftp stuff... not for the wysiwig stuff lol...) but i cant get it to show in either ff
    or ie http://ryanfait.com/sticky-footer/ solution is there.... lol....
  4. How Do I Extend My Div To 1oo% Height?
    Also welcoming criticisms on my webpage (13)
    Hi all, this is a two part post, firstly how do i get my DIV to go the full length of my page
    without specifying its height in pixels? My first thought is by using a percentage height but it
    seems to have no effect on the DIV. I ask because of this page http://www.shadows.trap17.com/ww/
    that i created. Now im using 128Ox8OO res at the moment and with my current use of BR tags i can
    extend the div down to the bottom of the page, only in firefox its a few pixels too short and in IE
    its a few too long so i get scrolling in IE and a grey gap in FF, not good for a website ....
  5. 100% Height Issue With Stretching Top To Bottom - Full Page
    Problem with content not stretching from top to bottom. (5)
    Another CSS problem thats been annoying me. I got this tempalte off
    http://www.xs4all.nl/~peterned/examples/csslayout1.html the css file is here
    http://www.xs4all.nl/~peterned/examples/css/layout1.css I went ahead and applied it to my template.
    Their main divs contain 1 main container, 3 sub divs (header, content, and footer). HTML div
    id =" container "> div id =" header "> /div > div id =" content "> /div > div id
    =" footer "> /div > /div > I've had to add a few more divs inside the header div to
    include my table for banner an....
  6. Lists, Unordered And Nested
    some layout tricks (2)
    Unordered lists are one of the three list types in (x)html. The others are Ordered Lists and
    Definiton Lists. The w3c page of information about lists is here They all behave the same as
    (x)html elements, but there are some differences between them. Read the Specification page linked
    above to know more that you need to know about them. Only difference between html4 and xhtml is the
    tags must be lower-case and closed for xhtml to be valid. Ordered Lists have numbers preceding
    them. Paste the following code into a file and display it in your Browser to see the eff....
  7. Help Fix My Site's Css/layout Issues
    Thanks for your time (9)
    The first issue has been resolved. Please goto Post #7 to see the current discussion.
    This is in reference to: http://facesofwar.org/cms/ When you load the page up in Firefox it
    works fine. But when you use I.E. it creates a nasty line break after each of the spans containing
    a dividing line. The relevant html is: CODE
    Home    Iraq    Alt.
    Media    Other    Contact And the relevant css (for
    1280 resolutions) is: CODE .menuOuter {     width: 100%;    ....
  8. Height % In Ff Problems With Css
    (3)
    Does anyone know how to make the height of a div in firefox equal to the percentage you input? For
    example if I put blablabla the div container will only be as high as the text makes it, when in
    internet explorer it does make it take up 100% of the page or whatever height in percentage I input
    in it. by the way, html, body {} have 100% height in them, so does the container that has the div
    element. Example: html,body {height:100%;} #container {height:100%;} #div {min-height:100%;} the
    one called #div is the one I want with 100% height. Thanks for any help.....
  9. Css Layout: Trouble With Ie
    the scrollbar and margin-bottom (4)
    I have a site which I'm developping and trying to get a frames-like layout design. But IE does
    not propperly show the scrollbox, its hidden behind the fixed divs of the top header and the bottom
    footer... Firefox does alright, so If you dont understand what I mean you can check it out here:
    http://web.cucea.udg.mx/ineser/alap/test.php Seems like Opera and Safari are doing also good...
    And also, the margin of #content (which is the main content area) is not working, becouse it does
    not go up above the footer, I don't know what is going on (that rule is ins....
  10. Unordered List Css Layout
    two rows of list and sublist (4)
    I have a layout which i want to do fully in CSS. Im having trouble centering the second list, or
    sublist which comes from the menu. It doesnt work in IE now, just firefox (Actually the page doesnt
    even show on IE, nor Opera, i dont know why). I just want it to appear centered, when im hovering
    the main list, not left aligned... Here's the link, youll understand when you see it...
    http://web.cucea.udg.mx/cucea/graphix/level5/ I also want to fix the background, (i removed the
    background for now) becouse when i hover the sublist items, the background becomes bigge....
  11. Moving Ads With Css Layout On Free Hosting
    CSS help (7)
    Can anyone help me how to move top banner from free host? I hear that can be done with css!....
  12. Css Layout Generator - *free*
    Generate a CSS layout for your site (8)
    pretty powerful css layout generator. /smile.gif' border='0' style='vertical-align:middle'
    alt='smile.gif' /> and it's freely available online.
    http://www.csscreator.com/version2/pagelayout.php QUOTE To create your layout select the
    structural elements your site requires (header, footer, columns). Then specify a size in the field
    provided and choose a background color from the color chooser below. The color chooser changes
    values as you move your mouse along a row. To set a value click on the color row to release click
    again. Once the color in the box is th....
  13. Css How To Use It?
    how do you use it to make a custom layout 4 website? (3)
    how you make a custom layout and what is the coding and stuff?....
  14. Css Files, Get Your Css Files Here! [resolved]
    Want a nice CSS layout? (0)
    Alright, if anybody wants a CSS layout; I'll make one for you! Just tell me what you want the
    background color to be, main font color, and the link colors! Then later in the topic I'll post
    them and I'll post the username of the user that requested next to them so you know which one is
    yours! So if anyone wants a CSS File; Ask Mike! >_>....

    1. Looking for basic, css, layout, issue, floated, cell, similar, height

Searching Video's for basic, css, layout, issue, floated, cell, similar, height
See Also,
advertisement


Basic Css Layout Issue - Floated Cell with similar height

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com