473,411 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

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_diary.htm" title="Link to the JM Optics show
diary">Show Diary</a></li>
<li><a href="#">Binocular Guide</a></li>
<li><a href="#">Binocular Help</a></li>
<li><a href="#">Site Help</a></li>
</ul>
</div>
I would much appreciate any help anyone can give me.

Cheers

David
Jul 21 '05 #1
5 2354
david hepworth wrote:
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_diary.htm" title="Link to the JM Optics show
diary">Show Diary</a></li>
<li><a href="#">Binocular Guide</a></li>
<li><a href="#">Binocular Help</a></li>
<li><a href="#">Site Help</a></li>
</ul>
</div>
I would much appreciate any help anyone can give me.

Cheers

David

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
Jul 21 '05 #2
On 9 Apr 2005 02:41:01 -0700, dh*******@bigfoot.com (david hepworth)
wrote:
I have everything as i wish except that i cannot center the damn thing
in the page.


[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
Jul 21 '05 #3
Els
Martin! wrote:
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.
In IE5 or IE6 in quirksmode it also works on block level elements.
if you insist on using floats, and you know the total with of your
tablist, you could use position: absolute; margin-left: -halfwidth_px


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 -
Jul 21 '05 #4
Jan Roland Eriksson <jr****@newsguy.com> wrote in message news:<5e********************************@4ax.com>. ..
On 9 Apr 2005 02:41:01 -0700, dh*******@bigfoot.com (david hepworth)
wrote:
I have everything as i wish except that i cannot center the damn thing
in the page.


[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.

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.'
Jul 21 '05 #5
in comp.infosystems.www.authoring.stylesheets, david hepworth wrote:
Jan, this problem was quite specific and thanks to someone actually
looking they have solved my problem.


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

http://dorward.me.uk/www/centre/

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
Jul 21 '05 #6

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

Similar topics

11
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:...
6
by: Fran¨ois 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...
3
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...
3
by: Haines Brown | last post by:
I thought I had understood this issue and implemented a work around, but now when I check on IE5, it is not working: ... #IE-hack { margin-left: auto; margin-right: auto; width: 20em;...
2
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 ...
15
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...
6
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...
3
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...
5
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...
1
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.