Dopey git alert - prob with centering CSS Tab

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • david hepworth

    Dopey git alert - prob with centering CSS Tab

    I am in the process of creating a CSS tab style thing for my webpage.
    I have everything as i wish except that i cannot center the damn thing
    in the page. I am hoping someone out there can help. I am sure that
    it is a silly mistake but i have been staring at it for so long i am
    going stir-crazy!

    I have tried 'text-align: center;' in most parts of the CSS and in the
    div in the HTML but it does not like it.

    This is my CSS:...

    #pagetabs { float:left; width:100%; font-family: Verdana, Arial,
    Helvetica, sans-serif; font-size:75%; line-height:normal;}
    #pagetabs ul { margin:0; padding:0; list-style:none; }
    #pagetabs li { float:left;
    background:url( "../images/misc/tabright.gif") no-repeat right top;
    margin: 0 1px 0 1px; padding:0; }
    #pagetabs a { display:block; color:#5F68C3; text-decoration: none;
    font-weight: bold; background:url( "../images/misc/tableft.gif")
    no-repeat left top; padding:5px 15px;}
    #pagetabs a:hover { color: #FF0000; }
    #pagetabs #current {
    background-image:url("../images/misc/curtabright.gif "); }
    #pagetabs #current a {
    background-image:url("../images/misc/curtableft.gif" ); }

    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #pagetabs a {float:none;}
    /* End IE5-Mac hack */


    and this is my HTML:...

    <div id="pagetabs">
    <ul>
    <li id="current">< a href="#">Home</a></li>
    <li><a href="show_diar y.htm" title="Link to the JM Optics show
    diary">Show Diary</a></li>
    <li><a href="#">Binocu lar Guide</a></li>
    <li><a href="#">Binocu lar Help</a></li>
    <li><a href="#">Site Help</a></li>
    </ul>
    </div>


    I would much appreciate any help anyone can give me.

    Cheers

    David
  • Martin!

    #2
    Re: Dopey git alert - prob with centering CSS Tab

    david hepworth wrote:
    [color=blue]
    > I am in the process of creating a CSS tab style thing for my webpage.
    > I have everything as i wish except that i cannot center the damn thing
    > in the page. I am hoping someone out there can help. I am sure that
    > it is a silly mistake but i have been staring at it for so long i am
    > going stir-crazy!
    >
    > I have tried 'text-align: center;' in most parts of the CSS and in the
    > div in the HTML but it does not like it.
    >
    > This is my CSS:...
    >
    > #pagetabs { float:left; width:100%; font-family: Verdana, Arial,
    > Helvetica, sans-serif; font-size:75%; line-height:normal;}
    > #pagetabs ul { margin:0; padding:0; list-style:none; }
    > #pagetabs li { float:left;
    > background:url( "../images/misc/tabright.gif") no-repeat right top;
    > margin: 0 1px 0 1px; padding:0; }
    > #pagetabs a { display:block; color:#5F68C3; text-decoration: none;
    > font-weight: bold; background:url( "../images/misc/tableft.gif")
    > no-repeat left top; padding:5px 15px;}
    > #pagetabs a:hover { color: #FF0000; }
    > #pagetabs #current {
    > background-image:url("../images/misc/curtabright.gif "); }
    > #pagetabs #current a {
    > background-image:url("../images/misc/curtableft.gif" ); }
    >
    > /* Commented Backslash Hack hides rule from IE5-Mac \*/
    > #pagetabs a {float:none;}
    > /* End IE5-Mac hack */
    >
    >
    > and this is my HTML:...
    >
    > <div id="pagetabs">
    > <ul>
    > <li id="current">< a href="#">Home</a></li>
    > <li><a href="show_diar y.htm" title="Link to the JM Optics show
    > diary">Show Diary</a></li>
    > <li><a href="#">Binocu lar Guide</a></li>
    > <li><a href="#">Binocu lar Help</a></li>
    > <li><a href="#">Site Help</a></li>
    > </ul>
    > </div>
    >
    >
    > I would much appreciate any help anyone can give me.
    >
    > Cheers
    >
    > David[/color]


    its not very oncvenient to make them float and then want them to center.
    better make li { display: inline} and dont use floats. although this has
    its drawbacks. btw 'text-align: center' only works on inline boxes.

    if you insist on using floats, and you know the total with of your
    tablist, you could use position: absolute; margin-left: -halfwidth_px

    gl
    martin

    Comment

    • Jan Roland Eriksson

      #3
      Re: Dopey git alert - prob with centering CSS Tab

      On 9 Apr 2005 02:41:01 -0700, dhepworth@bigfo ot.com (david hepworth)
      wrote:
      [color=blue]
      >I have everything as i wish except that i cannot center the damn thing
      >in the page.[/color]

      [snipped lots of #¤%%%57*""=]

      This is a FAQ that has been asked in this NG until boredom.

      You are posting to Usenet news through one of the biggest search engines
      in the world but you have no idea of how to use it to your own benefit?

      A Google search for the quoted string "Center with CSS" gives 165 hits;
      the info you are asking for is on the first couple of result pages.

      --
      Rex


      Comment

      • Els

        #4
        Re: Dopey git alert - prob with centering CSS Tab

        Martin! wrote:
        [color=blue]
        > its not very oncvenient to make them float and then want them to center.
        > better make li { display: inline} and dont use floats. although this has
        > its drawbacks. btw 'text-align: center' only works on inline boxes.[/color]

        In IE5 or IE6 in quirksmode it also works on block level elements.
        [color=blue]
        > if you insist on using floats, and you know the total with of your
        > tablist, you could use position: absolute; margin-left: -halfwidth_px[/color]

        You mean so that the left part will be inaccessible if the width of
        the visitor's window is less than the width of the tablist?
        (plus it won't be centered as soon as the visitor changes their text
        size)

        --
        Els http://locusmeus.com/
        Sonhos vem. Sonhos vão. O resto é imperfeito.
        - Renato Russo -

        Comment

        • david hepworth

          #5
          Re: Dopey git alert - prob with centering CSS Tab

          Jan Roland Eriksson <jrexon@newsguy .com> wrote in message news:<5ebf51pi3 vn83akdvvqdl07m 6u7ugf9bj4@4ax. com>...[color=blue]
          > On 9 Apr 2005 02:41:01 -0700, dhepworth@bigfo ot.com (david hepworth)
          > wrote:
          >[color=green]
          > >I have everything as i wish except that i cannot center the damn thing
          > >in the page.[/color]
          >
          > [snipped lots of #¤%%%57*""=]
          >
          > This is a FAQ that has been asked in this NG until boredom.
          >
          > You are posting to Usenet news through one of the biggest search engines
          > in the world but you have no idea of how to use it to your own benefit?
          >
          > A Google search for the quoted string "Center with CSS" gives 165 hits;
          > the info you are asking for is on the first couple of result pages.[/color]


          Cheers Martin,
          I used to have it like you suggested but changed it for some reason
          (can't remember why now). Nice to find people so ready to help.


          Jan, this problem was quite specific and thanks to someone actually
          looking they have solved my problem. Do you think i have not been
          searching for the answer for a while? As my mum used to say, 'If you
          can't say anything nice then don't say anything at all.'

          Comment

          • Lauri Raittila

            #6
            Re: Dopey git alert - prob with centering CSS Tab

            in comp.infosystem s.www.authoring.stylesheets, david hepworth wrote:[color=blue]
            > Jan, this problem was quite specific and thanks to someone actually
            > looking they have solved my problem.[/color]

            If so, where was your URL. Anyway 99% it needs someone to look it because
            your reading comprehension is bad.



            --
            Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
            Utrecht, NL.
            Support me, buy Opera:

            Comment

            Working...