Beginner's Guide To CSS
Beginner's Guide To CSS
Learn what CSS is, and how it's used in web design. This film teaches you the very basics to give you a firm foundation to work from
CSS stands for “Cascading Style Sheets”. It's a way of ordering web files nicely so everything looks pretty. VideoJug.com uses css, so when you're watching “VideoJug's How to Make your Breasts look Bigger”, that's css doing all the clever organising in your peripheries.
If you've got a ‘style.css' file, you can set up ‘rules' for your other website documents.
For example you could, if you wanted, say “Everything with the tag
A .css file tends to go in the same directory as your other website files. In order for your other files to know it's there, and that they should be paying attention to it, you add this code into the
Your webpages will now pick up on all the info in your css file and use it accordingly.
Where hmtl has tags to define behaviour, your .css file has ‘selectors'.
‘Body' therefore is a selector, and any style settings we define within those two curly braces will apply throughout the site.
Each of these bits of code needs a semi colon at the end to mark the end of the line... Let's look at some of the things we could use.
This sets the font to Verdana, the classiest of all fonts. It's better to have a list, here, in case people don't have Verdana --the classiest of all fonts—installed. You can do that with commas:
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
That way if it can't find Verdana, it'll move on to the next one, and the next one, and so on, until it finds something it knows.
Sets the font size. The bigger the number, the bigger the font.
You can also use .em, which is a bit more complicated. Instead of picking the size by pixels, it's done by space, so depending on the resolution your viewer's viewing your site in, it'll look right.
Makes it bold. ‘None' makes it normal. You could also use numbers between 100 and 900, which set relative thickness of the font.
Sets the colour. You could use text for simple colours, like white or black or fuchsia. You can also use Hex codes, here. Hex is a string of numbers and letters which represent a colour. #000000 is black, and #FFFFFF is white. All the colours inbetween are represented by some sort of similar code – VideoJug yellow, for example, is #FFE502.
You can also set the background colour with:
or use Hex, as discussed before.
There's more to put in there, here's some for starters:
Letter-spacing: is the distance in pixels between your letters
Word-spacing: is the distance in pixels between your words
Text-align: which can be left, right, center or justify
Padding: how much of a buffer there is around your stuff
Margin: what the margins are like.
Those are the absolute basics. Here's how it's all put together:
font-family: arial, helvetica, sans-serif;
background-color: #ffffff; margin: 1em;
Then in your .html file:
VideoJug version 1.138
Hello, and welcome to VideoJug.
We make brilliant, brilliant films.
Especially the ones about code!
- Just because the guys up the other end of the office are working on “How to ma