SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    .* draziW tnioPetiS *. bronze trophy
    Join Date
    Jun 2004
    Location
    "Then I figure the most good good guy will win."
    Posts
    1,666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Simple question: Simple answer: Floats within floats - do I need to clear the parent?

    Hi,

    I am working on a CSS layout for personal use, and I am wondering if I need to apply the "clearFix" to a floated div that contains floated children?

    By "clearFix" I mean:

    Code:
    /* Begin .theClearFix styles: */
    .theClearFix:after {
    	content: "."; 
    	display: block; 
    	height: 0; 
    	clear: both; 
    	visibility: hidden;
    }
    .theClearFix { display: inline-table; }
    /* Begin filter. Hides from IE-mac \*/
    * html .theClearFix { height: 1%; }
    .theClearFix { display: block; }
    /* End filter. End hide from IE-mac. */
    /* End .theClearFix styles. */
    And by floated parent/children, I mean:

    Code:
    <div parent "floated left with a specific width">
    	<div child1 "floated left with a specific width">
    	<div child2 "floated left with a specific width">
    	<div child3 "floated left with a specific width">
    </div>
    Or, if I am understanding things correctly, if the parent is floated then it will automatically wrap the floated children (all divs have specified widths.)

    Sorry, it is a bit of a noob question, and I am sure the answer is right in front of my nose, but for some reason that answer is escaping me atm.

    Any help would greatly be appreciated.

    Many TIA!
    Cheers,
    Micky

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should just be able to float them. But be careful where the floated elements are in your source code. Their position in the markup could make a big difference when the page is rendered.

  3. #3
    .* draziW tnioPetiS *. bronze trophy
    Join Date
    Jun 2004
    Location
    "Then I figure the most good good guy will win."
    Posts
    1,666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys, thanks for the great feedback! Cool link too, thanks all4nerds... I appreciate both of your help.

    I may be back with more q's.

    Cheers,
    Micky


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •