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

Odd border + padding behavior: cross-browser

Hi all,

I've trolled through Google, a little of evolt, css-discuss archives,
and sent the list a request, all to no avail. I consulted
positioniseverything.net and quirksmode.org. The issue I have seems
simple enough that I'd have turned it up on any of those sources, but,
alas, that's not the case.

So, please refer to

http://www.erectlocution.com

for the page in question. Here are the issues:

(a) IE 6

This browser has some issues rendering the page. The borders of the
div with ID #contentWrapper render fine on initial loading, but there
is a portion of each of the right and left borders which isn't rendered
"below the fold", i.e. below the bottom of the rendered page, which is
evident on vertical scrolling. This behavior also occurs when
scrolling back up--the previously rendered border at the top of the
page is poorly rendered.

Additionally, when mousing over a link, the border rendering becomes
differently, if predictably, broken: some part of the left and right
borders of #contentWrapper disappear, starting around 100px below it's
top edge and 50px or so above its bottom edge. It's easily
reproducible, for me anyway.

Lastly--and this is probably somewhere on quirksmode.org or
positioniseverything.org, but of
lower priority for me--there is a gap of something like 3px between the
#header div and the
#contentWrapper div. This happens whether or not I feed IE special
rendering instructions via conditional comments.

(b) Firefox 1.0.7 / WinXP and Mac OS X

There is a gap of about 15px between the #header and #contentWrapper
divs rendered via Firefox. I have scoured through the fairly anemic
CSS and not found any reason for this in the code itself. Both the
XHTML and CSS validate, for what it's worth. I had applied a negative
margin, which, for FF, worked perfectly, but which caused Safari to
display part of the right border overlapping the header by those 15px.
Safari, then, renders the page better than anything else I've tried.

Overall, it's not critical faultiness; but I'd really like such a
simple site to render nicely. I appreciate any tips and pointers along
the way.

Thanks,

Daniel

Nov 4 '05 #1
11 2438
Well, I can see no problems in FF 1.5, but Netscape and opera both show
the gap you describe for firefox. I find it interesting that the gap is
the same size as the gap you define in the conditional IE statement.

IE 6 shows the borders missing on the sides, about in the area you
describe - but on my browser, it loads that way and stays that way. And
it has nothing to do with where the page border is.

I don't know if this will help, or how much - but I have noticed that
leaving off the unit in FF tends to cause issues, and you have done
exactly this on a number of your paddng and margin definitions -
basically, all the '0' ones. It may not even be relevant, but I would
start there.

As for the display of the side margins in IE - it looks like you are
defining them with floats - that is probably causing them to overlay
the border of contentWrapper when they're displayed. You might want to
try adding a margin - see if you can pull them in a bit.

I can't promise any of that will help, but that's at least where I
would start if I were fixing it. Also, I would endeavor to get rid of
the conditional definitions (but I can understand why they may be
necessary).

Hope that's at least SOME help...

Nov 4 '05 #2
Hey, Tony,

I very much appreciate this. I know the css-discuss list is
high-volume; but I'd figured that I would probably have had
<em>some</em> kind of response in a week or so. Oh well.

I'm a little concerned that the gap is there for FF 1.0.7 given that FF
1.5 penetration is probably kind of low still. I know Netscape is a
Gecko-based browswer, and whatever "feature" is causing the gap might
be shared by FF lt 1.5 and Netscape. However, I'm not personally to
aware of Opera's place in the browser code gene pool.

The borders don't concern me quite as much, but I don't want to shun IE
users if a relatively easy fix works.

Thanks again. This is at least a direction to head. I tried plumbing
through the Firefox Bugzilla database for something, but that proved
pretty daunting as an issue with phantom spacing is kind of generic.

Daniel

Nov 4 '05 #3
So, well, I tried providing units for every measurement, to no great
affect. If anything, it seemed to stabilize IE 6's rendering of the
borders, such that they're mostly messed up without changing. I've
played with a few different values of floated-element width, margin,
and padding on the containing element, to no avail. I know I'm hacking
at my balsa wood with a machette and expecting something pretty.

