www.webdeveloper.com
Results 1 to 6 of 6

Thread: vertical alignment of text in <li>

  1. #1
    Join Date
    Jul 2005
    Posts
    60

    vertical alignment of text in <li>

    Sorry, here comes another question. I have defined the <div>, <ul>, and <li> properties in a .css file, which includes a background image for the <li> tag.

    Everything looks good except that the text within the <li></li> tags is aligned center (horz) and top (vert). I really want the text to be along the bottom of the <li> tag's space. Anybody have an idea about how to do that? I played with margin and padding, but those move the background image around, too.

    thanks,
    Mike

  2. #2
    Join Date
    Jan 2005
    Location
    Frankfort, KY, USA
    Posts
    6,167
    It would be easier to manipulate the background image, rather than the text. You can use the CSS property of "background-position" to set it wherever you want: http://www.w3schools.com/css/css_background.asp

    KDLA

  3. #3
    Join Date
    Jun 2007
    Posts
    4
    I suggest you don't use the <li> tag to achieve the list effect.instead of it,you may use <div> tag for each list instead of <li> tag .So you can define much attribute to it.
    for example:
    <div id="your_sameStyle">
    <div id="yourstyle">The task of maintain world's peace deliver to you</div>
    <div id="yourstyle">The task of maintain world's peace deliver to you</div>
    <div id="yourstyle">The task of maintain world's peace deliver to you</div>
    </div>

    the list <div> use the same style,you can played with margin and pad in this style achieve you demand,
    I am learning div+css now too;some wrong please point out

  4. #4
    Join Date
    Jan 2005
    Location
    Frankfort, KY, USA
    Posts
    6,167
    If you're creating a list of links, you should use a <ul>, not divs. Divs have no meaning semantically.

  5. #5
    Join Date
    Jun 2007
    Posts
    4
    I am from China.So my English level is low,any expression maybe you can't understand.please forgive me.I want to learn from you!America's IT technology appeal to me!

  6. #6
    Join Date
    Jun 2007
    Posts
    4
    yeah ,I agree with you. KDLA

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles