XtGem Forum catalog

p _ x
Bookmark Weezywap
JarApkBmkOpera
(GMT+1)
Tuesday December 3rd 2024
+
Always Post weezywap.xtgem.com on your facebook, twitter, 2go, whatsapp and instagram status! If you love WEEZYWAP and enjoy unlimited services here!
»Css Basics
You are viewing Chapter 3 of 18 Chapters for Css Basics/Tutorials. View all Chapters
Chapter 1: Introduction to CSS
Chapter 2: CSS Syntax
Chapter 3: CSS Classes
Chapter 4: CSS IDs
Chapter 5: CSS Divisions
Chapter 6: CSS Spans
Chapter 7: CSS Margins
Chapter 8: CSS Padding
Chapter 9: CSS Text Properties
Chapter 10: CSS Font Properties
Chapter 11: CSS Anchors, Links and Pseudo Classes
Chapter 12: CSS Backgrounds
Chapter 13: CSS Borders
Chapter 14: CSS Ordered & Unordered Lists
Chapter 15: CSS Width and Height Properties
Chapter 16: CSS Classification
Chapter 17: CSS Positioning
Chapter 18: CSS Pseudo Elements
Chapter 3: CSS Classes

The class selector allows you to style items within the same (X)HTML element differently. Similiar to what I mentioned in the introduction about inline styles. Except with classes the style can be overwritten by changing out stylesheets. You can use the same class selector again and again within an (X)HTML file.
To put it more simply, this sentence you are reading is defined in my CSS file with the following.

p {
font-size: small;
color: #333333
}


Pretty simple, but lets say that I wanted to change the word "sentence" to green bold text, while leaving the rest of the sentence untouched. I would do the following to my (X)HTML file.

<p>
To put it more simply, this <span class="greenboldtext">sentence</span> you are reading is styled in my CSS file by the following.
</p>


Then in my CSS file I would add this style selector:

.greenboldtext{
font-size: small;
color: #008080;
font-weight: bold;
}


The final result would look like the following:
To put it more simply, this sentence you are reading is styled in my CSS file by the following.
Please note that a class selector begins with a (.) period. The reason I named it "greenboldtext" is for example purposes, you can name it whatever you want. Though I do encourage you to use selector names that are descriptive. You can reuse the "greenboldtext" class as many times as you want.
« PreviousJump to Chapter:
Next »

Translate
Pages
Copyright © 2024 WEEZYWAP
facebook twitter whatsapp google plus
Home | About Us | Advertise | Frequently Asked Question | Contact Us | Partners | Disclaimer | Terms of Services | Invite Friends | Credits



Online: 1 , Today: 1, Hits: 33952
Last modified: 19-01-2017 9:11:03 pm