Centered bullet in .css | Newbie | | Join Date: Feb 2007
Posts: 26
| |
Hi All,
I inserted this attribute in my .css file.
I wish to know how the centre the text after each bullet.
I also would like to make sure that there is no problem with other browsers. - .links ul li {
-
list-style-image: url(r_square.gif);
-
}
Thanks for your advice!
L
|  | Moderator | | Join Date: Jun 2007 Location: USA
Posts: 1,152
| | | re: Centered bullet in .css Quote:
Originally Posted by Louise06 Hi All,
I inserted this attribute in my .css file.
I wish to know how the centre the text after each bullet.
I also would like to make sure that there is no problem with other browsers.
.links ul li {
list-style-image: url(r_square.gif);
}
Thanks for your advice!
L Use this.
[HTML]align="center"[/HTML]
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,581
| | | re: Centered bullet in .css
Rather than use an align attribute for presentation directly in the HTML, use text-align in the CSS:
Hope that helps.
| | Newbie | | Join Date: Feb 2007
Posts: 26
| | | re: Centered bullet in .css
Hi
Thanks for your reply but it works with FireFox but not for IE 6.0.
Also you suggested to have a text-align = center: where can I add this as I have a lot of text styles in the .css?
I can also do it in HTML directly. Please advice.
Thanks
L.
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,581
| | | re: Centered bullet in .css
Does this not work in IE6? - .links ul li {
-
list-style-image: url(r_square.gif);
-
text-align:center;
-
}
If not, post the corresponding HTML.
| | Newbie | | Join Date: Feb 2007
Posts: 26
| | | re: Centered bullet in .css
Sorry, I need to clarify.
I would like the bullet (in this case a customed square) to be aligned with the text. The text is usually in aligned in the left.
As an example, you can see the "
REPLY GUIDELINES" used bulltes on the right of this page.
Thanks
Louise
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,581
| | | re: Centered bullet in .css Quote:
Originally Posted by Louise06 As an example, you can see the "
REPLY GUIDELINES" used bulltes on the right of this page. Those are left-aligned. The guidelines ul has the following CSS properties: - .guidelines {
-
list-style-image:none;
-
list-style-position:outside;
-
list-style-type:square;
-
}
and the li: - .guidelines li {
-
font-size:9pt;
-
margin:0px;
-
padding:3px;
-
}
| | Newbie | | Join Date: Feb 2007
Posts: 26
| | | re: Centered bullet in .css
Thanks for the guidelines, but my text is centered instead of being left.
Maybe the bullet image is wrong (.gif), red square (4 by 4 pixel).
Thanks
L
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,581
| | | re: Centered bullet in .css
Have you got a test page that you can show? If not, attach the image here.
| | Newbie | | Join Date: Feb 2007
Posts: 26
| | | re: Centered bullet in .css Quote:
Originally Posted by acoder Have you got a test page that you can show? If not, attach the image here. Thanks
Here is a similar script to Guidelines: - .links ul {
-
list-style-image:url(/images/uploaded/Image/Intranet%20pics%20for%20CH/b_d_square.gif);
-
list-style-position:outside;
-
-
.links li {
-
font-size:9pt;
-
margin:0px;
-
padding:3px;
-
}
-
[IMG[/img] Idon't know how to attach an image.
Louise
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,581
| | | re: Centered bullet in .css
You forgot to close the ul CSS rule.
To attach an image, make a post, then edit it, or use the img tag if you've got the image online.
PS. please use [code] tags when posting code. Thanks!
| | Newbie | | Join Date: Feb 2007
Posts: 26
| | | re: Centered bullet in .css Quote:
Originally Posted by acoder You forgot to close the ul CSS rule.
To attach an image, make a post, then edit it, or use the img tag if you've got the image online.
PS. please use code tags when posting code. Thanks! Thanks sure.
It still does not work, the bullets are higher than the text. -
-
.links ul {
-
list-style-image:url(/images/uploaded/Image/Intranet%20pics%20for%20CH/b_d_square.gif);
-
list-style-position:outside;
-
}
-
.links li {
-
font-size: 9pt;
-
margin:0px;
-
padding:3px;
-
}
-
| | Newbie | | Join Date: Feb 2007
Posts: 26
| | | re: Centered bullet in .css
Sorry I forgot to ask, I am quite happy with the
list-style-type:square; instead. Could I change the color?
Thanks Louise
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,581
| | | re: Centered bullet in .css
Yes, just add
to the style rule.
| | Newbie | | Join Date: Feb 2007
Posts: 26
| | | re: Centered bullet in .css
Thank you!
This time it works
Louise
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 14,581
| | | re: Centered bullet in .css
You're welcome. Glad it's working :)
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,439 network members.
|