can a single page have more than one CSS ?

Discussion in 'CSS' started by salim, Jan 15, 2009.

  1. #1
    Hi,
    I am still learning CSS, now I am practising and wondering if one single page can have more than one CSS to it, or is the ruleo f thumb to use only one
     
    salim, Jan 15, 2009 IP
  2. cryptic1001

    cryptic1001 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can have more then one CSS page but the Rule of thumb would be just to have one.
     
    cryptic1001, Jan 15, 2009 IP
  3. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well my rule of thumb is to use multiple,
    because i tend to categorize the styles depending on where they are used..

    so i usually have one that holds the styles for the general layout (which i include in all pages),
    and then additional files for specific styles of each section of my sites (that are only included in those sections..)..
     
    gnp, Jan 15, 2009 IP
  4. infernaliuns

    infernaliuns Active Member

    Messages:
    121
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #4
    There's so many Worpress or Joomla template that have more than one CSS, I think that you can have how many CSS u want, there's no problem.

    The same for the Javascripts (.js)
     
    infernaliuns, Jan 15, 2009 IP
  5. cryptic1001

    cryptic1001 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Well, I guess you can but why wouldn't you just have one and categorize them all in the same one.
     
    cryptic1001, Jan 15, 2009 IP
  6. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Trying to be as lightweight as possible ... ;)

    (i mentioned that i do not load all files in all pages of the site, they get loaded if they are required in each section..)
     
    gnp, Jan 15, 2009 IP
  7. rjd22

    rjd22 Peon

    Messages:
    63
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I think the best way is to split the css on design types. Like modules. Since searching a 10 MB file for 1 line is too much of a hassle then you can categorize them.
     
    rjd22, Jan 15, 2009 IP
  8. 007c

    007c Peon

    Messages:
    611
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yea when using cms type of pages it's better to categorize. One for header one for footer one for the content (commented would be best) . Not per page css making the browser load a new sheet at each page nav is useless...
     
    007c, Jan 16, 2009 IP
  9. wobmop

    wobmop Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I would personally just reccommend limiting yourself to just one CSS document. This is because you will be able to rank better in search engines making for better search optimisation. The only time I've ever used two CSS files is one for standard browsers (IE7, FX, Chrome etc) and one for IE5+ fixes.
     
    wobmop, Jan 20, 2009 IP
  10. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Of course, you can have multiple css files for a single page .

    One of the ways to import css file within another css file is like this .
    @import (css/style.css)

    You can even have the css file with .php extension, however you have to declare the content type .
     
    justinlorder, Jan 20, 2009 IP