SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: floats?

  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,618
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    floats?

    Since all my <h3>s have a set width and are floated to the right, and the box thing is floated to the right, shouldn't they be side-by-side?

    How do I make them be side-by-side?


    http://urgentcareavalon.com/

    Thanks
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,456
    Mentioned
    61 Post(s)
    Tagged
    2 Thread(s)
    Are you sure about those floats?
    Code:
    #inner_wrapper h3 {
        clear: left;      /* clear:left starts each one on a new line */
        color: #4E6C23;
        float: left;
        font-family: "Myriad Pro","Trebuchet MS",sans-serif;
        font-size: 20px;
        font-weight: bold;
        padding: 12px 0 0 13px;
        text-shadow: 2px 2px 1px #CCCCCC;
        text-transform: uppercase;
        width: 400px;
    }

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,109
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    A couple of problems there ... Firstly, the clear: left on your h3s is also clearing the whole div because the h3s inside it are cleared. But by just floating the h3s, they will naturally sit side by side across the page anyway ... so you need to wrap them in a div if you want to contain them in a column.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  4. #4
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,456
    Mentioned
    61 Post(s)
    Tagged
    2 Thread(s)
    Thanks, Ralph. I misunderstood "them".

  5. #5
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,791
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    On a totally different note why are you using all those H3??!?!?


    a couple of additional additional points:

    1) clear: (same direction as your float) is causing your H3s ( really reconsider your tag usage here!) to drop. So if you float:left; clear left; you aren't doing much!
    2) if you wanted the tags floated right you could float:right; HOWEVER this will reverse their order! That is the second on your source code tag will appear to the left of the first, and third to the LEFT of the second, and so forth. So the usual technique is to wrap the tags in a container , float the container right and the tags left ( no clear!)
    3) Since you are going to need a wrapper anyway and it is a list of items why not use a UL?

    hope that helps.


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
  •