SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Header with left and right text

    Here is the html:

    Code:
    <h2>Office Name <span>555-5555</span></h2>
    I want this to display with the office name on the left of the screen and the phone on the right. It does this (floated the h2 left and the span right), but it bumps the phone number down to the next line.

    Any ideas on how to display this on a single line without absolute positioning or tables?

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

    Float the first part to the left and then align the text to the right. (Or move the span and phone number before the left text as floats must come first with the content you want to wrap)

    Here is an example that should explain it

    http://www.pmob.co.uk/temp/leftandright.htm


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
  •