Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

CSS Tutorial for beginners (Step by Step) with Examples(Part3).

i. Universal Style Class

It is a type of style class which is used by any element of the HTML document. Universal Style Class Starts with a dot(.) operator and followed by the Class name.

Syntax

<style>

.classname { class properties } [ Note :- no space between class_name]

</style>

For Example :-

<style>

.class { color: red; font-size: 30px;}

</style>

Sample Program

Output

ii. Element Specific Style Class

It is a type of style class which is used by a specific element(declared before class name) of the HTML document. An element specific style class starts with the element name, followed by a dot(.) operator, which is followed by a class name.

Syntax :-

<style>

elementname.classname { class definition }

</style>

For Example :-

<style>

p.sushant { color:blue; font-size:35px;}

</style>

[Note :- Here, sushant class is used by p element only and if we declare the class in other elements then it doesn’t work.]

Sample Program

Note :- In the above sample program, the class is called in h1 tag as well as in p tag, but class property works only with p tag because of the element-specific style class. See the output Below :-

Output

How to use two or more classes in CSS.

We can use two or more classes in an element/tag by giving space between them.

Syntax

Sample Program

Output

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
With MotoShare.in, you can book a bike instantly, enjoy doorstep delivery, and ride without worries. Perfect for travelers, professionals, and adventure enthusiasts looking for a seamless mobility solution.

Related Posts

What is CSS and use cases of CSS?

What is CSS? CSS stands for Cascading Style Sheets. It is a style sheet language used to define the presentation and layout of HTML documents. CSS allows…

Read More

Top 21 Firefox Addon every software engineers must know

Mozilla Firefox is a very popular browser, especially among web designers and developers. These days, with such a crowded field, staying at the top of the browser…

Read More

Top 50 interview questions and answers for CSS

CSS stands for cascading styles sheets. In short, CSS may be a style language that creates an internet site look a lot of appealing than simply plain…

Read More

What is CSS and How does CSS works?

Introduction To CSS CSS (Cascading Style Sheets) is used to style and layout web pages – for example, to change the font, color, size, and spacing of…

Read More

How to add Media Query in your HTML Websites?

Media Query: A media query is a CSS technique introduced in CSS. A media query consists of the optional media type and zero or more expressions that…

Read More

CSS Tutorial for beginners (Step by Step) with Examples(Part2).

What is Internal Style Sheet? An internal style sheet is a set of style that is created as a part of an HTML document. An internal style…

Read More