Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts

    Question align text next to image?!

    am i losing it?!

    on my site: http://www.wildfire-digital.com/test/lha/video.asp

    at the top, I would like to align the text Welcome to LHA next to the logo, can someone please help?

    thanks

    css:

    Code:
    .toplogo{width:1020px; height:100px; margin: 0px auto; display:block; text-align:left; background-image:url(img/lha-top.gif); background-repeat:repeat-x;  }
    .welcometext { font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#FFF; width:200px; height:100px; }
    html:
    Code:
    <div class="toplogo"><img src="img/LHA-logo.gif" border="0" alt="LHA logo"/><div class="welcometext">Welcome to LHA</div>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    Code:
    img.logo{
    float:left;
    }
    .welcometext {/*styles.css (line 360)*/
    color:#fff;
    font-family:Arial,Helvetica,sans-serif;
    font-size:14px;
    line-height:100px;
    width:200px;
    }
    Code:
    <div class="toplogo">
    <img border="0" alt="LHA logo" src="img/LHA-logo.gif" class="logo"/>
    <h2 class="welcometext">Welcome to LHA</h2>
    </div>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    Try changing

    Code:
    <div class="welcometext">Welcome to LHA</div>
    to

    Code:
    <span class="welcometext">Welcome to LHA</span>
    Divs are block-level elements and will force a line break before and after unless you float them. Spans are inline elements and behave differently. Note that widths and heights don't apply to inline elements, but you can control them somewhat by using line-height and padding.

    Edit: On second thought, go with abduraooft's method. It's more semantically appropriate to use the header tags.
    matt | design | blog


  •  

    Posting Permissions

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