We help IT Professionals succeed at work.

Need UL CSS Style

codequest
codequest asked
on
952 Views
Last Modified: 2008-01-09
I'm building a blog in WordPress, and I need a style for an unordered list that will:

>  have square bullets
>  no blank line between first list item
>  no blank lines between list items
>  indented list items

Any help with this would be appreciated.

Thanks!
Comment
Watch Question

Mark StegglesWeb Developer
CERTIFIED EXPERT
Top Expert 2006

Commented:
Try this

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<style type="text/css">
ul {
list-style-type:square;
list-style-position:outside;
margin:0;
padding:0;
}
ul li {
margin-left:20px;
}
</style>
</head>
<body>
<ul><li>list item 1</li><li>list item 2</li></ul>
</body>
</html>

Author

Commented:
Thanks for input.  I modified that to this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<style type="text/css">
.postlist ul {
list-style-position:outside;
margin:0;
padding:0;
}

.postlist li {
list-style-type:square;
margin-left:20px;
}
</style>
</head>
<body>
some header
<ul class="postlist"><li>list item 1</li><li>list item 2</li></ul>
</body>
</html>

That works except for removing the space between the line before the bulleted list and the first line of the bulleted list.  Any other thoughts on that last bit?
Web Developer
CERTIFIED EXPERT
Top Expert 2006
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.