Hello!And welcome to my tutorial. This tutorial is a pretty extensive guide to CSS, and it's still being edited and improved upon, so if you have any suggestions then go ahead and neomail me! Anyways, before you jump into my little guide here, there are some ground rules you should be aware of.
1. You need to have a fairly in-depth understanding of HTML. If not, I suggest brushing up on your HTML skills.
2. I'm wordy. If you hate reading, go watch tv or something.
3. This tutorial is meant to be read through. That means that sections which appear later in the tutorial assumes you have read through earlier sections already. Obviously, you might not have done that, but if I start talking about classes and IDs and you haven't read either of those sections and you're clueless, then you might want to go back.
Now that that's out of the way, I hope you learn something new today!
next section
11.21 I have a new affiliate, Caelum, a premade page and also a guild, as it turns out. She has some excellent premade pages, so her site is definitely worth checking out. I also got listed in another directory, The Neopian Directory. Nice, simple, straightforward. Good stuff. Also listed in another promising directory, Paper Thin! Very cute, and very promising.
10.07 Grr, Neopets' code filter is really starting to bust my bubble. It's getting a little too unreasonably impossible to make decent coding now and it's making me use really nasty inline styles to get around it. But on a happier note, I am Converse Allstarz Site of the week! Hooplah! I've also been listed in Landslide, a directory dedicated to all things CSS! Check both those directories out, because they are super helpful.
09.05 Received an award from Converse AllStarz Directory for being Leena's affiliate! I added it to the contact me page, because there wasn't much on that page to begin with.
08.30 Added a new affiliate, Visions! It's a really great site about how to make a petpage site. You should check it out if you're interested. I also dedicated an entire section to z-indices since lots of people have been asking questions about that. Woohoo!
07.27 Alright, just to make it official, I'm going to be taking a hiatus from this site. Don't freak out; I'll still be on neopets semi-regularly to check neomail and such, so don't hesitate if you have a question or want to become affiliates. But I'm not going to be working on this page until...well, I don't know when. If you have any suggestions for future sections, let me know! In the meantime, check out my affiliates!
06.20 Look! New layout! I promised it would happen, did I not? I finally figured out what the problem was. I had added a new section that, to make a long story short, was messing up my beautifully constructed code, haha. Anyways, hoping to impress more people with this new stylish layout, get more affiliates, listed in more directories, the whole shebang. ^^ I also cleaned out affiliates who had secretly removed my link from their site or led to deleted pages. Somewhat.
06.17 I'm back! These last few weeks have been really busy, and I was out of town for one of them too. To start things off, I have two new affiliates and a new layout coming soon! Hopefully by...sometime this week, haha.
05.25 Got listed in another wonderful directory, Miss Leah's Lovely Links. I'm thinking about opening a premades site, but first I have to actually make some usable premades. If you have any suggestions, please neomail me! I'm mostly thinking in asbtract concepts, like color schemes or layout styles, not necessarily "I want Harry Potter!" I also can't wait until I can really start getting the word out about this tutorial. I'm an optimist nowadays.
back |
next section
In order to understand CSS, you have to have a basic understanding of HTML. Why? Because CSS defines HTML properties. You see, for those who don't already know, HTML
uses various codes to create "content." There are codes that create paragraphs, codes that create tables, etc. CSS simply takes these various codes and "defines" them; it gives them attributes and changes their colors and sizes, and then whenever you wish to use a table, instead of retyping all of those tiresome individual codes, you can just use CSS to modify everything for you everytime you use it in your content! This keeps your page nice and neat, and instead of having to go and search through your content to alter your code, you can just go to the CSS and alter that, and voila! your page is now complying with the new CSS.
Why would anyone use CSS? The answer is that CSS allows web designers and other such kinds of people to keep their coding separate from their content. You see, we define content as the part you actually want people to see and read. All of the words and examples in this tutorial is content. In HTML, if you wanted to make your content pretty, you'd have to use lengthy codes and you'd have to repeat them, and if you ever wanted to change them you'd have to go through all your content...it's a hassle. HTML coders know. That's why we have CSS! Yay!
back |
home|
next section
I just realized I never defined CSS. I'm such a silly goose. CSS stands for
Cascading Style Sheets.
Cascading: Your webpage follows a list of
cascading-ranked in order- styles it will follow. The first and least important one is the web browser's default web sheet style. We all know how cute THAT is. *sarcasm* This style can be overriden with an
external style sheet, which uses a .css extension and can be applied to multiple pages at a time. An
internal style sheet can override the external, which is the type of style sheet you'll use to code on neopets.
Inline style is the most important, so it overrides any previous style. Inline styles generate messy codes, however, so try to avoid them. Besides, anything you do with an inline style can be done in an internal or external style sheet.
Style: In the introduction, I mentioned that CSS defines HTML. Well, it's giving it a style-that is, what it defines about the HTML is borders, backgrounds, fonts, etc. Various html codes get styles. These styles are made up of three parts: the selectors, the properties, and the values. Here's the breakdown
continue
Continued
selector {property:value}
When you want to combine multiple selectors, use this:
selector1, selector 2 {property:value}
To do multiple properties, you can do this:
selector {property1:value; property2:value}
Example:
td {color:000000}
Note that the selectors are separated by commas and the properties by semi-colons. The example would make the font in all of your tables black.
Sheet:Almost self-explanatory. It's a metaphorical sheet of coding. Specifically, awesome CSS coding. :P All your coding will go in-between the style tags.
back |
home |
next section
Sometimes we want to have two or more styles for any given selector. For example, there are two styles of links on this page: the ones that are here in the content that say 'home' and the ones in the navigation menu. But if you only have one selector, how could you possible have two styles?
The answer is classes. Classes are preceded by a period and are meant to be used more than once on a page. I have two classes of links. In your CSS classes will look like this:
selector.class1 {property:value}
selector.class2 {property:value}
Then, in my HTML code, I specify which class I want by adding it like so
You can name the class whatever you want, as long as you keep track of what they are called. Note that when naming the class in the HTML code there is no period.
Classes don't always need a selector in front of it. (Some properties overlap and can apply to various selectors. In this case, simply writing .class {property:value} will work to apply the same effect to a table, div layer, etc.)
back |
home |
next section
IDs are used only once in your coding. The # symbol comes before naming an ID. The only real difference between classes and IDs is that IDs are meant to be used once and only once. If you try to use an ID like a class and use it more than once, your coding will mess up and your page will end up looking pretty weird, not exaggerating. IDs do not have a selector name in front of it.
Other than that IDs work the same as classes. You list all the properties and values in { } brackets. Here is an example of what it looks like in CSS and how to apply the id in HTML.