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.

Results 1 to 7 of 7

Thread: is

  1. #1
    Junior Member
    Join Date
    Mar 2005
    Posts
    15
    Member #
    9467
    When I first learned CSS a few yrs ago I read that stylesheets should start like this:

    <style type="text/css">
    <!--

    and end..

    --/>
    </style>

    Is that still correct or is the <!-- and --/> outdated and/or no longer needed?

    itspersonal5

  2.  

  3. #2
    Senior Member Jack000's Avatar
    Join Date
    Aug 2004
    Posts
    250
    Member #
    7173
    I believe the html comments are to hide the styles from older browsers that don't understand them.

    I don't think it's important anymore. You really shouldn't be using embedded css anyways

  4. #3
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    Quote Originally Posted by Jack000
    I believe the html comments are to hide the styles from older browsers that don't understand them.

    I don't think it's important anymore. You really shouldn't be using embedded css anyways

    Yes this is for older browsers and really does not apply unless you need to accomodate them.

    However I it is a perfectly valid way to apply css. Remember CSS stands for CASCADING style sheets and cascading means there is a hiarchy involved and certin ways of applying css take precedence over others. For instance, embedding css in the head takes precedence over linked style sheets.


  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    If it validates then I don't see any problem with it, although if it's in the <head> tag as it should, it would be ignored by unsupported browsers anyway by HTML's design, unlike if it was within the <body> tag.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Junior Member
    Join Date
    Jun 2005
    Location
    Vancouver, WA
    Posts
    15
    Member #
    10253
    If you're using XHTML, this is how to do embedded stylesheets (according to various sources):

    Code:
    <style type="text/css">
    /* <![CDATA[ */
    
    ..CSS here..
    
    /* ]]> */
    </style>

  7. #6
    Senior Member hyperair's Avatar
    Join Date
    May 2005
    Posts
    452
    Member #
    9892
    there is nothing wrong with embedded stylesheets in my opinion, so not to worry. although most browsers already support css, ther are some that totally dont support css such as portable devices like handphones and webtv and stuff lidat.
    Hyperair

  8. #7
    Senior Member Jack000's Avatar
    Join Date
    Aug 2004
    Posts
    250
    Member #
    7173
    embedded style sheets should only be used for page-specific values. Use an external style sheet whenever it's appropriate. Use of embedded style sheets as substitute for external style sheets have the same problem as font tags, changes have to be applied one page at a time.


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 02:41 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com