Learn the basics of CSS part 1

Status
Not open for further replies.

RyanMK

Still alive
May 27, 2010
802
117
Hey there DevBest, today I'm going to show you how to get started with CSS. CSS is a web coding language that styles aspects of a website, for example DIV tags, Forms, Text and background. CSS can be implemented in either of two ways, 1. being writing it within the HTML page you wish to style 2. writing it in an external file known as a stylesheet which is then linked into the HTML page via a short code. Today I will show you how to do it the first way and then explain external style sheets in my second tutorial.

The tags you insert between the <head> tags:
HTML:
<style type="text/css">
</style>

Now you're ready to code CSS. To create a style using CSS you type this below:
HTML:
.name  {
}

Within the curley brackets you can start adding attributes such as styling text, adding a border, setting a size for use with div tags and much more. Below is a few examples of what attributes you could add.

font-family: verdana; This sets the font you wish to use. The values after the normal colon you can change

height: 100px; (and) width: 100px; This sets the height and width of a div tag in pixels (similar to photoshop)

font-size: 12px; font-weight: bold; color: #000; These attributes are for editing how the font looks (similar to word) for adding color, changing size and adding bold to the text.

background-color: #CCC; This is for adding a background to to a div tag the #CCC is the hex code for the color light grey.



In the next tutorial I will be covering more complex features such as adding a curve to the border, adding padding and margins, using an image as the background and of course using external CSS to keep your source code short.

I would like to have written more but thought it best to keep it short and not send you all of to sleep!
 

Kieren

The OGz
Aug 4, 2010
2,957
751
Good tutorial Ry, sure could help some lost members on the forums. Me like it a LOT! >:)

Don´t forget to add some examples so that it´s more easier because if they´re like me (LEFTY) picture tutorials are best.
 

RyanMK

Still alive
May 27, 2010
802
117
I'll add some pics when I'm next at a computer, mate :p

Typed all that on an iPhone :L
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
Nice tutorial. Laid out well and very understandable.
 

RyanMK

Still alive
May 27, 2010
802
117
Thanks, Mark. I'll try to post part 2 later on, and add images for both tutorials
 

LMFAO

New Member
May 5, 2011
20
0
Though that it is a Really simpel one, is this a very good tutorial i Hope to see more of these.
 
Status
Not open for further replies.

Users who are viewing this thread

Top