Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: CSS float

  1. #1
    Join Date
    Jul 2008
    Posts
    119
    Tokens
    0

    Default CSS float

    K, im using float to align an image to the left then have the text on the right, but then its in a box;

    HTML Code:
    <div class="top">
        Hi
    </div>
    <div class="mid">
        <img src="hi.png" style="float: left;">CONTENT CONTENT CONTENT
    </div>
    <div class="bottom"></div>
    There is more image than text so the background image for the <div class="mid"> doesn't expand all the way Does anyone know how to fix it?

    Moved by Invent (Forum Moderator) from Designing & Development: Please post in the correct forum next time, thanks .
    Last edited by Invent; 28-07-2008 at 04:37 PM.
    Signature Removed by Jamesy (Forum Super Moderator): Referal

  2. #2
    Join Date
    May 2005
    Location
    united kingdom
    Posts
    8,084
    Tokens
    595

    Latest Awards:

    Default

    Maybe try

    <img src="hi.png" align="left"> CONTENENTNTNENNENTNTNE

    drink up this bottle of yeah
    and P A I N T your body on me


  3. #3
    Join Date
    Jul 2008
    Posts
    119
    Tokens
    0

    Default

    Quote Originally Posted by SyrupyMonkey View Post
    Maybe try

    <img src="hi.png" align="left"> CONTENENTNTNENNENTNTNE
    I've allready tried that When i do that the text is underneath the image.
    Signature Removed by Jamesy (Forum Super Moderator): Referal

  4. #4

    Default

    Quote Originally Posted by Tom-743 View Post
    I've allready tried that When i do that the text is underneath the image.
    Underneath when you actually view it in a browser?
    View My DeviantART Gallery

    My new portfolio site is coming soon!

  5. #5
    Join Date
    Jun 2008
    Location
    Doncaster
    Posts
    885
    Tokens
    0

    Default

    It shouldn't do...

    <img src="image.png" align="left" /> textextext

    That should be right.

  6. #6
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Arshavin View Post
    It shouldn't do...

    <img src="image.png" align="left" /> textextext

    That should be right.
    FLOAT - Floats over/beneath image
    ALIGN - Moves the image with the other things.

  7. #7
    Join Date
    Jun 2008
    Location
    Doncaster
    Posts
    885
    Tokens
    0

    Default

    Align doesn't move it, it aligns it hence the name.

    I've never had a problem with using align images and text using that way.

  8. #8
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Arshavin View Post
    Align doesn't move it, it aligns it hence the name.

    I've never had a problem with using align images and text using that way.
    Yes, well done.

    Tom - try updating the CSS for "mid"

    Code:
    background: url(background.whatever);
    width: 100%;
    height: whateverpx;

  9. #9
    Join Date
    Aug 2005
    Location
    Newcastle
    Posts
    1,417
    Tokens
    0

    Latest Awards:

    Default

    I don't understand what you mean at all. Maybe post a screen shot?

    A little pointer which may be of use:
    Code:
    <div class="top">
        Hi
    </div>
    <div class="mid">
        <img src="hi.png" style="float: left;">CONTENT CONTENT CONTENT
    </div>
    <div class="bottom"></div>
    Add "text-align: right;" in your mid css. If you post a screenshot I will be able to help you.



  10. #10
    Join Date
    May 2008
    Posts
    605
    Tokens
    0

    Default

    Why don't you try span it to the left?

Page 1 of 2 12 LastLast

Posting Permissions

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