Has anyone else ever noticed IE "unrendering" borders as you scroll?

I might need to get FF 1.5, but I want this to work properly in 1.0.7
still. And then there are the Netscape and Opera issues, neither of
which I have.

Nov 4 '05 #4
mu****@yahoo.com wrote:

http://www.erectlocution.com

(a) IE 6

This browser has some issues rendering the page.


IE sucks when it comes to CSS, but there are 2 things that can cure a
whole pile of bizarre behaviors:

position: relative;
zoom: 1.0; (a proprietary property that other browsers will ignore)

Try adding position to different elements, containers in particular. If
that doesn't help, try adding zoom. If that doesn't work, go find a
2-column template on the css-discuss site that's already known to work.
<URL:http://css-discuss.incutio.com/?page=CssLayouts>

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Nov 4 '05 #5
Daniel,

Obviously, I'm at work right now, so I can't get into your code too
much, but I'll see if I can take a deeper look over the weekend. I know
I've seen and dealt with similar problems, but the details just aren't
coming to mind at the moment.

Nov 5 '05 #6
mu****@yahoo.com wrote:

http://www.erectlocution.com
for the page in question. Here are the issues: [...]

I could find no way to get the layout to look as I think you do with
the code as it is. Here is what I changed:
- I removed "contentWrapper" altogether. It is unnecessary.

- "header" and "header img" were changed to:
#header {
height: 46px;
background: url("./t_files/erectlocutionHeaderBG.jpg") repeat-x top left;
margin: 0px;
padding: 0px;

/* Changed: */
width: 720px;
margin: 0px auto;
padding: 0px;
}

#header img {
margin: 0px;
padding: 0px;

/* Changed: */
display: block;
}

- "allContent" was changed to:
#allContent {
width: 720px;
margin: 0px auto;
padding: 0px;
background: rgb(235,235,235) url("./t_files/erectlocutionBGWhite.jpg")
repeat-y top left;

/* Changed: */
border: 1px solid black;
border-top: 1px solid transparent;
}

- To get <h1> to work the same cross-browser you must specify both padding
and margin:
h1 {
padding: 0;
margin: 1em 0;
...
}

- In <body> "header" is placed first, then "allContent", and
"contentWrapper" removed. Everything else is the same.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Nov 5 '05 #7
Wow. This is a phenomenal effort. I feel like a teenage girl gushing,
but it's just refreshing.

Tony, please do take your time. This is--as the content should
evince--simply personal, and not a client project with a deadline (and,
yes, we should all be a little skeptical if I'd have a client with this
basic a need).

