PDA

View Full Version : CSS - Beginners Guide (2nd Shot)



Sketti
24-03-2005, 08:43 AM
Right I'm giving the CSS tutorial a second shot as I now know how to use CSS.

If it's just a small bit of CSS, firstly, you'll probably want to put it in the style tags:

<style>
Style Rules Here
</style>

But if it's a reasonably large bit of CSS, you'll need to make a .css file and you'll need to link it t you main page of couse by utting this in your <head> secton:

<link rel=STYLESHEET href="css.css">

Now onto the style rules.

Let's start with fonts. Inside the .css file or the <style></style> tags you'll need a section called body. Examine:

<style>
body {
Style Rules Here
}
</style>

And for different fonts you'll want this: font-family:FONTNAMEHERE; put in like this:

<style>
body {
font-family: Verdana;
}
</style>

Font size:

<style>
body {
font-family: Verdana;
font-size: 11pt;
}
</style>

font-color isn't a valid CSS code so after a couple font codes just put:

<style>
body {
font-family: Verdana;
font-size: 11pt;
color: #FFFFFF;
}
</style>

Also for bold, italic etc. you'll need different tags.
font-weight:bold; or you can have bolder, lighter or any number I think it's between 100 and 900.

font-style:italic; or you can have oblique or none. I haven't noticed any difference between italic and oblique but I think they're for different browsers.

For links you can have 4 different types:

A:link - standard, unclicked link.
A:hover - what happens to it when the mouse hovers over it.
A:active - an active link. It becomes active after being clicked.
A:visited - a visited link.

What many people do with the A:hover tag is they make it underlined and overlined. For both rules use this:
text-decoration:underline overline;
then continue.

Also you may have noticed that some sites have a different cursor. There are 25 different cursors (23 of which work for me so I won't mention the ones that don't work for me).

cursor: default;
cursor: crosshair;
cursor: hand;
cursor: pointer;
cursor: move;
cursor: text;
cursor: wait;
cursor: help;
cursor: n-resize;
cursor: ne-resize;
cursor: e-resize;
cursor: se-resize;
cursor: s-resize;
cursor: sw-resize;
cursor: w-resize;
cursor: nw-resize;
cursor: progress;
cursor: not-allowed;
cursor: no-drop;
cursor: vertical-text;
cursor: all-scroll;
cursor: col-resize;
cursor: row-resize;

That's some simple CSS for you. For more in depth CSS (and images for the cursors) go to Echo Echo (http://www.echoecho.com/css.htm)

splintercell!
24-03-2005, 08:49 AM
:O Post it now eh! I just had to work It all out for myself :D

ignitionhost
24-03-2005, 09:21 AM
Nice guide, if it's popular enough, it may be pinned ;)
I think it should anyway ;)

Sketti
24-03-2005, 12:47 PM
Thanks. I was gonna put the cursor images in but it said there were too many of thwm. :(

-JT-
24-03-2005, 04:24 PM
Okay, it looks like alot of effort has went into this so i will pinn it :) Well done.

Sketti
24-03-2005, 05:44 PM
Thanks <James> and sorry Splinter. I've been practicing other stuff lately and I just thought I'd rewrite it now.

-JT-
24-03-2005, 06:06 PM
np mans!!!

splintercell!
24-03-2005, 09:49 PM
Lol one thing :P Olny stupid but you didnt close the <script> tags and stupid peole woudnt know this :D

Sketti
25-03-2005, 07:52 AM
Olny stupid but you didnt close the <script> tags
The script tags?

jamie5k
25-03-2005, 08:49 AM
splinter this isnt a script its a style he has the <style> tags not scripts.

Sketti
25-03-2005, 12:04 PM
I saw what he was on about and I've fixed it now.

:Blob
25-03-2005, 12:07 PM
Nice :D Thats my problems answereed

:Blob
25-03-2005, 12:07 PM
DAMN! Sorry the admin said i ant allowed 2 post for a nother 10 secs thwn i put it in a it kinda like did 2 posts som1 delete this post

Baulege
25-03-2005, 12:09 PM
Most of this, infact all can be found on:

http://www.w3schools.com

Not only CSS, but HTML, JAVASCRIPT, XML etc. Can be found and studied on this website!

Sketti
25-03-2005, 12:20 PM
Well you'd kinda expect that since W3 invented HTML.

Baulege
25-03-2005, 12:26 PM
Well you'd kinda expect that since W3 invented HTML.

I was just saying that if they wish to receive further information they should visit that website...

Mentor
25-03-2005, 02:56 PM
i dont think w3 invnted html, they were just brought in to standadise it, becuse different browsers used to display html compleatly differently, making cross copatbible pages nearly immpossible. At the moment IE is the only major browser that still isnt useing proper html (as w3 defines it) athogh its still close enogh to make cross copatible pages reasonbly easy to achive.
As far as i know

Ie, runs inproper html
Firefox runs, Proper html, and inmporer html in quirks mode (netscape i think does the same)
opra, only runs proper html
and mac and unix browsers i dont have a clue about

splintercell!
25-03-2005, 03:01 PM
Lol I meant the style tags by the way :P

Sketti
25-03-2005, 06:02 PM
I know splinter

Dan Williamson
28-06-2005, 10:23 PM
Not A Bad Css Tutorial But Why Do People Threat Theres One Hard Language To Learn PHP urgh Took Me Like 4 Weeks To Learn It.

Mentor
29-06-2005, 12:51 AM
Not A Bad Css Tutorial But Why Do People Threat Theres One Hard Language To Learn PHP urgh Took Me Like 4 Weeks To Learn It.
php isnt hard lol, get a few simple consepts down and its easy as pie (Well actaly easyer sinse i dont know how to make pie "/)

anyway its more of a cheet sheet, rather than a tutorial imo. as it doesnt actaly explain how any of it works or what its doing, nore the class system, or its purpos?
for exmplae how it can apply to both eliments of predefine html, or you can define your own html eliments, by adding a . previos, nore a list of tags you can attach for diffent fucntions, colour bkg, poristion, sizeing etc etc.

i may write one on this thinking about it "/

ED::
03-07-2005, 08:42 PM
what is css

Recomendz
17-07-2005, 03:46 PM
i still dont get it sos :S can anyone help?

Want to hide these adverts? Register an account for free!