Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jan 2006
    Location
    Manchester, UK
    Posts
    233
    Tokens
    0

    Default Huge Introduction To CSS

    Hello.

    This is my second tutorial and as I can't sleep i've decided to write this one about CSS ( Cascading Style Sheets )

    CSS has both advantages and disadvantages. I've listed them below.

    Advangtages:

    • Good for layouts
    • Better loading time
    • Edit one page for all pages
    Disadvantages

    • Older browsers don't accept CSS sometimes.
    This tutorial is Copyright to me and if you wish to use it please contact me.

    To begin CSS there are a few ways to write it into your webpages. They are all nested withing the <head></head> tags.

    The best way is:

    Code:
    <link rel="stylesheet" type="text/css" href="URL to .CSS file" />
    This is the external stylesheet so your index code is clean and easier and also you can edit your whole site with just one page.

    You start of with the basic codes and it gets easier for example the first code I always include in my CSS page is the page background and font settings:

    Code:
    
    body{
      background-color: red/green/blue/black;
    margin: marginsizepx;
    font-size: fontsizepx;
    color: green/purple/pink/black;
    }
    


    The value is pretty important in these, here is a list of the values:

    • pixels
    • percent
    • inches
    • centimetres
    • Millimetres
    There may be more but I won't go into detail.

    Now there are classes and ID's and I tend to use ID's more as i'm into CSS layouts. Here is an example of both.

    Code:
    .navigation{
    color: #colour;
    font-family: 'font';
    font-size: sizepx;
    }
    


    Then you can link to the classes in both HTML and CSS

    Code:
    <td class="navigation"></td>
    <div class="navigation"></div>
    It's actually really basic to do this now onto ID's which I use more.

    Code:
     #navigation{
    width: 550px;
    background-color: red;
    }


    I just used some basic properties so you get the jist of the idea. Now you link to it in your index.php

    Code:
    <div id="navigation"></div>
    In CSS, pseudo classes are used to add different styles to selectors.

    Here is an example:

    Code:
    a:link{ color: white;}  Unvisited link
    a:visited{ color: black; } visited link
    a:hover{ color: pink;} mouse hovered on link
    a:active{ color: green;} color while clicked.


    This is the most used in the pseudo classes.

    These are just more examples of what you can do in CSS

    Code:
     p{
    color: black;
    }
    
    p:first-line{
    color: red;
    }


    And then the font size.

    Code:
     p{
    font-size: 12px;
    }
    
    p:font-letter{
    font-size: 10px;
    }


    Again i've used random values so you get the jist.

    Some basic codes for your everyday needs in CSS are:

    Code:
    body{
    background-color: #FFFFFF;
    }
    This is setting the background colour and now to set the background image code is:

    Code:
    body{
    background-image: url(image.gif);
    }
    Then there are things you can add onto the background image like no repeat

    Code:
    background-repeat: repeat-x/y;


    This is it for the whole introduction I may be posting a more advanced CSS tutorial and also other advanced things such as a massive layout tutorial using just XHTML/CSS

    Thanks
    Dan


    Last edited by Oracle:; 30-01-2006 at 04:14 AM.

  2. #2
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    For a huge one i was kinda exspecting more than a 15 second overview of some of its most basic consepts "/

  3. #3
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    -****ing lagged server, i have about 8 of every post i was makeing "/ -
    Last edited by Mentor; 30-01-2006 at 09:00 PM.

  4. #4
    Coding4Newbs Guest

    Default

    Quote Originally Posted by 01101101entor
    -****ing lagged server, i have about 8 of every post i was makeing "/ -
    Lmao carl,

    Css is so easy i didnt even study it and i learnt it without 1 tutorial mwhahahaha, but this is good for newbies good try

  5. #5
    Join Date
    Jan 2006
    Location
    Manchester, UK
    Posts
    233
    Tokens
    0

    Default

    Hello.

    Sorry again if I mis used the concept 'Huge' it's merely a relevent tutorial of basic concepts into the CSS language.

    It seems that people aren't too thankful here but oh well. I try my best

    Thanks
    Dan

  6. #6
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    I pretty much worked out css "/ just looking at abit of basic code

  7. #7
    Join Date
    Jan 2006
    Location
    Denton | UK
    Posts
    213
    Tokens
    0

    Default

    Hey,

    Agreed. I've seen far better tutorials than that.

    - Dan

    Quote Originally Posted by Splinter
    I pretty much worked out css "/ just looking at abit of basic code

  8. #8
    Join Date
    Nov 2004
    Location
    Daventry, Northants
    Posts
    1,510
    Tokens
    0

    Latest Awards:

    Default

    This made me smile
    Older browsers don't accept CSS sometimes.
    CSS Has been around since your were about 4 so i wouldnt bet on thhat

  9. #9
    Join Date
    Jan 2006
    Posts
    42
    Tokens
    0

    Default

    Quote Originally Posted by Anderman
    This made me smile


    CSS Has been around since your were about 4 so i wouldnt bet on thhat
    Style sheets have been around since the begining of SGML.

  10. #10
    Join Date
    Jan 2006
    Location
    Bedfordshire
    Posts
    37
    Tokens
    0

    Default

    Good Tutorial if your a begginer. If it was one year back I would be looking all over forums for that kinda stuff. I don't believe its simple, just right for a begginer. If the begginer wants to go further, then they can go and look for codes on other places of the web

    - Oli
    :eusa_danc Oli
    Owner of Bobble FM

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •