Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: CSS problem

  1. #1
    Member
    Join Date
    Apr 2004
    Posts
    58
    Member #
    5497
    It isn't reading my stylesheets. Simple enough.

    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <link rel="stylesheet" type="test/css" href="css/main.css" />

    It will load the 'style.css' stylesheet but it will not load the 'main.css'.

    I thought perhaps it would only load one stylesheet (I know you can load more than one but hey; it was worth a shot. So I:

    <!-- <link rel="stylesheet" type="text/css" href="css/style.css" /> -->
    <link rel="stylesheet" type="test/css" href="css/main.css" />

    Which effectively REM'd the first style. It still wouldn't load 'main.css'.

    And also, when I upload it to the server, it loads neither.

  2.  

  3. #2
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    Can we see a link?

  4. #3
    Member
    Join Date
    Apr 2004
    Posts
    58
    Member #
    5497

  5. #4
    Member
    Join Date
    Apr 2004
    Posts
    58
    Member #
    5497
    Online the situation is flipped; it loads 'mainpg.css' but not 'style.css'.

  6. #5
    Senior Member Trico's Avatar
    Join Date
    Feb 2004
    Location
    Nottingham, UK
    Posts
    894
    Member #
    5081
    type="test/css"
    You'll want to change that to "text/css". If you want to use multiple style sheets I think you have to name them; however there's a good change I could be wrong.

    IE.

    Code:
    ...<head>
    <link rel="stylesheet" type="text/css" href="css/style.css" title="default" />
    <link rel="stylesheet" type="text/css" href="css/main.css" title="main" />
    </head>...
    *Edit

    I don't know if your using SSI, which is why maybe your source code looks a little funny. On one of the pages I noticed the line that loads your external sheet wasn't in the <head> section; and others simply didn't have any <html></html> tags.

  7. #6
    Member
    Join Date
    Apr 2004
    Posts
    58
    Member #
    5497
    Okay. I had one letter mistake, thanks.

  8. #7
    Senior Member Maverick's Avatar
    Join Date
    Sep 2003
    Location
    Hoboken, NJ
    Posts
    351
    Member #
    3253
    A note about using html comments:

    usually you don't want to use the < or > characters inside of a comment statement. The reason being, it sometimes causes browsers to interpret your code a little screwy. So instead of "commenting out" some html code, just cut it completely from the file and paste it in notepad or something for safe keeping while you are testing.
    www.stevenspoker.com
    "You can't lose what you don't put in the middle, ... but you can't win much either." -Mike McDermott (Rounders)

  9. #8
    Senior Member
    Join Date
    Dec 2003
    Posts
    1,274
    Member #
    4362
    Yes, true, like the same way you comment the @import to hide it from old browsers, but maybe new browsers display it and mess it up.
    In CSS anyhow you can comment safely

  10. #9
    Member Karen Harwood's Avatar
    Join Date
    Mar 2004
    Location
    Bellevue, Washington
    Posts
    54
    Member #
    5388
    It might not be a problem with not loading both style sheets. It might have more to do with how css uses inheritance to apply styles or resolve style conflicts.

    In the course of creating the style sheets it is possible that many different rules will apply to a singe element. There are cases where inheritance will cause both rules to be applied. If there are no conflicts between the styles, they are joined together without any trouble. However, if there is a conflict of rules, some of the styles may be over ruled by another style.

    You might also want to look into a program called Topstyle Pro. This is a great CSS building tool and it will tell you which browsers support what. The Topstyle Pro also has some test files that will help you to learn good design from poor design.

    As far as reference books take a look at Cascading Style Sheets 2.0 by Eric A. Meyer. This book will give you all the information you need. It includes a browser compatibility chart plus a whole lot more.

  11. #10
    Member
    Join Date
    Apr 2004
    Posts
    58
    Member #
    5497
    Thank you, Karen, but the problem was I accidentally had the type as "test/css".


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:43 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com