kchaya, I'll certainly play around with that stuff. I'd hate to go too
far to appease one poorly-constructed (from our perspective, anyway)
browser; but if a solution is found after some roughly arbitrary
measures, all of which can eventually be removed as I gather a bit more
sophistication, that'll do. Again, though I've got Zeldman's book
(haven't finished it, and I have precious little time to post at the
moment let alone read his book), and I appreciate the practical appeal
of standards (completely beside the purist's fastidiousness), I'm happy
if it basically just works for the time being.

Jim, I'd have preferred not to have the extraneous container; but I
felt that, given that I wanted to have the background tile properly
(providing the vertical separator via faux columns, and with my use of
the horizontal background image providing the faux border to the top of
the page), a container would suffice [NOTE: I'm leaving that, but I
now realize that I have that bg image tiling in the #allContent div,
and not the other]. I get the feeling that you may have used the
Firefox Web Developer extension and toyed with the CSS till it worked,
which I'd considered doing myself. I generally (and a little guiltily)
work on the site from work, so I wasn't comfortable going too far, and
I very much appreciate the lengths to which you went to provide what
should be an improved user experience. I'll try your changes this
weekend and see what I can do.

Thanks again, folks. A fairly humbling and educational experience so
far.

Daniel

Nov 5 '05 #8
In message <11**********************@g43g2000cwa.googlegroups .com>,
Daniel Black <mu****@yahoo.com> writes
So, well, I tried providing units for every measurement, to no great
affect. If anything, it seemed to stabilize IE 6's rendering of the
borders, such that they're mostly messed up without changing. I've
played with a few different values of floated-element width, margin,
and padding on the containing element, to no avail. I know I'm hacking
at my balsa wood with a machette and expecting something pretty.

Has anyone else ever noticed IE "unrendering" borders as you scroll?

I might need to get FF 1.5, but I want this to work properly in 1.0.7
still. And then there are the Netscape and Opera issues, neither of
which I have.

Download Opera (it's free) from http://www.opera.com/download/

--
Chris Hughes
"Reality is that which, when you cease to believe, continues to exist."
http://www.epicure.demon.co.uk
Nov 5 '05 #9
Jim,

It works like a charm thus far. Thank you very much. I need to figure
out why my content widths, padding, and margins seemed to have been
screwing everything up, at least compounded by the extra <div>. It
shouldn't have created problems, though, logically, since it had no
padding or margin. Then again...

Thanks again,

Daniel

Nov 7 '05 #10
Well, it looks like you got it! I just checked everything in IE, FF,
Netscape and Opera - displays the same across the board. Good job!

Nov 7 '05 #11
Daniel Black wrote:

It works like a charm thus far. Thank you very much. I need to figure
out why my content widths, padding, and margins seemed to have been
screwing everything up, at least compounded by the extra <div>. It
shouldn't have created problems, though, logically, since it had no
padding or margin. Then again...

You are welcome.
You could try restoring the div. It was just getting in the way while I
was working on the layout. It may be okay now.
The "border-top: 1px solid transparent" was necessary because of an odd
behavior in Mozilla. When I set "border-top: 0", Mozilla would add about
an em of space there.
Adding "display:block" to "#header img" gets rid of the space below the
image that is there to allow for descenders. An image (an inline element)
is normally positioned like text.

A typo slipped in: there is a missing space between "horridly-named"
and "blogoshere."
BTW: This is not a "Google Group". It is
comp.infosystems.www.authoring.stylesheets (c.i.w.a.s), a Usenet group.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Nov 7 '05 #12

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

Similar topics

33
by: Thomas Mlynarczyk | last post by:
Hi, I'm looking for a way to put a 1px solid border around the image in this link: <a href="some.html"><img src="some.gif"></a> Well, that, by itself, is simple. However, I would like to have a...
0
by: Red | last post by:
This is apparently an ie display bug, I can't seem to figure out which ie bug this is. a 3 sided border is created by wrapping the 'inner' box in the 'middle' box and padding the 'middle' box...
0
by: Red | last post by:
See http://reenie.org/test9.php There are two examples each with three nested divs. The only difference between the two is that the first example has no padding in the inner div, the second...
1
by: Trent L | last post by:
Hello, I'm having a problem where a style for a <a> tag isn't working in IE: border : 1px solid red; If you use my code below, you'll see what I mean. In IE6 on WinXP, I'm not seeing a red...
6
by: no0bodyhome | last post by:
One of the properties I have is: border-top-width: 30px I'd like to put some text on this border; align it and such. It is part of more complicated floating column text-box I'm working on...
7
by: Bob Bedford | last post by:
I've an image in a cell of a table. I've this CSS: ..dbtable{ width: 600px; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; border-collapse: collapse; border: 1px solid #000000;
0
by: smokeyd | last post by:
smokeyd Sep 26, 2:12 pm show options Newsgroups: alt.html From: "smokeyd" <tom_bur...@umbro.co.uk> - Find messages by this author Date: 26 Sep 2005 06:12:11 -0700 Local: Mon, Sep 26 2005...
2
by: tradmusic.com | last post by:
Hi, I'm new to CSS and, following some advice, created my page like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>...
16
by: FuzzyLogik | last post by:
By width, I don't mean weight. I have a row of <li>'s, with a bottom-border. I want the bottom-border to only go 90% of the <li> (centered) Is there any way to do this? I have it in this...
14
by: Mark Shroyer | last post by:
I just noticed an unintuitive aspect of how nested blocks are positioned under a specific set of conditions, and although this is ostensibly correct behavior (unless Firefox, Safari, and Opera are...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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
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...

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.