Home › Forums › Great Computer Tips And Tricks › What is??? How to??? › CSS Introduction
- This topic has 1 reply, 2 voices, and was last updated 7 years, 7 months ago by
Mitz.
-
AuthorPosts
-
January 6, 2010 at 7:12 am #28941
247time
ParticipantWhat is CSS? - CSS stands for Cascading Style Sheets - Styles were added to HTML 4.0 to solve a problem - Styles define how to display HTML elements - External Style Sheets can save a lot of work - External Style Sheets are stored in CSS files
July 18, 2013 at 3:39 am #32882Mitz
Keymasterfont-familyThis is the font itself, such as Times New Roman, Arial, or Verdana.The user’s browser has to be able to find the font you specify, which, in most cases, means it needs to be on their computer so there is little point in using obscure fonts that are only sitting on your computer. There are a select few “safe†fonts (the most commonly used are Arial, Verdana and Times New Roman), but you can specify more than one font, separated by commas. The purpose of this is that if the user does not have the first font you specify, the browser will go through the list until it finds one it does have. This is useful because different computers sometimes have different fonts installed. So font-family: arial, helvetica, serif, will look for the Arial font first and, if the browser can’t find it, it will search for Helvetica, and then a common serif font.Note: if the name of a font is more than one word, it should be put in quotation marks, such as font-family: "Times New Roman".You can use a wider selection than the “safe†fonts using several methods outlined in the CSS Advanced Tutorial but if you’re just getting to grips with CSS, we suggest sticking with this basic standard approach for the moment.font-sizeThe size of the font. Be careful with this - text such as headings should not just be an HTML paragraph (p) in a large font - you should still use headings (h1, h2 etc.) even though, in practice, you could make the font-size of a paragraph larger than that of a heading (not recommended for sensible people).font-weightThis states whether the text is bold or not. Most commonly this is used as font-weight: bold or font-weight: normal but other values are bolder, lighter, 100, 200, 300, 400 (same as normal), 500, 600, 700 (same as bold), 800 or 900.Play around with these font-weight values if you want see their effect but, keep in mind, that some older browsers become a little confused with anything other than bold and normal so we suggest sticking to those unless you’re a typography ninja.font-styleThis states whether the text is italic or not. It can be font-style: italic or font-style: normal.text-decorationThis states whether the text has got a line running under, over, or through it.text-decoration: underline, does what you would expect.text-decoration: overline places a line above the text.text-decoration: line-through puts a line through the text (“strike-throughâ€).This property is usually used to decorate links and you can specify no underline with text-decoration: none.Underlines should only really be used for links. They are a commonly understood web convention that has lead users to generally expect underlined text to be a link.text-transformThis will change the case of the text.text-transform: capitalize turns the first letter of every word into uppercase.text-transform: uppercase turns everything into uppercase.text-transform: lowercase turns everything into lowercase.text-transform: none I’ll leave for you to work out.So, a few of these things used together might look like this:
Code:body { -
AuthorPosts
- You must be logged in to reply to this topic.