How to call upon css(divs)

Discussion in 'Member Articles & Tutorials' started by NBK*Twitch, Feb 28, 2010.

  1. NBK*Twitch

    NBK*Twitch Regular Member

    Joined:
    Dec 17, 2009
    Messages:
    235
    Likes Received:
    0
    Well divs are more and more common. So I am gonna show you a simple way to use them.

    <html>
    <head>
    <title> Test </title>
    </head>
    <body>
    </body>
    </html>

    Okay now you have the basic setup. Now to add the css.

    <html>
    <head>
    <title> Test </title>
    <style type="text/css">
    body {
    color: black; background: white;
    }

    .container {
    width: 988px;
    background: #ffffff;
    {
    </style>
    </head>
    <body>
    </body>
    </html>

    Now we have a basic css setup. The body and a container. Now we need to get the container to show. So this is where divs come in.


    <html>
    <head>
    <title> Test </title>
    <style type="text/css">
    body {
    color: black; background: white;
    }

    .container {
    width: 988px;
    background: #ffffff;
    {
    </style>
    </head>
    <body>
    <div class="container"> test </div>
    </body>
    </html>

    Now with the above you will have an area with 988px width and a white background.

    So there you have it how to call css with divs.
     
  2. Lukas

    Lukas Regular Member

    Joined:
    Mar 2, 2010
    Messages:
    17
    Likes Received:
    0
    If your going to teach someone how to do this, would it not be better to teach them more effectively, and have them create the CSS in a separate file, which they call upon, then use the <div id="name"></div>?
     
  3. NBK*Twitch

    NBK*Twitch Regular Member

    Joined:
    Dec 17, 2009
    Messages:
    235
    Likes Received:
    0
    Well I could have done that,but it was just a quick tutorial. Besides if you are going to have more then one page you need to have a separate css.
     
  4. Lukas

    Lukas Regular Member

    Joined:
    Mar 2, 2010
    Messages:
    17
    Likes Received:
    0
    Exactly. It's a good tutorial, I was just saying.
    I know all the sites I have made are multiple files.
     
  5. NBK*Twitch

    NBK*Twitch Regular Member

    Joined:
    Dec 17, 2009
    Messages:
    235
    Likes Received:
    0
    I guess I will edit it later for multipage use :).
     
  6. Lukas

    Lukas Regular Member

    Joined:
    Mar 2, 2010
    Messages:
    17
    Likes Received:
    0
    Or make a new one.
    Maybe I'll even make one. :)
     
  7. NBK*Twitch

    NBK*Twitch Regular Member

    Joined:
    Dec 17, 2009
    Messages:
    235
    Likes Received:
    0
    You should make one :).
     
Similar Threads
Loading...

Share This Page