{ LearnWebSiteDesign.com }
HTML, XHTML CSS Tutorials and Free Website Templates
CSS Font Tutorial
CSS font properties define the font size, font family, boldness of a text and the style of a text.
CSS font-size Property
The CSS font-size property is used to set the size of a text.
The code example below shows you how to use the font-size property to set the size of a text. The font size of the text.
The value of the font-size property can be an absolute or a relative size.
| absolute size |
Sets the text to the specified size
Does not allow a user to change the size of text within a web browser |
| relative size |
Sets the size of the font relative to the surrounding elements
A relative font size allows a user to change the text size in their web browsers |
NOTE: If the font-size of a normal text (paragraphs) is not set, the default font size is 16 pixels (16 pixels = 1 em).
The web page that the code example creates is here: CSS font-size Property Example.
CSS font-family Property
The CSS font-family property is used to define the font that a text should be displayed in.
The font-family property should include multiple font names in case that the web browser that the web page is being viewed in does not support the first font, the next font in line is tried. A comma is used to seperate each font within that declaration.
If the name of a font family is more than one word, it must be enclosed in quotation marks, for example: "Times New Roman".
The code example below shows you how to define the font of a text.
The web page that the code example creates is here: CSS font-family Property Example.
CSS font-weight Property
The CSS font-weight property is used to specify the boldness of a font. Most commonly, the boldness of a font is either normal or bold.
The code example below shows you how to set the boldness of a font.
The web page that the code example creates is here: CSS font-weight Property Example.
CSS font-style Property
The font-style property is used to define wether a font is italic, oblique or normal. Most commonly the font-style property is used to specify italic text.
The code example below shows you how to set the style of a font.
The web page that the code example creates is here: CSS font-style Property Example.
CSS font-variant Property
The CSS font-variant property is used to specify wether a text should be displayed as normal text or in a small-caps font. A small-caps font is displayed as smaller capitalized (uppercase) letters.
In a case where a web browser does not have a small-caps font available, the web browser will most likely show the text as uppercase instead.
The code example below shows you how to specify wether a text should be displayed as small-caps.
The web page that the code example creates is here: CSS font-variant Property Example.
All font Properties In One Declaration
The CSS font property allows you to set all of the font properties in one declaration.
The code example below shows you how to set all of the font properties in one declaration.
The web page that the code example creates is here: CSS font Property Example.
CSS Font Properties
| Property | Description | Values | CSS Level |
|---|---|---|---|
| font | Sets of all properties in one declaration |
font-style
font-variant font-weight font-size/line-height font-family caption icon menu message-box small-caption status-bar inherit |
CSS level 1 |
| font-family | Is used to define the font that a text should be displayed in |
family-name
generic-family inherit |
CSS level 1 |
| font-size | Is used to set the size of a text |
xx-small
x-small small medium large x-large xx-large smaller larger length % inherit |
CSS level 1 |
| font-style | Is used to define wether a font is italic, oblique or normal |
normal
italic oblique inherit |
CSS level 1 |
| font-variant | Is used to specify wether a text should be displayed as normal text or in a small-caps |
normal
small-caps inherit |
CSS level 1 |
| font-weight | Is used to specify the boldness of a font |
normal
bold bolder lighter 100 200 300 400 500 600 700 800 900 inherit |
CSS level 1 |
Tutorials
Templates
References
Sponsors
You can get your website online using Velnet, a leading UK web hosting provider. They provide free template and installation for WordPress blogs. Discuss webmaster related topics at Webmaster Serve, a Webmaster SEO forum
SouthernWebGroup.com provides high quality website design in Atlanta, GA as well as around the world.
Find low cost cheap website hosting and domain registration.
Browser our free no ads web hosting directory and find the free web hosting that's right for you and your budget.
Advertise your web design and web development related products and services here.
- Web Hosting UK
- Web Design Manchester
- Cheap Web Hosting
- free website hosting reviews
- ecommerce design
- Advertise
Recommended
Download free css web hosting templates that are easy to edit at FreeWebHostingTemplates.com.
Friends
- free web hosting templates
- free web hosting templates
- free web hosting reviews
- Web Development
- HD Wallpapers
- best web hosting providers
- Web Hosting Blog
- domain names
- iPage Host Reviews
- Reliable Bluehost Reviews
- Programming Forum
- Alojamento Web
- criar sites
- Free Facebook Banners
- Free No Ads Web Hosting Reviews
- Cheap Web Hosting Reviews
- Free Web Hosting Templates
- Free Premium Wordpress Themes
- Free Premium Wordpress Themes
- Free Joomla Template
- Free Wordpress Themes
- Best Android Apps
- Wordpress Themes Gallery
- Information technology courses
- Free PSD Files