SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Zealot thespian's Avatar
    Join Date
    Sep 2000
    Location
    South Africa
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Having taken the advice of people like Nikki and Wayne, I always ensure a level of cross-browser and cross-resolution compatibility. Because of logistic reasons, I have chosen IE4 and Netscape 4.7 as my bases. Thus far I have enjoyed the challenge of making sites operate correctly.

    I am also using CSS and am very happy with it. Now I have one problem and that is that although most styles are operating correctly, the font face does not work in NS. I use Verdana but in NS it comes out in Times New Roman.

    I have heard that NS does not like external stylesheets and I have heard that some people have different stylesheets for different browsers. Is my problem related to this?

    Many Thanx

    Bill
    Bill Conté [Protected by Psalm 91]
    Web Mechanix
    Growing OLD is Mandatory - Growing UP is Optional!

  2. #2
    Gong!
    Join Date
    May 2000
    Location
    Helsinki, Finland
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try to do it like this:

    Code:
    <STYLE type="text/css">
    body, table, td {
    font-family: verdana,arial,sans-serif;
    font-size: 1.0em;
    }
    </STYLE>
    Note that the font-size needs to be 1.0, otherwise if you use 0.8em for example you'll end up to 0.8*0.8*0.8 if using tables

    But that should work.

  3. #3
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    NS supports font-size
    Try doing this:

    Moving the code up and down a few lines at that section.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  4. #4
    SitePoint Zealot thespian's Avatar
    Join Date
    Sep 2000
    Location
    South Africa
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many Thanx for those replies. Unfortunately they do not answer my problem. I am specifically refering to the use of external Style Sheets.

    I am sure that I am doing something wrong since this seems to be such a basic function.
    Bill Conté [Protected by Psalm 91]
    Web Mechanix
    Growing OLD is Mandatory - Growing UP is Optional!

  5. #5
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, You odn't get it.

    Whether its embedded or external makes no difference. The code is still the same. The code we give you can be used on external style sheets too.

    The problem is netscape is known to give such problems. Some workarounds would be to move the code....a few lines up and a few lines down.

    Netaen your code too. Netscape is very strict on code, and sometimes seems to perform properly. However, minor problems such as your font size would surface and it could be as a result of your overall code.

    Visit this link where they give you workarounds around known problems of CSS in the various browsers.

    http://css.nu/pointers/bugs.html
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  6. #6
    SitePoint Zealot thespian's Avatar
    Join Date
    Sep 2000
    Location
    South Africa
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by lynlimz
    Whether its embedded or external makes no difference. The code is still the same. The code we give you can be used on external style sheets too.
    Thanx for the info. It was just that I had read on these forums that NS had a problem with External Style Sheets.

    The problem is netscape is known to give such problems. Some workarounds would be to move the code....a few lines up and a few lines down.
    Which code must I move? I assume you are talking about the Style Tag. How does this apply to Style Sheets?

    Netaen your code too. Netscape is very strict on code, and sometimes seems to perform properly. However, minor problems such as your font size would surface and it could be as a result of your overall code.
    Netaen?

    Thanx for all the info. I will definitely try out the link this evening.

    As to hmahonen's code ....

    Code:
    <STYLE type="text/css">
    body, table, td {
    font-family: verdana,arial,sans-serif;
    font-size: 1.0em;
    }
    </STYLE>
    .... could you please tell me in what way will it solve the problem? I have defined the font-family at the body level although not specifically for tables since all my text is encapsulated in paragraphs <P> which have the style defined. I notice he uses a size unit of "em". What is "em" and will it make a difference to my use of "pt" units?

    I do appreciate your assistance.

    A last thing though. Now that I think about it, I am using the same font throughout the site. I only actually define the font-family in the Style for the body. Thereafter, the style attributes that I set for the various tags only relate to those attributes which change, eg font size, colour etc. Could this be a problem? Would it help if I defined the font-family for each seperate tag?
    Bill Conté [Protected by Psalm 91]
    Web Mechanix
    Growing OLD is Mandatory - Growing UP is Optional!

  7. #7
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okie.
    If you are not using any tables, its alright. to leave the td and tbale from the style sheet

    I meant Neaten..sorry


    Now, for us to help you, would you care to show us the code of your page? it sure would help as form there we can work straight to the problem.

    Thanks
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  8. #8
    SitePoint Zealot thespian's Avatar
    Join Date
    Sep 2000
    Location
    South Africa
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanx lynlimz.

    I want to try a couple of ideas this evening. If any of them work I will post the result here. Otherwise I will certainly show you the code.

    By the way, I do use tables, it's just that I put the text within <p> tags within the <td> tags of the table. Maybe this is a problem?
    Bill Conté [Protected by Psalm 91]
    Web Mechanix
    Growing OLD is Mandatory - Growing UP is Optional!

  9. #9
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YESS!! definitely!
    Make saure you specify a td css style!

    let me clear some things out..
    an efficient method of setting your style sheets would be to specify all standard tags like:

    td
    table
    a

    give these tags a general style..
    so for example you have 2 td, each requiring a differnet colour.
    so i owuld do this:

    td { font-family: Verdana, Arial; font-size: 8pt; }
    td.ct1 { color: #000000; }
    td.ct2 { color: #FFFFFF; }

    with this, add class="ct1" and class="ct2" to the idividual td tags.

    These td tags will then take after the style you specified in td with all the fonts stuffs, plus their individual color tags. do you get me?

    You can also replace current specified elemtns in td {}
    example: td.ct1 { color: #000000; font-size: 10pt; }

    This will reduce the size of the style sheet, add some form of organisation, and make it more efficient.

    Generally, when you know what you're doing..like html code, css code etc., you'll know whats the problem when one surfaces...

    so try not to use wysiwyg editior ( if you are =) )
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  10. #10
    SitePoint Zealot thespian's Avatar
    Join Date
    Sep 2000
    Location
    South Africa
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanx lynlimz.

    I actually managed to sort out the problem last night. All I did was to define the font-family to all tags and all classes. Problem solved.

    Now this morning when I read you last reply, everything makes sense. Obviously Netscape does not inherit the properties of the BODY tag whereas in IE they do!

    I have noticed a few other format discrepancies and they all tie up to what i did last night and then your suggestions this morning.

    Thanx a stack. I am going to save your last paste as a guide to writing good CSS.

    I do not use a wysiwig editor for the page itself. I use the excellent Homesite by Allaire. TopStyle Lite ships with Homesite and that is what I use to create my Style Sheets.

    I have never actually "hand-coded" a style sheet (via Notepad) although that was how I started with HTML. Also, I have only used CSS for about two weeks now.

    Anyway, thanx once again for your patience and excellent advice.
    Bill Conté [Protected by Psalm 91]
    Web Mechanix
    Growing OLD is Mandatory - Growing UP is Optional!

  11. #11
    SitePoint Zealot thespian's Avatar
    Join Date
    Sep 2000
    Location
    South Africa
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh yes, lynlimz,

    One more question while we are on the subject.

    I have gotten into the habit of applying a style to a class without making it a part of a tag, for example -
    Code:
    .foot {text-align: center; color: #FFCC33;}
    Is this a bad practice or are there any dangers I should watch out for when doing this?
    Bill Conté [Protected by Psalm 91]
    Web Mechanix
    Growing OLD is Mandatory - Growing UP is Optional!

  12. #12
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, Gee..thanks
    Its an honour..I'm flattered

    Okie..hmm...
    If you are using CSS throughout your site..( not just only a few styles..but everything...=) )..I recommend you specify the tag in front.

    Here's my reason why,
    If you use style sheets intensively, you have to name the styles so that you will remember...just good practice...what if you need to open your style sheet and maek a modification..say after 6 months? surely you would have forgotten what you named your styles as!

    thats just part of the reason.
    Next comes to the point when you can't but choose to give another style the same name?

    EXAMPLE:
    you have a form in a <td>.
    within this form is some <input> tags.
    You are going to specify the styles for each.

    so you set the <td> tag:

    td.form { font-size: 10pt; font-family: Verdana, Arial; color: #000000; }

    next the input tag.
    input.form { font-size: 8pt; font-family: Arial, Verdana; color: #FFFFFF; background-color: #FFFFFF; }

    so you see, both have the name 'form'
    if you used .form,
    then there wil be a problem


    basically, its your choice. If you feel you understand it well and would like it your way, so be it. afterall, i'm not the one managing your style sheet =)


    If could just take a look at my style sheet at:
    http://nortiq.com/style.css >> IE
    http://nortiq.com/ns.css >> NS

    then load http://nortiq.com

    If you see my left navigational code for my sidebar, check out the comments. they correspond with the style sheet.

    if i remember correctly, I read from the http://www.w3.org site on the CSS1 reocmmendation, they advise users to use XX.stylename instead of .stylename
    they also discourage #stylename {}

    Well, I suggest you go to http://www.w3.org/Style/CSS/ for more information.
    read the recommendations....you could even check out CSS3 =) lol

    all the best in your site
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  13. #13
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Netscape has a cascading problem with external style sheets, tables and layers.

    If you are using tables for your layout, make a generic TD style that duplicates your BODY style with everything except the background image/color. This will allow your font's to cascade properly.
    Wayne Luke
    ------------


  14. #14
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thespian...

    An efficient way of setting up your stylesheet is to do this:
    =========
    BODY, TABLE, TR, TD, DIV, P { font-family: verdana; }
    =========
    That way you cover every block level element used on a common page. Netscape will not need to stress out over cascading and relevancy issues because you have covered it.

    As for setting up a generic "class" like you mentioned. That is the way that I do almost all of my classes. I find that this allows you to be more flexible in your design. You can take a class and apply it to any tag after that.

    Say you have this:
    =========
    //This will color anything in it black. I am using it on X, Y, and Z sections of the page
    .black { font-family: verdana; font-weight: bold; color: #000000; }
    =========

    If you set up your style that way, then you could do this:

    <p class="black">
    <span class="black">
    <td class="black">
    <div class="black">

    You get my point. As long as you comment your stylesheets like I have shown above you will be just fine.

    One additional thing. I would recommend using >SPAN> for any individual element that you want to style as it has no propeties of its own to pass on. It is merely an empty container waitign for content.

    If you use SPAN, you won't have to worry about inheritance of pesky properties like the carriage return from the DIV and the P.
    <Edited by creole on 01-23-2001 at 04:36 PM>
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  15. #15
    SitePoint Zealot thespian's Avatar
    Join Date
    Sep 2000
    Location
    South Africa
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you everyone.

    This has been a tremendous help. My sites migrate perfectly from IE to NS now.

    I will be printing this thread out so that I can use it to refer to until such time that I become proficient in the use of CSS.

    Thanx again!
    Bill Conté [Protected by Psalm 91]
    Web Mechanix
    Growing OLD is Mandatory - Growing UP is Optional!

  16. #16
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by W. Luke
    Netscape has a cascading problem with external style sheets, tables and layers.
    Do you know of a fix to netscape's padding? I just couldn't get it to work.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •