Register now or log in to join your professional community.
When ever our web page it loaded into web browser. the browser identifies the page in the shape of objects, COM Objects, DOM Objects and Window Objects.
As per your question of concern the DOM objects could be identified by tag, id or class name.
When we set the properties of an element in the document with the help of class name is called class selector. This class selector is mostly used in CSS or Scripting languages etc.
Whit the help of class select we could manipulate object properties and attributes.
In the CSS, a class selector is a name preceded by a full stop (“.”) and an ID selector is a name preceded by a hash character (“#”).
Assalamu alaikum,
For example, style your name.
<p class="my-class-name"> murad almajaly </p>
p.my-class-name
{
text-transform: uppercase;}
Result // MURAD ALMAJALY
///////////////////////////
Check this link for several number selectors in css.
http://www.w3schools.com/cssref/css_selectors.asp
simple. class is use to style a html element with css.
the usage of class is
<p class="para">i am a paragraph </p>
to target it with css and style. add a style sheet in your webpage.
.para {
font-size:20px;
color:#006699;
}
there are multiple uses of classes. you can add multiple classes in one element like
<p class"para1 para2">I am a paragraph with two classes</p>
you can target them like
.para1.para2 {
font-size:50px;
}
for more info on css and targeting elements. check w3school.com.
classes can also be used for selecting element and performing tasks with jquery and javascript.
class selector is a class added to an html element to be tagged and can be later selected using java script, JQuery, or even CSS.
see the following example:
// html element
<div class="personal"> </div>
// css style
.personal
{
// you can add here any style rules that you want
}
// it will apply these style rules for all elements have this class.
// jQuery
$(".personal").hide();
// it will hides all elements with this class "personal".
you will find useful answer about your question at the following url:
http://stackoverflow.com/questions/9836151/what-is-this-css-selector-class-span
Regards,
Reda Ramadan
Class selector is formatting in html and is defined in html page or separate in file of css and it is defined as .class
their are two purpose of class
1) styling the div or any element for layout purpose
2) selecting the element using id or class to apply jquery events n functions
others have given few examples above so i dont require to show it again