Forum Moderators: open
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!)
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? ;)
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.
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?
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>
btw, using the above, I only use one sheet for all browsers, obv only good if you can get away with the bground image
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.
<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
You will have much better control over graphics if you use CSS.
Example:img {
vertical-align: middle;
margin: 10px;
}
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. :)
Mona