1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to float two elements to the right maintaining the same order $5

Discussion in 'Programming' started by webgames247, Jan 30, 2016.

  1. #1
    Hi

    This is drive me crazy, can someone please help me how to float 2 items stay in the same line. $5 to your paypal for cup of coffee :)

    I have something like this

    <p style="float: right;">
    float a<br>
    float b
    <br clear ="all"/>


    main content

    </p>

    Thanks
     
    webgames247, Jan 30, 2016 IP
  2. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #2
    To float multiple objects, I think they need their own containers (<p> or <div>).
     
    ThePHPMaster, Jan 30, 2016 IP
  3. dangerousYY

    dangerousYY Member

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    I have no idea what are you trying to do.

    Maybe it's much useful for you to use "display:table;"

    <div style="display:table; width:100%;">

    <div style="display:table-cell;width:50%;">
    First cell :)
    </div>
    <div style="display:table-cell;width:50%;">
    Second cell :)
    </div>

    </div>

    In some cases this way would be much useful than float.
     
    dangerousYY, Feb 2, 2016 IP