473,407 Members | 2,326 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,407 software developers and data experts.

Borders and bugs

Hi.

I have a CSS tabstrip that is causing me headaches. It consists of an
unordered list, styled to display inline. It is located at the bottom of
a "topmatter" div, which overlaps by a pixel or two the "mainarea" div
that is immediately below. The Each tab has a 1px border. The mainarea
also has a 1px border that is meant to match the border of the tabs. the
bottom border of the active tab is supposed to be the same colour as the
body of the mainarea, so that it "disappears", as if the tab were an
extension of the mainarea.

There's a testcase here, in which the border of the tabs is red for clarity:
http://www.jackpot.uk.net/jackpot/testlayout.html

So the problem is to do with the vertical positioning of the tabstrip.

Gecko (Firefox 1.5.02): This is what it's meant to look like.
Opera: The tabs appear 1px higher than they should.
IE6: Two separate problems - the bottom border isn't appearing at all,
and the tabstrip is too low by 2px.

The mising border in IE6 seems to be a new problem - it used to be
there, and I'm damned if I know what I did to make it go away. That's
probably something silly.

This is supposed to be HTML 4.0 Strict, and as far as I can see, IE6 is
indeed in standards mode.

So how do I get the positioning to be consistent?

Thanks,
Jack.
May 16 '06 #1
7 1447
Jack wrote:

There's a testcase here, in which the border of the tabs is red for clarity:
http://www.jackpot.uk.net/jackpot/testlayout.html

That's a good one.
It is related somehow to line-height in ".tabsul li". There is space
around the <li> that defies all attempts to remove it, and is a function
of line-height.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
May 17 '06 #2
Jim Moe wrote:
Jack wrote:
There's a testcase here, in which the border of the tabs is red for clarity:
http://www.jackpot.uk.net/jackpot/testlayout.html

That's a good one.
It is related somehow to line-height in ".tabsul li". There is space
around the <li> that defies all attempts to remove it, and is a function
of line-height.


OK, I'm still getting brainache with borders.

In Opera 8.54, the presence or absence of a bottom border on a DIV seems
to screw-up the vertical positioning of whatever follows it. In IE6 and
Firefox 1.5 this isn't happening. Is this a known bug? Is there a known
remedy? Google doesn't seem to know.

Example:
http://www.jackpot.uk.net/jackpot/op...tomborder.html

--
Jack.
May 17 '06 #3
Jim Moe wrote:

There's a testcase here, in which the border of the tabs is red for clarity:
http://www.jackpot.uk.net/jackpot/testlayout.html

That's a good one.
It is related somehow to line-height in ".tabsul li". There is space
around the <li> that defies all attempts to remove it, and is a function
of line-height.

I have a solution:
- add "line-height: 100%;" to "div.tabs"
- remove "margin-bottom: -1px"

It solves the positioning of the bottom of the <li>s. The z-index is
needed to have the tab list stack above navmain. Unfortunately not many
browsers support z-index. Neither IE6 nor Opera7 does.
Based on your test case there is no need for all that positioning,
either relative or absolute. It can as easily be done with margins or
padding. In general it is best to avoid positioning where possible since
IE does not do it very well.
Your code looks like a modified version of
<http://css.maxdesign.com.au/listamatic/horizontal05.htm>. I suggest
staying true to that code before introducing other factors.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
May 19 '06 #4
Jim Moe <jm***************@sohnen-moe.com> wrote:
Unfortunately not many
browsers support z-index. Neither IE6 nor Opera7 does.


Horse manure.

Unfortunately not many people understand absolute positioning and stack
levels, including you apparently. If you don't understand something,
please refrain from giving "advice".

--
Spartanicus
May 19 '06 #5
Jim Moe wrote:
Jim Moe wrote:
There's a testcase here, in which the border of the tabs is red
for clarity: http://www.jackpot.uk.net/jackpot/testlayout.html
That's a good one. It is related somehow to line-height in ".tabsul
li". There is space around the <li> that defies all attempts to
remove it, and is a function of line-height.

I have a solution: - add "line-height: 100%;" to "div.tabs" - remove
"margin-bottom: -1px"


