473,770 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

centering css tabs

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
10 3141
Saravanan Raju <sa******@earth link.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
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
Saravanan Raju wrote on 29 apr 2004 in
comp.infosystem s.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
Evertjan. wrote:
Saravanan Raju wrote on 29 apr 2004 in
comp.infosystem s.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
Evertjan. wrote:
Saravanan Raju wrote on 29 apr 2004 in
comp.infosyste ms.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
Saravanan Raju wrote on 29 apr 2004 in
comp.infosystem s.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
"Evertjan." <ex************ **@interxnl.net > wrote:
Saravanan Raju wrote on 29 apr 2004 in
comp.infosyste ms.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
In article Evertjan. wrote:
Saravanan Raju wrote on 29 apr 2004 in
comp.infosystem s.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 tyt
Jul 20 '05 #9
Steve Pugh wrote on 29 apr 2004 in
comp.infosystem s.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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
15031
by: Jeff Thies | last post by:
I have a series of blocks that are float left that I need centered on the page. <div class="center" align="center"> <div style="width: 100 px;float: left">thumbnail 1</div> <div style="width: 100 px;float: left">thumbnail 2</div> <div style="width: 100 px;float: left">thumbnail 3</div> </div>
6
1946
by: Franois de Dardel | last post by:
http://mapage.noos.fr/dardelf3/tintin/page3bits.html Can I center the series of thumbnails horizontally in the pages _and_ keep the "elastic arrangement" where the number of thumbnails adapts to the width of the screen. Franois de Dardel http:/mapage.noos.fr/dardelf Faber est suae quisque fortunae Remove fourteen to reply
3
7356
by: Jonah Bishop | last post by:
I have a puzzling problem with centering text, and I'm hoping that someone here can help me out. First of all, let me state that I am using XHTML 1.0 Strict and CSS for all layout purposes (no tables). My website consists of a few, simple parts: a "container" DIV which is centered and 750 pixels wide, a "sidebar" DIV which can be found along the left side of the container, and a "content" DIV which fills up what's left of the right part of...
2
2242
by: Ryan W Sims | last post by:
I'm having trouble with centering in IE... http://www.ryanwsims.com/koh/ The image should center over the text. It does in Firebird, but not in IE for some reason. If you look at http://www.ryanwsims.com/sd.php everything's fine (i.e. centered)
15
13507
by: red | last post by:
How do I center two side by side divs ? I've been writing css pages for a while but there's one thing tha still eludes me. I can center a div with margin auto. I can place two divs side by side with float. But I can't center two side by side divs. If I float them and give them auto margins, the auto margins are ignored. If I wrap the two floated divs in another div, the two divs have no
6
2035
by: Axel Siebenwirth | last post by:
Hi, as described at http://www.quirksmode.org/css/centering.html, I try to do to centering with my site. I did exactly as told on that page but it only seems to center horizontally. My site is at http://www.up-2-d8.de/menu.html Can you please take a look and see whether you can find anything I am doing wrong?!
3
4211
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a top level <divthen I can place it with CSS attribute 'left:', but this is a fixed offset. Is it possible to have a <divcentered in the browser window? 2. Verticle centering in <div>
5
4825
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up doing this demo with tables. The main problems are the vertical centering of the info area, and of the text inside the squares.
1
2287
by: =?Utf-8?B?ZnJhbmt5?= | last post by:
Hello, I've created a table that has two rows that are span across three columns. The third row has three columns, each with an image. The last row is also span accross three columns. The span rows are centering their data. however, the row with three columns, each with images (myimages1-3) are not centering with the rest of the table. Any idea why? Thanks in advance!
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.