SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot ThaLIkz's Avatar
    Join Date
    Jan 2002
    Location
    Drenthe, The Netherlands
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    aligning two div's

    This is my css

    PHP Code:
    div.members {
        
    width400px;
        
    padding0px
        
    margin0px auto;
        
    border:1px solid #000; }
        
    div.members span.pic {
        
    floatleft;
        
    width100px; }
        
    div.members span.profiel {
        
    floatright;
        
    width300px;
        
    font-size:12px;
        
    background-color:#f2f2f2;
        
    text-alignleft;
        
    padding2px; } 
    And this is my html

    PHP Code:
    <div align="center">
    <
    div class="members">
     <
    span class="pic">pic</span>
     <
    span class="profiel">Gamertag: [TSThaLikz</span>
    </
    div>
    </
    div
    This is a piece of a profile page, i want the span class pic & profile to be aligned on one line. This is working fine without the border around the div members but if i put a border around it the span class profile is aligned at the bottom (see here).

    How can i get it aligned at one line??

  2. #2
    SitePoint Zealot wisbin's Avatar
    Join Date
    Jan 2003
    Location
    Netherlands
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking make bigger members..

    or make sure you have the right width. (width of the div-boxes are made of: margin-left + border-left + padding-left + width + all-thatstuff Right. Make sure they are 0 if you dont want them.

    400 <> 100+300 in this CSS world
    Wisbin from ict-id.nl

    Every day I see your face I wish that I'd stayed
    Don't even know what made me run away
    It's just the way I play the game
    ..


  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Float span.profiel to the left as well. That should put them both on one line.

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    If you just increase the width in div.members to accomodate borders and padding, as Wisbin suggests, then you will see that they do stay on one line.

    Paul

  5. #5
    SitePoint Zealot ThaLIkz's Avatar
    Join Date
    Jan 2002
    Location
    Drenthe, The Netherlands
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah thnks a lot, it's working now


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
  •