By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,487 Members | 1,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,487 IT Pros & Developers. It's quick & easy.

centering css tabs

P: n/a
I am trying to vertically align the CSS tabs so that it is centered,
like what it appears on apple.com. You can find my web-page here
(http://cse.unl.edu/~sraju/index-tabs.htm). It is now aligned to its
left. Any input is appreciated!

Peace,
Saravanan
Jul 20 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Saravanan Raju <sa******@earthlink.net> wrote:
I am trying to vertically align the CSS tabs so that it is centered,
like what it appears on apple.com. You can find my web-page here
(http://cse.unl.edu/~sraju/index-tabs.htm). It is now aligned to its
left.


That's what you are asking for: float:left

Loose all floats and the display:block on the li anchors, set both the
ul and the li elements to display:inline, set text-align:center on the
containing div.

--
Spartanicus
Jul 20 '05 #2

P: n/a
Saravanan Raju wrote:
I am trying to vertically align the CSS tabs so that it is centered,
like what it appears on apple.com. You can find my web-page here
(http://cse.unl.edu/~sraju/index-tabs.htm). It is now aligned to its
left. Any input is appreciated!

Peace,
Saravanan


As a new css programmer, could someone please explain why the home
tab on the displayed page has a white background and the other tabs
have an orange background? I can't find anything different in the css
to do that for tab1 vs tab2 - tab4? (Mozilla 1.4 and Konqueror
3.1.4)

(remove the "nospam" from my email if you wish to reply directly)

Stuart

Jul 20 '05 #3

P: n/a
Saravanan Raju wrote on 29 apr 2004 in
comp.infosystems.www.authoring.stylesheets:
I am trying to vertically align the CSS tabs so that it is centered,
like what it appears on apple.com. You can find my web-page here
(http://cse.unl.edu/~sraju/index-tabs.htm). It is now aligned to its
left. Any input is appreciated!


body#tab1 li.tab1,
body#tab2 li.tab2,
body#tab3 li.tab3,
body#tab4 li.tab4 {
border-bottom: 1px solid #ffffff;
background-color: #ffffff;
}

There is only
<body id="tab1">

so the other body#tabX do not point to anything.

Terrible coding, btw, why id= the body ??????????????

Perhaps there are other (astral ?) bodies overthere ?????????

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #4

P: n/a
Evertjan. wrote:
Saravanan Raju wrote on 29 apr 2004 in
comp.infosystems.www.authoring.stylesheets:
I am trying to vertically align the CSS tabs so that it is centered,
like what it appears on apple.com. You can find my web-page here
(http://cse.unl.edu/~sraju/index-tabs.htm). It is now aligned to its
left. Any input is appreciated!


body#tab1 li.tab1,
body#tab2 li.tab2,
body#tab3 li.tab3,
body#tab4 li.tab4 {
border-bottom: 1px solid #ffffff;
background-color: #ffffff;
}

There is only
<body id="tab1">

so the other body#tabX do not point to anything.

Terrible coding, btw, why id= the body ??????????????

Perhaps there are other (astral ?) bodies overthere ?????????


Thanks, that explains my confusion. I got the class tab1 confused with the
id tab1.

Stuart

Jul 20 '05 #5

P: n/a
Evertjan. wrote:
Saravanan Raju wrote on 29 apr 2004 in
comp.infosystems.www.authoring.stylesheets:

I am trying to vertically align the CSS tabs so that it is centered,
like what it appears on apple.com. You can find my web-page here
(http://cse.unl.edu/~sraju/index-tabs.htm). It is now aligned to its
left. Any input is appreciated!

There is only
<body id="tab1">

so the other body#tabX do not point to anything.

It is a mock page that is not complete, yet.
Terrible coding, btw, why id= the body ??????????????

I am new & learning :). Will improve, though. But the code is baed on
Joshua Kaufman's CSS tabs, which you can find here
(http://unraveled.com/projects/css_tabs/css_tabs.html)
Perhaps there are other (astral ?) bodies overthere ?????????

Wouldn't that be cool 8-)

Saravanan
Jul 20 '05 #6

P: n/a
Saravanan Raju wrote on 29 apr 2004 in
comp.infosystems.www.authoring.stylesheets:
Terrible coding, btw, why id= the body ??????????????

I am new & learning :). Will improve, though. But the code is baed on
Joshua Kaufman's CSS tabs, which you can find here
(http://unraveled.com/projects/css_tabs/css_tabs.html)


Id-ing the body is nonsensical for CSS,
even if the Joshua's walls come tumbling down.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #7

P: n/a
"Evertjan." <ex**************@interxnl.net> wrote:
Saravanan Raju wrote on 29 apr 2004 in
comp.infosystems.www.authoring.stylesheets:
Terrible coding, btw, why id= the body ??????????????

I am new & learning :). Will improve, though. But the code is baed on
Joshua Kaufman's CSS tabs, which you can find here
(http://unraveled.com/projects/css_tabs/css_tabs.html)


Id-ing the body is nonsensical for CSS,
even if the Joshua's walls come tumbling down.


In the context of a single page it clearly makes no sense to id the
body. But in the context of a site it can make perfect sense. If you
want to use one or two differeing styles for different pages then
adding id or class to body is a good way of doing so. Using an
additional stylesheet file, or including a <style> block often simply
isn't worth the effort.

Of course the problem with using it to highlight the current nav item
in systems like the above is that it encourages the sloppy practice of
leaving the nav item as a link, thus creating pages that link to
themselves.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #8

P: n/a
In article Evertjan. wrote:
Saravanan Raju wrote on 29 apr 2004 in
comp.infosystems.www.authoring.stylesheets:
Terrible coding, btw, why id= the body ??????????????

I am new & learning :). Will improve, though. But the code is baed on
Joshua Kaufman's CSS tabs, which you can find here
(http://unraveled.com/projects/css_tabs/css_tabs.html)


Id-ing the body is nonsensical for CSS,
even if the Joshua's walls come tumbling down.


No, it makes some sence, from user point of view. Google CSS-signature
for more.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
I'm looking for work | Etsin työtä
Jul 20 '05 #9

P: n/a
Steve Pugh wrote on 29 apr 2004 in
comp.infosystems.www.authoring.stylesheets:
Id-ing the body is nonsensical for CSS,
even if the Joshua's walls come tumbling down.


In the context of a single page it clearly makes no sense to id the
body. But in the context of a site it can make perfect sense.


Never thought of that. Yes.

I would never go that way.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #10

P: n/a
Evertjan. wrote:
Id-ing the body is nonsensical for CSS,


http://archivist.incutio.com/viewlist/css-discuss/13291

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.