Forum Moderators: open

Message Too Old, No Replies

any way to have 0 margins

and still validate in NS4?

         

RussellC

1:13 pm on Sep 19, 2002 (gmt 0)

10+ Year Member



Topic says it all. Thanks.

palmpal

1:53 am on Sep 24, 2002 (gmt 0)

10+ Year Member



Hello,

Please see my earlier post on 9/22 regarding the same problem. I looked at your code and saw quite a few "align" tags. On my site I replaced mine with "div class= . . ." and defined the alignment in the class in the style sheet. As soon as I did this the rest of my style sheet was recognized.

Mona

(My site is currently off-line while I continue working on it!)

Key_Master

2:05 am on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I favor this new way of validating 0 margins but I think in some ways a lot of sites will have to build around it. Kinda of like getting rid of the <font> tags on a site in favor of CSS. It's going to take some time and effort to get it all working just right.

pageoneresults

2:07 am on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



> It's going to take some time and effort to get it all working just right.

Key_Master, where do you see problems with the code that you provided as a fix for zero margins? Does it interfere with the cascade or some other rendering issues we need to be concerned with? Please expound...

Key_Master

2:22 am on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only problem I've seen are table cells with images inside of <p></p> tags placed near the bottom of the page (because of the line break, I believe). I've tested the code on my sites and even on pages here at WebmasterWorld and it seem to work just fine.

I don't see how position:absolute; would cause all the CSS styles to stop rendering the way they should (e.g. p, h1, etc). It sounds like something else is going on there.

You could easily build a site around the code and not have any problems but the code is not plug-n-play for all existing Web pages.

is there anybody reading this that used the code on their own site and didn't have a problem with the CSS? ;)

RussellC

3:10 am on Sep 24, 2002 (gmt 0)

10+ Year Member



Key_Master,
I thought this was very strange myself. I tried it another one of my sites and it did the same thing. As soon as I put position: absolute; in there, the <p> and <h1> etc... wouldnt render properly in NS4. It was fine in all other browsers though. Very odd.

pageoneresults

3:12 am on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm not seeing any problems with NS4.73.

Key_Master

3:30 am on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



RussellC, could you sticky mail me an URL to check out?

keyplyr

4:30 am on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




...is there anybody reading this that used the code on their own site and didn't have a problem with the CSS? - Key_Master

I'm using the modification of your code that Tedster posted:

body {
background-color:#f0ffff;
color:#000;
position:absolute;
top:0px;
left:0px;
margin:0px;
padding:0px;
max-width:900px;
}

No problems. For those browsers supporting max-width, I'm guessing the page renders to the top-left.

RussellC

6:57 pm on Sep 24, 2002 (gmt 0)

10+ Year Member



Key_Master,

Sticky sent. Thanks

highman

7:13 pm on Sep 24, 2002 (gmt 0)

10+ Year Member



Not sure if this will help, you all sound a bit more advanced than me :)

body.body{
left:0px;
top:0px;
width: 760px;
position: absolute;
background-image : url(images/background.gif);
background-repeat : no-repeat;
background-color : #003468;
margin-left : 0px;
margin-top : 0px;
}

While you do load the background image as one image, if you can get this 'base' background 'look' to under 20k, then, just lay the rest of your images, menu, whatever over the top in <div> tags.

Works for me, it does load a bit strange on first visit to the site, but displays perfectly in all browsers, one point, maybe you can answer this; in NS4 if the stylesheet is NOT in the root, i.e calling 'style/design.css' rather than 'style.css' the background will not appear, I have to place the stylesheet in the root, but I like a well sorted web... any ideas?

pageoneresults

7:23 pm on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



> I have to place the stylesheet in the root, but I like a well sorted web... any ideas?

Use an absolute URL reference instead of relative...

<link href="http://www.domain.com/file.css" type="text/css" rel="stylesheet">

My NS4.x stylesheet

<style type="text/css">@import url(http://www.domain.com/file.css);</style>

highman

7:40 pm on Sep 24, 2002 (gmt 0)

10+ Year Member



Pageone, ah I remember, I have used that but it makes it a pain when the site is in development, its not a big hassle, still wierd NS cant reference it from the style sheet, out of context I suppose if its in its own folder.

btw, using the above, I only use one sheet for all browsers, obv only good if you can get away with the bground image

GaryK

8:06 pm on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry to arrive late but I have some input I'd like to share.

RussellC, you stated: As soon as I put position: absolute; in there, the <p> and <h1> etc... wouldnt render properly in NS4. It was fine in all other browsers though. Very odd.

I have the same exact problem with NN4.79. None of my other styles are recognized by NN4.79 (they render as whatever the default for that element is in NN4.79) now but at least the page has zero margins. :)

I don't have a URL to share since I'm still working on this but if anyone wants a private peek sticky me and I'll send you the private URL that's here on my home server.

pageoneresults

8:15 pm on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



highman, you can do this too...

<link href="/file.css" type="text/css" rel="stylesheet">

My NS4.x stylesheet

<style type="text/css">@import url(/file.css);</style>

The preceding forward slash means to look at root level so it won't matter where in the directory structure your pages are. It will always reference the root/file.css. If you want to put the css in a sub called css, it would look like this...

/css/file.css

Key_Master

10:05 pm on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, here's the answer but I don't think people are going to like it much. If your site uses <p> or <br> inside table cells for padding, spacing, etc the CSS solution will probably not work in Netscape 4.x. One table cell doesn't cause a problem unless you have an <p><img src=""></p> on the bottom of the page wrap.

You will have much better control over graphics if you use CSS.

Example:

img {
vertical-align: middle;
margin: 10px;
}

highman

10:33 pm on Sep 24, 2002 (gmt 0)

10+ Year Member



thanks pageone, will try your /slash theory in the morning, night all

Key_Master

11:03 pm on Sep 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just discovered that <td width="xxx" style="?;"> will also cause N4.x to ignore the original style sheet. Haven't tested it with external style sheets yet.

pageoneresults

12:16 am on Sep 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



> I just discovered that...

Isn't that because inline styles override any other styles that are imported or embedded?

Key_Master

12:33 am on Sep 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem is, in N4.x it's causing it to override every style in the style sheet.

pageoneresults

12:37 am on Sep 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hehehe, I should have mentioned that NN4.x chokes on inline styles. Anytime I see a problem with one of my sites in NN4.x, the first thing I look for is FP's sneaky way of inserting a style code on a tag. The biggest culprit is border:collapse.

Key_Master

1:02 am on Sep 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Netscape does have problems with inline styles but if the body CSS contains position:absolute; and you use an inline style in a table cell it renders most of the style sheet useless.

RussellC, your site has a little of everything I brought up today. Thanks for the look. It's giving me a better idea on what to avoid doing. Little problems like these can be hard to find. :)

RussellC

1:04 am on Sep 25, 2002 (gmt 0)

10+ Year Member



So is that the solution to the problem? Taking out inline styles?

Key_Master

1:13 am on Sep 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Its part of the solution. Also refer to message #45. There may also be more problems yet undiscovered.

palmpal

3:07 am on Sep 25, 2002 (gmt 0)

10+ Year Member



After I corrected the problem with my copyright statement (and the resulting missing graphic when position: absolute was used) I had a problem with my FAQ page and no CSS rendering. My problem was related to a Align tag in several TD's. As soon as I defined the Align in the class/CSS my CSS rendered correctly.

Mona

This 54 message thread spans 2 pages: 54