<left> and <right> in "same row"?

Discussion in 'HTML & Website Design' started by abcdefGARY, Oct 23, 2006.

  1. #1
    hello, I have some trouble figuring out how to do this...

    for example, I want navigation for "next" and "prev" buttons.

    I want to make like a single table row or single line that shows the label Prev on the left sight and Next on the right but without using tables

    I tried this using <div> so I did:

    <div align="left">Prev</div><div align="right">Next</div> but they appeared as two separate lines, instead of just one line.

    is there any way to do this without using a table?

    if anyone could help me, I'd be gladly to give them some green. thanks.
     
    abcdefGARY, Oct 23, 2006 IP
  2. Zedzero

    Zedzero Peon

    Messages:
    322
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use two nested divs.
    like:

    
    <div style="text-align:right;"> <div style="float:left;">Prev</div>Next</div>
    
    HTML:
     
    Zedzero, Oct 23, 2006 IP
    abcdefGARY likes this.
  3. missdanni

    missdanni Guest

    Best Answers:
    0
    #3
    Hrmm....

    I have always used tables to serve for this type of thing.

    The only other way I can think of off the top of my head would be pretty messy.

    It would look like this:

    <p align="center"><a href="#">&lt;&lt; Previous</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">Next &gt;&gt;</a> </p>
    Code (markup):
    Not so nice huh?

    If I think of anything else though I will post and let you know. :)
     
    missdanni, Oct 23, 2006 IP
  4. missdanni

    missdanni Guest

    Best Answers:
    0
    #4
    :eek: Doh!! :eek:
     
    missdanni, Oct 23, 2006 IP
  5. abcdefGARY

    abcdefGARY Well-Known Member

    Messages:
    665
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #5
    thanks. I used the float attribute by zedzero.
     
    abcdefGARY, Oct 23, 2006 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    
    #nextlast {
        text-align: right;
        margin: 0 1em;
        }
    
    #last {
        float: left;
        }
    ===========
    <p id="nextlast">
      <a id="last" href="lastpage.html">Previous Page</a>
      <a href="nextpage.html">Next Page</a>
    </p>
    Code (markup):
    Though it should probably be an unordered list, since it is a menu of sorts. Like so:
    
    #nextlast {  /*the ul*/
        list-style: none;
        padding: 0;
        text-align: right;
        margin: 0 1em;
        }
    
    #last {
        float: left;
        }
    ==========
    <ul id="nextlast">
      <li id="last"><a href="lastpage.html">Previous Page</a></li>
      <li><a href="nextpage.html">Next Page</a></li>
    </ul>
    Code (markup):
    cheers,

    gary
     
    kk5st, Oct 23, 2006 IP