Asking about CSS

Discussion in 'CSS' started by Corazon, Oct 21, 2006.

  1. #1
    Is there anyone there know how to transfer css code finto external file without having the problem of changing background color and text style?
     
    Corazon, Oct 21, 2006 IP
  2. intoex

    intoex Peon

    Messages:
    414
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <link rel=stylesheet type=text/css href=style.css>
    ?
     
    intoex, Oct 21, 2006 IP
  3. chewbacca

    chewbacca Peon

    Messages:
    132
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    To make that valid:
    <link rel="stylesheet" type="text/css" href="style.css">
    Code (markup):
    Alternatively, you can use <style> and @import:
    <style type="text/css">@import 'style.css';</style>
    Code (markup):
     
    chewbacca, Oct 21, 2006 IP
  4. unitechy

    unitechy Peon

    Messages:
    350
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Is is preferable to include css on other other or within the main index file
     
    unitechy, Oct 22, 2006 IP
  5. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This sounds very odd to me; if such strange things happen, I would check the validity of your markup and CSS using the W3C validators.

    http://validator.w3.org/
    http://jigsaw.w3.org/css-validator/

    Link tag is preferable to @import: it's more meaningful and allows you to specify media, which you should be doing:
    <link rel="stylesheet" media="screen, projection" type="text/css" href="screen.css" />
    <link rel="stylesheet" media="print" type="text/css" href="print.css" />
    
    HTML:
    Remove / for HTML.
     
    penagate, Oct 22, 2006 IP
  6. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #6
    You got to do that on all pages where you want to use the style sheet.
    Hope I understood you right...

     
    JEET, Oct 22, 2006 IP
  7. Corazon

    Corazon Banned

    Messages:
    190
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks to you guyz. I will try the code you've posted. Thanks
     
    Corazon, Oct 24, 2006 IP
  8. Ronal

    Ronal Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    That's an acronym that means Cascading Style Sheets. CSS allows web designers to attache styles (fonts, colors, size, margins, etc.) to HTML documents. It works like a template allowing web developers to define a style for an HTML element and then apply it to as many web pages as they want/need. We can also use styles to display different elements for different media (screen, printers). It simplifies web site maintenance and also helps the way a page displays content for Search Engine robots on the Internet (and that's a good thing!).

    Regards
     
    Ronal, Oct 26, 2006 IP