http://www.webmasterworld.com Welcome to WebmasterWorld Guest from 38.103.63.17
register, login, search, glossary, subscribe, help, library, PubCon, announcements , recent posts, unanswered posts
Subscribe to WebmasterWorld
Home / Forums Index / Browser Side World / CSS
Forum Library : Charter : Moderators: DrDoc & Robin reala & SuzyUK

CSS

  
list bullet appears on second line of list-item text
jdcowan


#:3560335
 3:31 am on Jan. 29, 2008 (utc 0)

I have a css style for my bulleted lists that appear in a main content section (div) on my pages. The problem I have is in IE 6 and 7. If the text on a bulleted item wraps to a second line, the bullet aligns with the second (lower) line. How can I get it to stay on the first (upper) line. I believe it is caused by my width: 550px; in the css for the li. When I remove that, the bullet behaves normally. However, I need to limit the width as these run out of my container div they are in.

Help?

My doctype is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

style:
#content {
clear: right;
float: right;
width: 76%;
padding-right: 2px;
}
#content li {
width: 550px;
line-height: 21px;
list-style: disc outside;
}

<div id="content">
<ul>
<li>Book Projects: Chronicle your company's heritage to educate new employees or celebrate an anniversary or major event</li>
<li>Executive Communications: Help your leaders communicate with clarity and confidence </li>
</ul>
</div>

When this page renders, the text "celebrate an anniversary..." appears on a second line and the bullet is to the left of 'celebrate' not on the first line next to 'Book ...'

Book Projects: Chronicle your company's heritage to educate new employees or
-- celebrate an anniversary or major event

On the second bullet, the bullet appears on the second line next to the word 'confidence' not on the first line next to 'Executive ...'

Executive Communications: Help your leaders communicate with clarity and
-- confidence

Any thoughts?
Much appreciated.

jdcowan


#:3560858
 1:43 pm on Jan. 29, 2008 (utc 0)

Silly me... I realized that since my content width was a percentage, the content "could" stretch beyond that limit - or beyond the edge of the window making the user have to scroll.

I added another div tag on the page after my content div ant the bullets apear normal again.

<div id="content">
<div style="width: 600px; text-align: left;">
<ul>
<li> list item 1 </li>
<li> list item 2 </li>
</ul>
</div>
</div>

Cheers!

 

Home / Forums Index / Browser Side World / CSS
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of WebmasterWorld Inc.
© WebmasterWorld Inc. / SearchEngineWorld 1996-2008 all rights reserved