arsware.org design completely css based, having some problems.

Status
Not open for further replies.
In this thread, MalusCaelestis posted this page design which works in IE, Opera, Mozilla and Netscape 4.x. Because it looks very much like the arsware.org layout I'm using now, I tried to redesign it using solely CSS. This is what it looks like now in IE:



URL: http://www.arsware.org/8track/css3/aw3.php

It looks exactly the same in Mozilla 0.9.6 and almost the same in Opera 5.12. In Opera, the text in the center column starts 10px too low. I can't seem to fix that. Also, if more than one center column is put under one another, IE and Mozilla correctly put a space between them, but Opera doesn't (that's no biggie though).

The main thing that has me baffled is the fact that my layout doesn't work in Netscape 4.x _at all_ whereas the original one does. Netscape ignores _every_ css entry, no formatting is done. Why?!
 

HitScan

Ars Tribunus Militum
2,523
Subscriptor++
A couple things:
First, I would just ignore Netscape 4.x. Granted, several dozen people around the world may still use it regularly, but I highly doubt any of them are heading to ArsWare any time soon. Hopefully any who would go there are using Moz, Konq, or IE.

Secondly, your URL has css3 in it. Are you using some new stuff that's going to be in CSS 3 (or has it come out already, since I would never notice?) Because that may cause problems with browsers until they catch up. But that may be a stretch.

HitScan
 
This may or may not work for you:

What's worked for me is backing down to XHTML Transitional, and using the old-school tag attributes for NS4.x. Newer browsers will prefer the linked stylesheet, NS4.x will generally stick with the tag attributes. There might be a few things where you'll have to sniff for the browser and then script in the approprite style(s).

Or just don't worry about NS4.x... I wish I didn't have to.

Looks great in Opera 6, btw.
 

Kurt

Ars Tribunus Angusticlavius
8,820
Subscriptor++
First: You need to make sure all your tags are lowercase, and attributes are contained within quotes ("). It won't validate as XHTML Strict otherwise.

Second: I would ignore NS 4.x The CSS it does render, it usually borks, and CSS heavy pages make it insanely unstable.

Thirdly: Opera is notoriously buggy about how it handles margins. There aren't any good workarounds for that.
 
The answer to your question has to do with box problems and with all of the general problems that Netscape 4.xx has with CSS. I'd recommend using seperate stylesheets. 1 for netscape 4.xx and one for the rest.

Put this in the head of your doc.
code:<HR>
Code:
<link rel="stylesheet" href="StyleNN.css" type="text/css"> 
<style type="text/css"> 
@import url(/html//civis/threads/arsware-org-design-completely-css-based-having-some-problems.897839/post-16632915/Style.css); /*IE and NN6x styles*/
</style>

Where StyleNN.css is your Netscape 4.xx style.

Explanation: NN<6 does not recognize the @import, so it uses the <link> style sheet. IE and NN6 merge both stylesheets, but by placing the @import sheet below the <link> style, you give it more importance, therefore IE and NN6 will give you the styles in the @import.

You have to remember to use the same selectors and properties in both style sheets. If you declare a selector or property in the linked stylesheet and omit this in the imported sheet, IE and NN6 will take this selector or property with the corresponding value from the linked sheet.

The easiest way to have two style sheets is to start out with one sheet where you declare the styles, and then copy this sheet, rename it and change or delete the values where NN 4.xx has problems.

Important: If NN 4.xx can't find the external CSS file, the page will not be rendered properly.


Note: all of the above explanation was taken from http://www.mako4css.com/csstwo.htm

- Q
 
Thanks for the replies, the original document makes a lot more sense to me now, because I didn't understand why everything was defined in a css twice (one linked, one imported). It is obviously done to make the document work in the way Quetzalcoatl described.

I'm happy to hear it works fine in Opera 6, that's one more I can cross off the list. I can live with the way the margins are currently handled in Opera 5, the page doesn't look all that bad. For the rest, I'll take all of your advice into account when reworking the CSS files, I'm pretty sure I can make it work now. BTW, I'm not using an CSS3, the directory is just called that way because it was my third working attempt. :)

On another note, the current design doesn't work properly in Netscape 4.x either, because of what appears to be crappy margins and table handling. If I can't make the CSS layout work completely in NN, I think I'm going to go ahead and use it anyway, because it has some obvious advantages. I'm mainly thinking about implementing some theming, so people can also choose to have the Ars front page color scheme (I'm sure a lot of people would like that).

Goofball: If I were to switch over to the CSS layout, this would have some implications on the news.css design you made. Would it be a problem for you to rework that a little if needed? I can give it a shot too in any case.
 

Schluppy

Ars Tribunus Militum
2,486
You could always pop something like this in the head of your document and have uber-control over appearance.
code:<HR>
Code:
<!--#if expr="($HTTP_USER_AGENT = /Mozilla\/4/)&& ($HTTP_USER_AGENT != /MSIE/)" --> 
<link rel="stylesheet" type="text/css" href="ns4x.css"> 
<!--#elif expr="($HTTP_USER_AGENT = /Mozilla\//)&& ($HTTP_USER_AGENT != /MSIE/)" --> 
<link rel=StyleSheet href="mozilla.css" type="text/css">
<!--#elif expr="($HTTP_USER_AGENT = /Opera\//)&& ($HTTP_USER_AGENT != /MSIE/)" --> 
<link rel=StyleSheet href="opera.css" type="text/css">
<!--#else --> 
<link rel=StyleSheet href="msie.css" type="text/css">
<!--#endif -->

It's a bit more work but provides super control.
 
Well, thanks for all the replies, I'm happy to tell you that I got everything working for Netscape 4.x and all the other browsers. Check out the page here:

http://www.arsware.org/8track/css/aw.php

I still got to specify the text properties a bit more for Netscape 4.x, but the layout renders almost perfectly. I also fixed the margin problem in Opera 5 (I hope I didn't muck it up for Opera 6). I'm happy that I'm able to generate code that works, now all I need to work on is creating code that validates. :)

The next step will be make the news style sheet work properly again and look into allowing you to choose you own color scheme (I've been tinkering with a black scheme here, it still needs some perfecting).

If there is anything I overlooked, please let me know. BTW, this css stuff rocks!
 
Well, I recently started on phase two of my CSS layout project, which is to get the news items to look properly in all browsers. The current one does not render properly in Opera (sorry Goofball :) ). The header is positioned too low and the line in the header is a formatted <hr> tag, which is not rendered the same way in all browsers either.

So, after a couple of hours of tinkering, I came up with this:
http://www.arsware.org/8track/css/news/awnews.htm

This document renders the same on all platforms, except Netscape 4.x for which I haven't made the css entries yet. It is formatted rather odd, because the green line is rendered after the the date/time/e-mail line, and then moved up with a negative top margin. This is the only way I could get the file to look the same on all browsers. Also, both the icon and the line have the "float: left;" property, so basically they are overlapping. If I increase the left margin of the line so it doesn't overlap, it is again rendered differently in some browsers. All in all, I was really happy that this layout worked in the end.

The second part is incorporating it with the rest of the document, which I have done here:
http://www.arsware.org/8track/css/news/awnews.php

Guess what, now the news header renders properly in Mozilla and Opera, but not in IE. :D

After endless tinkering I am at a loss, I just don't understand why it all of a sudden refuses to work in IE. Any ideas anyone?

P.S. The CSS still doesn't validate, I haven't worked on that yet. I'm trying out TopStyle 2.5 to help me with that.
 
I feel a bit like a tard replying to my own thread all the time, but this is really really weird. I've simplified my design a bit, so now I have this:

http://www.arsware.org/8track/css/news/awnews.php

If I look at this page locally, it works fine. If I upload it to the arsware.org server and I open the page, it doesn't show the icon and the line. <twilight zone>If I click the back and forward button, so it refreshes the page, it _does_ show them.</twilight zone>

Excuse me while I bang my head against a wall for a minute...
 
Originally posted by BlackHex:
Why not detect the user agent server side and only deliver the trick code when required?

Bit more work but it's always a good last resort...
Well, that's exacly what I did, because it really isn't that much more work. The final version, which works in every browser is available here:

http://www.arsware.org/8track/css/final/arsware.php

victory at last... *sigh*
 
Status
Not open for further replies.