introduction what is css? | why use css? | learning css css code css looks like this | three places to "talk css" | learn more metas copyright | translation | contact
| what is css? |
top ↑ |
|---|---|
|
|
| why use css? |
top ↑ |
|
|---|---|---|
|
| How can i learn css? |
top ↑ |
|---|---|
|
Practice! If you have a computer with a
text editor
and a
browser,
and any css book or online
reference,
you have all you need to learn css.
|
|
| What does css code look like? |
top ↑ |
|---|---|
|
CSS code looks like this:
h2 {
color: #cc0000;
font-size: 80%;
}
This will make all level 2 headers (h2) red color, and smaller than a usual h2.
You could also use the same properties
within the html, like this:
Then only that one h2 will have the color and size.
(See the
CSS FAQ
for more about css code.)
|
| What are the three places we can "talk css language"? |
top ↑ |
|---|---|
(Type it in a file and try it out!) |
The html file: <DOCTYPE html /> <html> <head> <title> My CSS Web Page </title> </head> <body> <h2> About css </h2> <p style="text-align: center; color: #cc0000;"> CSS may seem confusing at first. </p> <p> The idea behind it is similar to html. </p> </body> </html> The web page result: About cssCSS may seem confusing at first. The idea behind it is similar to html. |
You can have many different tags defined in your style. (Type it in a file and try it out!) |
The html file: <DOCTYPE html />
<html>
<head>
<title>
My CSS Web Page
</title>
<style type="text/css">
h2 {
color: #cc0000;
font-size: 80%;
}
p {
text-align: center;
color: #cc0000;
}
</style>
</head>
<body>
<h2>
About css
</h2>
<p>
CSS may seem confusing at first.
</p>
<p>
The idea behind it is similar to html.
</p>
</body>
</html>
The web page result: About cssCSS may seem confusing at first. The idea behind it is similar to html. |
(Changes the display of all named tags on all pages on the website) (Type it in a file and try it out!) |
The html file: <DOCTYPE html />
<html>
<head>
<title>
My CSS Web Page
</title>
<link rel="stylesheet" type="text/css"
href="styles/mystyle.css" />
</head>
<body>
<h2>
About css
</h2>
<p>
CSS may seem confusing at first,
</p>
<p>
The idea behind it is similar to html.
</p>
</body>
</html>
The stylesheet file — named mystyle.css, in the folder styles:
h2 {
color: #cc0000;
font-size: 80%;
}
p {
text-align: center;
color: #cc0000;
}The web page result: About cssCSS may seem confusing at first. The idea behind it is similar to html. Yes this page looks just like the previous one — but now all pages on your website can have the same look for the level 2 header and the paragraphs. And when you want to change the design, you only have to change one file: mystyles.css |
|
And in all three places at once! |
It will take too much room to show all that here — you try it! |
| How can i learn more? |
top ↑ |
|---|---|
|
When you are comfortable with basic css:
|
|
| How long will it take? When will i be done learning CSS? |
top ↑ |
|---|---|
|
I have been learning CSS since 1998, and i am still learning it. It's like a language (because it *is* a language) — There are always new ways to put things together. Plus, the language itself improves and changes. If you want to learn a skill where you can be "finished" at some point, web development isn't the right one for you! |
|
| copyright / license |
top ↑ |
|---|---|
|
Q: Can i copy this file? Can i give to other people? Answer: Sure, you can give it to anyone, according to the terms of the license below. It is copyright © 2004 James Walker. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included here. If not found, find it at www.fsf.org - the Free Software Foundation. |
|
| translation |
top ↑ |
|---|---|
|
It would be very useful to have translations of this document in any language. Most preferred would be Tibetan and Chinese. Please contact me if you can do a translation for us. |
|
| contact |
top ↑ |
|---|---|
|
Was this helpful? Is it clear, or confusing? I would be happy to hear anything about how to make this better. You can contact me at the email address i have given you, or at http://www.webwalker.to/contact.php |
|