Thanks, I'll look at this. I currently have some rather different code
that seems to be working in Firefox, IE6 and Opera8; but I don't really
understand it, and I have a deep loathing of voodoo programming. I
reached this point late last night, and when I understand why it's
working, I'll post an update.
It solves the positioning of the bottom of the <li>s. The z-index is
needed to have the tab list stack above navmain. Unfortunately not
many browsers support z-index. Neither IE6 nor Opera7 does.
IE6 "differently supports" z-index; positioned elements start a new
stacking context with a z-index of zero, in violation of specs, even in
standards mode. I only introduced the use of z-index after encountering
problems, and I'm now backtracking, not just because of IE, but simply
because it was a kludge.
Based on your test case there is no need for all that positioning,
either relative or absolute. It can as easily be done with margins or
padding. In general it is best to avoid positioning where possible
since IE does not do it very well.
Thanks for this advice.
Your code looks like a modified version of
<http://css.maxdesign.com.au/listamatic/horizontal05.htm>. I suggest
staying true to that code before introducing other factors.


Possibly that code may be some kind of ancestor of the code I started
with, but I've never seen that particular sample before. The page layout
started with something from Position Is Everything, and the tabs
themselves are very similar to this:

http://unraveled.com/projects/css_tabs/css_tabs.html

I can't right now locate the page I actually started with, but that is
roughly the same tabs code (it seems to be fairly widely reproduced).
The use of UL isn't necessary, and I've now dispensed with it.

FWIW I did have code that was working in Firefox and IE at one time;
some subsequent change broke it in IE, and in an effort to determine
whether IE or Firefox was responsible I downloaded Opera8 and tried it
in that, which (predictably) showed different behaviour again.

--
Jack.
May 19 '06 #6
Spartanicus wrote:
Unfortunately not many
browsers support z-index. Neither IE6 nor Opera7 does.


Unfortunately not many people understand absolute positioning and stack
levels, including you apparently. If you don't understand something,
please refrain from giving "advice".

My comment was based on observation of how it z-index operated with
those browsers rather than actual knowledge of how it is supposed to work.
Could you offer a reference that clearly explains this?

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
May 19 '06 #7
Jim Moe <jm***************@sohnen-moe.com> wrote:
My comment was based on observation of how it z-index operated with
those browsers rather than actual knowledge of how it is supposed to work.
You can't tell jack shit about how it works in browsers if you haven't
got a clue of how it's supposed to work.
Could you offer a reference that clearly explains this?


http://www.w3.org/TR/CSS21/zindex.html
http://www.w3.org/TR/CSS21/visuren.html#z-index

--
Spartanicus
May 19 '06 #8

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

Similar topics

2
by: Hostile17 | last post by:
I've been trying to figure out a good way to make a CSS layout with nice-looking 1-pixel borders around the table cells. The only broadly compatible way to do this I know of is to have * the...
2
by: Haines Brown | last post by:
This may seem a pointless question, but I'm trying work around an inconsistency between browsers. I have a template that contains a division that holds a text that sometimes exists and sometimes...
1
by: Melissa | last post by:
A form in my database has multiple subforms. If any subform has no data, the borders of the subform still display on screen and also are printed if I print the main form. Reports are different. If...
1
by: Melissa | last post by:
Sorry if this becomes a repeat! I am having trouble with my newsreader and don't know if this got posted yeserday or not or if anyone responded. A form in my database has multiple subforms. If...
1
by: Glen Vermeylen | last post by:
Hi, For a project at school we have to automate the assignment of seats in classrooms to students during the exams. The lady who previously did everything manually kept the layouts of the...
10
by: Matt Kruse | last post by:
See: http://www.mattkruse.com/temp/offsetleft.html It appears that the offsetLeft value in IE6 (other versions not tested) incorrectly ignores the border width on a DIV when there is a width:...
7
by: steve | last post by:
Hi All I urgently need help on setting datagridview cell borders at runtime I found some code on the web from Programming Smart Client Data Applications with .NET 2.0 by Brian Noyes See...
9
by: Michael Redbourn | last post by:
Hi, I just switched from FP to DW and am very very happy ! So whilst I'm mastering Dreamweaver (gonna be a while yet :-) - I thought that I'd try and find out how to add borders for browers...
2
by: nicstel | last post by:
Hello, I'm trying to find documentation about the xlwt (py_excelerator). I want to change the border of some cells. But the only types that I found is: double and dashed. How to do a simple line...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.