The HTML class attribute is used to style multiple elements in the same way.
Examples
HTML class attribute
Table of Contents
Toggle
Dhaka
Dhaka is the capital of Bangladesh
and the main city of Dhaka Division. Dhaka is a
megacity and one of the major cities in South Asia.
Located on the banks of the Buriganga River,
it is the largest city in Bangladesh.
The Dhaka
metropolitan area has a population of about 15 million.
Chandpur
An administrative district of Chittagong
Division in southeastern Bangladesh.
This district is located on the banks of the Meghna
River. The people of Chandpur are famous for their hospitality.
Rajshahi
Rajshahi is a major city in the northern region
(North Bengal) of Bangladesh. Rajshahi city is located on the banks of the famous Padma River. It is the divisional city of Rajshahi division.
Output
Dhaka
Dhaka is the capital of Bangladesh and the main city of Dhaka Division. Dhaka is a megacity and one of the major cities in South Asia. Located on the banks of the Buriganga River, it is the largest city in Bangladesh. The Dhaka metropolitan area has a population of about 15 million.
Chandpur
An administrative district of Chittagong Division in southeastern Bangladesh. This district is located on the banks of the Meghna River. The people of Chandpur are famous for their hospitality.
Rajshahi
Rajshahi is a major city in the northern region (North Bengal) of Bangladesh. Rajshahi city is located on the banks of the famous Padma River. It is the divisional city of Rajshahi division.
Using the class attribute on inline elements
class
The attribute can also be used on HTML inline elements .
HTML class attribute
My Important title
Some Important text.
Output
My Important title
Some Important text.