Centered bullet in .css

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Louise06
    New Member
    • Feb 2007
    • 26

    Centered bullet in .css

    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.

    Code:
    .links ul li {
    	list-style-image: url(r_square.gif);
    		}
    Thanks for your advice!

    L
    Last edited by eWish; Jun 27 '08, 12:30 AM. Reason: Added Code Tags
  • Stang02GT
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    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.gi f);
    }

    Thanks for your advice!

    L
    Use this.

    [HTML]align="center"[/HTML]

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Rather than use an align attribute for presentation directly in the HTML, use text-align in the CSS:
      Code:
      text-align: center;
      Hope that helps.

      Comment

      • Louise06
        New Member
        • Feb 2007
        • 26

        #4
        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.

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Does this not work in IE6?
          Code:
          .links ul li {
          	list-style-image: url(r_square.gif);
          	text-align:center;
          }
          If not, post the corresponding HTML.

          Comment

          • Louise06
            New Member
            • Feb 2007
            • 26

            #6
            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

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              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:
              [code=css].guidelines {
              list-style-image:none;
              list-style-position:outsid e;
              list-style-type:square;
              }[/code]and the li:
              [code=css].guidelines li {
              font-size:9pt;
              margin:0px;
              padding:3px;
              }[/code]

              Comment

              • Louise06
                New Member
                • Feb 2007
                • 26

                #8
                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

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  Have you got a test page that you can show? If not, attach the image here.

                  Comment

                  • Louise06
                    New Member
                    • Feb 2007
                    • 26

                    #10
                    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:

                    [CODE=css].links ul {
                    list-style-image:url(/images/uploaded/Image/Intranet%20pics %20for%20CH/b_d_square.gif) ;
                    list-style-position:outsid e;

                    .links li {
                    font-size:9pt;
                    margin:0px;
                    padding:3px;
                    }
                    [/CODE][IMG[/IMG] Idon't know how to attach an image.

                    Louise
                    Last edited by acoder; Jul 4 '08, 10:12 AM. Reason: Added [code] tags

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      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!

                      Comment

                      • Louise06
                        New Member
                        • Feb 2007
                        • 26

                        #12
                        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.
                        Code:
                        .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;
                        }

                        Comment

                        • Louise06
                          New Member
                          • Feb 2007
                          • 26

                          #13
                          Sorry I forgot to ask, I am quite happy with the
                          list-style-type:square; instead. Could I change the color?

                          Thanks Louise

                          Comment

                          • acoder
                            Recognized Expert MVP
                            • Nov 2006
                            • 16032

                            #14
                            Yes, just add
                            Code:
                            color:whatevercolor;
                            to the style rule.

                            Comment

                            • Louise06
                              New Member
                              • Feb 2007
                              • 26

                              #15
                              Thank you!
                              This time it works

                              Louise

                              Comment

                              Working...