Welcome to Gaia! ::

My Design :: Web and Graphic Design [HTML CSS PHP]

Back to Guilds

XHTML, CSS, jQuery, Javascript, PHP, mySQL, MORE! 

Tags: design, graphics, html, jquery, javascript 

Reply (x)HTML & CSS
CSS Tutorial!

Quick Reply

Enter both words below, separated by a space:

Can't read the text? Click here

Submit

Hoggs
Vice Captain

PostPosted: Mon Sep 11, 2006 5:38 am


Hoggs' big crappy guide to Cascading Style Sheets


This is the first guide I've ever written, so I'm sorry if it's crap. gonk


Introduction

You should already have a decent understanding of HTML before you read this. If not, Learn it first.

What is CSS?

CSS stands for "cascading Style Sheets". It is used to define how to display HTML pages.
CSS was originally created to solve the problem of HTML styling getting VERY messy.

Here is an easy way of putting it, HTML is the building blocks to making webpages, and CSS is the pretty paint splattered over the top... to make it look pretty...


OK, lets get started.

CSS can be used on webpages in several ways:

Style Sheets can be directly used on webpages, they would normally be placed in the section of the page.

Example


Another way is to use an external Style Sheet, the link is placed in the section.

Example



Syntax:

the CSS syntax is made of three parts: a selector, a property, and a value.


selector{property:value;}


OR it can be writen on multiple lines for ease of reading:


selector
{
property: value;
}


If you want to be uber tidy with your code, then like this:


selector {
property: value;
}


How you do it is up to you.

You MUST seperate each property and value using a semi colon:


selector {
property: value;
property: value;
property: value;
}


But what do they mean? gonk

Selector:
This defines the HTML element you wish to edit, for exapmle:
If you placed "body" here, it would apply to everything between the tags.

Property:
The property is the attribute you wish to change.
eg: "font-family" means you want to change the font within the selector you chose.

value:
Defines how you want to change that property.
Simple! blaugh



Example

body {
font-family: arial;
color: #0000ff;
}


The above code would make everything between the tags to be blue arial font.


Grouping
You can use more than one selector in one block of code, you just need to seperate each selector using a comma (,).

Example

h1,h2,h3,h4,h5,h6 {
color: #0000ff;
}


In this example the code will make the text blue in all the tags

through

.

Class and ID

Ok, now we're getting a little more advanced.


ID

Every HTML tag can be given an ID (usually done with
), the selector will then be "#ID_NAME".

Example
HTML:


text here, blaa blaa blaa





CSS:

#roffle {
color: #ff0000;
}

#roffle img {
border: 2px;
}


This would give red text and an image with a 2 pixle border, notice how you can define a selector within a selector.


Classes

classes are alot like ID's exept they can be more tag specific, the selector is written as "tag.class".
If no tag is defined then it will apply to all the classes of that name.

Example
HTML:


text text, blaa blaa.


more text, lol.




This CSS will make the text inside the
blue, and the text in the

underlined.


div.roffle {
color: #0000ff;
}

p.roffle {
text-decoration: underline;
}



And this CSS will make all the text bold AND underlined.


.roffle {
color: #0000ff;
text-decoration: underline;
}



Code library

There is WAY too much code for me to list it all here, So I'm going to link you to the W3school's CSS code reference.

W3school's code reference



Thought I might add that if you are editing text in a line, use the tag, this way it will not skip to the next line, as
does.


Hi, my name is Hoggs, What's yours?






Any thoughts, additions, or questions, please post them in this thread.

Thanks for reading! 3nodding
PostPosted: Mon Sep 11, 2006 5:42 pm


Good job man!

Linkage:
http://www.webcredible.co.uk/user-friendly-resources/css/css-navigation-menu.shtml
http://www.alistapart.com/
http://bonrouge.com/~home
http://cssplay.co.uk/
http://typetester.maratz.com/
http://www.roundedcornr.com/
http://gregtaff.com/rendar2.html
http://www.quirksmode.org/css/clearing.html
http://jigsaw.w3.org/css-validator/
http://www.w3schools.com/css/default.asp

If you have any more questions ask people in this guild or use google.

z!p


Hoggs
Vice Captain

PostPosted: Mon Sep 11, 2006 9:39 pm


Thanks!
It didn't take as long as I thought it would. xD
PostPosted: Thu Nov 09, 2006 11:23 am


thats so confuzing

[Mushroomz]


Hoggs
Vice Captain

PostPosted: Fri Nov 10, 2006 12:27 pm


Updated for ease of reading. wink
PostPosted: Sat Dec 30, 2006 8:30 am


question

Yumitoko


Hoggs
Vice Captain

PostPosted: Sat Dec 30, 2006 11:35 pm


Yumitoko
question

Yes? neutral
PostPosted: Thu Apr 05, 2007 9:20 pm


thanks it helped a lot!

someboyishere2


Enchanted Sebille

PostPosted: Sat Nov 24, 2007 5:08 am


I knew it! My teacher always told me to learn html first then css coding. eek I guess thats why she is a teacher....
PostPosted: Wed Jan 20, 2010 12:50 am


im so confused....
i have no idea where to start and its starting to irritate me...
all i want to do is make a single picture backround profile that scrolls
with you as you move and slight transparency on the boxes...

Ven-kun

Reply
(x)HTML & CSS

 
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum