• Game Rebels: The site that rewards you for posting
  • Join The Awesome ARK Server!

    Island PVE (Official Rates x2) by Vurh.Club
    Join ARK Server! Join ARK Discord!
  • The Game Shop V2!

    A Complete revamp! Hundreds of FREE games, now available!
    Shop Now!
  • Game Rebels Community

    Welcome to this awesome gaming forum
    Register Now
  • Earn Points to Buy Games!

    The more you post, the more you earn
    Learn More

How to import a CSS Stylesheet into an HTML File

Discussion in 'Coding Tutorials' started by Burned Designs, May 8, 2013.

  1. Burned Designs

    Burned Designs New Member

    43
    0.11
    13
    To import a CSS Stylesheet your first going to need to know how to work with CSS and HTML.

    CSS : Cascading Style Sheets
    HTML : Hyper Text Mark-up Language

    Import Code:
    Code:
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
    
    How CSS Looks
    Code:
    .text{
    color:black;
    font-size:12px;
    text-decoration:none;
    }
    
    How the HTML would look after CSS is imported
    Code:
    <html>
    <head>
    <title>title of site</title>
    </head>
    <body>
    <div class="text">
    This is the text with the style of the CSS
    </div>
    </body>
    </html>
    
     
  2. Ace

    Ace Member

    420
    0.15
    33
    Right, i'm a complete n00b. How am I supposed to know <div class="text"> defines .text in the CSS? This isn't very n00b friendly, you made a HTML page, you should create more n00b friendly tutorials. :)
     
  3. Lawson.

    Lawson. New Member

    143
    0.11
    23
    Nice TuT Designs :D
     
  4. Piracy

    Piracy Guest

    Couple things, 1, you forgot to end the link tag, it's a single tag only so you would put
    Code:
    <link rel='stylesheet' type='text/css' href='stylesheet.css' />
    You also forgot to include it in the HTML file, just saying.


     
  5. Toxique

    Toxique Well-Known Member

    3,910
    1.33
    170
    Nice to see some tutorials being posted, we need more of these here :)
     
  6. overcast

    overcast Member

    518
    131.38
    25
    Thanks for the pointer. When it comes to making single page design, I usually go with the internal stylesheet. I have saved a lot of time and money this way. You can also use the external stylesheet hosted on the CDN. That reduces the loading time too. I know some people make use of the bootstrap stylesheet from the CDN.