Latest topics
» Peruzzi Ft. Not3s – Reason
Difference between "div id" and "div class" in HTML EmptyYesterday at 12:15 pm by Adminkunlex

» Peruzzi – Show Working
Difference between "div id" and "div class" in HTML EmptyYesterday at 12:14 pm by Adminkunlex

» Skales Ft. Akon – Kowope
Difference between "div id" and "div class" in HTML EmptyYesterday at 12:12 pm by Adminkunlex

» Qdot- German
Difference between "div id" and "div class" in HTML EmptyYesterday at 12:11 pm by Adminkunlex

» Best home workout for broad & wide chest
Difference between "div id" and "div class" in HTML EmptyTue Apr 07, 2020 10:27 am by Adminkunlex

» Nollywood Actress, Halima Abubakar Welcomes Baby Boy
Difference between "div id" and "div class" in HTML EmptyTue Apr 07, 2020 10:24 am by Adminkunlex

» What are key exercises to build a good-looking body for men?
Difference between "div id" and "div class" in HTML EmptyMon Apr 06, 2020 8:48 am by Adminkunlex

» Wild Life: Puzzle Story Android Game
Difference between "div id" and "div class" in HTML EmptyMon Apr 06, 2020 8:38 am by Adminkunlex

» Shootout 3D Android Game
Difference between "div id" and "div class" in HTML EmptyMon Apr 06, 2020 8:37 am by Adminkunlex

» 1945 - Shoot 'Em Up Android Game
Difference between "div id" and "div class" in HTML EmptyMon Apr 06, 2020 8:36 am by Adminkunlex

» Coronavirus Lockdown: 10 Ways To Beat Boredom
Difference between "div id" and "div class" in HTML EmptyFri Apr 03, 2020 8:31 pm by Adminkunlex

» Audio + Lyrics: Kcee – Sweet Mary J
Difference between "div id" and "div class" in HTML EmptyFri Apr 03, 2020 8:27 pm by Adminkunlex

» Social Etiquette: Guarding Your Tongue
Difference between "div id" and "div class" in HTML EmptyFri Apr 03, 2020 8:25 pm by Adminkunlex

» Pacific Warships: World of Naval PvP Wargame Android Game
Difference between "div id" and "div class" in HTML EmptyWed Apr 01, 2020 11:35 am by Adminkunlex

» Badlands Blade Battle Android Game
Difference between "div id" and "div class" in HTML EmptyWed Apr 01, 2020 11:33 am by Adminkunlex

» Google youtube app for java
Difference between "div id" and "div class" in HTML EmptyWed Apr 01, 2020 11:32 am by Adminkunlex

» How to use has, have and had in a sentence?
Difference between "div id" and "div class" in HTML EmptyWed Apr 01, 2020 11:28 am by Adminkunlex

» eBuddy Messenger Java App
Difference between "div id" and "div class" in HTML EmptyMon Mar 30, 2020 8:55 pm by Adminkunlex

» Google Chrome Os Jar Java App
Difference between "div id" and "div class" in HTML EmptyMon Mar 30, 2020 8:54 pm by Adminkunlex

» kasperskey Anti Virus Scanner Java App
Difference between "div id" and "div class" in HTML EmptyMon Mar 30, 2020 8:53 pm by Adminkunlex



Difference between "div id" and "div class" in HTML

Go down

Difference between "div id" and "div class" in HTML Empty Difference between "div id" and "div class" in HTML

Post by Adminkunlex on Sun Jan 19, 2020 9:15 am

In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called "id" and "class".
1.THE ID SELECTOR:
The id selector is used to specify a style for a
single, unique element.
The id selector uses the id attribute of the HTML
element, and is defined with”#".
The style rule below will be applied to the element
with id="abc":
#abc
{
Text-align: center;
Color: red;
}
2.THE CLASS SELECTOR:
The class selector is used to specify a style for a
group of elements. Unlike the id selector, the class
selector is most often used on several elements.
This allows you to set a particular style for many
HTML elements with the same class.
The class selector uses the HTML class attribute, and
is defined with a "."
In the example below, all HTML elements with
class="center" will be center-aligned:
.center
{
Text-align: center;
}
A class can be used several times, while an ID can
only be used once, so you should use classes for
items that you know you're going to use a lot. An
example would be if you wanted to give all the
paragraphs on your webpage the same styling, you
would use classes.Common id elements are things
like header, footer, sidebar. Common class elements
are things like highlight or external-link.


Source

Adminkunlex
Admin

Posts : 1342
Join date : 2019-06-08
Age : 20
Location : Osun State, Nigeria

https://9jabaze.forumotion.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum