Old school Swatch Watches
ADS By Strikecoded:
Smash Your 2018/19 Jamb, Waec, Neco With CAMPUSBASE Visit Now.. Best Java, Android Games, Apps


No1. Naija Awarded Download Portal For Both Mobile And Pc Users..

Home | Blog | Search | Uploads

»Css Tutorials
You are viewing Tutorial 3 Of 18 Tutorials For Css Basics/Functions. View All Tutorials

»All Tutorials Collection


Tutorial 1: Introduction to CSS

Tutorial 2: CSS Syntax

Tutorial 3: CSS Classes

Tutorial 4: CSS IDs

Tutorial 5:CSS Divisions

Tutorial 6: CSS Spans

Tutorial 7: CSS Margins

Tutorial 8: CSS Padding

Tutorial 9: CSS Text Properties

Tutorial 10: CSS Font Properties

Tutorial 11: CSS Anchors, Links and Pseudo Classes

Tutorial 12: CSS Backgrounds

Tutorial 13: CSS Borders

Tutorial 14: CSS Ordered & Unordered Lists

Tutorial 15: CSS Width and Height Properties

Tutorial 16: CSS Classification

Tutorial 17: CSS Positioning

Tutorial 18: CSS Pseudo Elements

Tutorial 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.
« Previous
Jump to Tutorial:
Next »


Page Statistics

DataLoads
Online1
Today's Hits 15
Total Today's Hits19
Total Hits This Week 19
Total Page Hits 9817
Total Forum Members190

Close Page Information

Go BackPromote Forum Services Members About us Terms of use Advertise News update Contact us Feedback

chart1FOLLOW US ON

FBTWG LDRS
Back to the Top

Copyright © . Theme by STRIKECODED TECH.

Desktop View