HTML - Classes in Hindi




दोस्तों इस chapter में हम HTML class attribute के बारे में जानेंगे तो चलिए शुरू करते है, HTML में class attribute का use करके हम एक ही स्टाइल को multipple जगह पर यूज़ कर सकते है, HTML class से एक ही वर्ग के नाम के elements के लिए समान Style को defined करना बहुत आसान हो जाता है।

HTML class लगभग सभी HTML tags के लिए एक HTML रैपर है। HTML class ये cascading style sheet का एक बहुत ही Important हिस्सा है, class attribute का उपयोग CSS और Javascript के लिए किया जाता है, website को design करने के लिए CSS का use किया जाता है और class attribute का ज्यादातर उपयोग css में किया जाता है।

HTML classes की सहायता से HTML ईमेल या powerful HTML5 साइट बनाने के लिए HTML को सीखना आसान हो जाता है आइए इसे दो paragraph बनाने के एक उदाहरण के साथ प्रयास करें, जो अलग तरीके से व्यवहार करते हैं।

Example

<!DOCTYPE html>
<html>
<head>
<style>
div.fruits {
    background-color: Red;
    color: Black;
    margin: 15px 0 15px 0;
    padding: 15px;
}
</style>
</head>
<body>
<div class="fruits">
<h2>Apple</h2>
<p>Delicious and crunchy, apple fruit is one of the most popular and favorite fruits among the health conscious, fitness lovers who firmly believe in the concept of “health is wealth.” This beautiful fruit packed with rich phytonutrients that, in the real sense indispensable for optimal health. Certain antioxidants in apples have health promoting and disease prevention properties, and thereby, truly justifying the adage, “an apple a day keeps the doctor away.”</p>
</div>
<div class="fruits">
<h2>Banana</h2>
<p>Banana is the most popular fresh fruit in all over the world and its name comes from the Arabic word 'banan', which means finger. The scientific name of Banana is Musa acuminata and Musa balbisiana. But the old scientific names of banana are Musa sapientum and Musa paradisiacal. It is not used longer. Bananas are rich source carbohydrates and potassium. They are the first choice by athletics due to its high energy giving capability. The funny thing to notice about banana is its shape (like an arc) which makes its appearance appealing. And why not, they are the favorite fruit of monkeys!</p>
</div>
</body>
</html>

Result

Apple

Delicious and crunchy, apple fruit is one of the most popular and favorite fruits among the health conscious, fitness lovers who firmly believe in the concept of “health is wealth.” This beautiful fruit packed with rich phytonutrients that, in the real sense indispensable for optimal health. Certain antioxidants in apples have health promoting and disease prevention properties, and thereby, truly justifying the adage, “an apple a day keeps the doctor away.”

Banana

Banana is the most popular fresh fruit in all over the world and its name comes from the Arabic word 'banan', which means finger. The scientific name of Banana is Musa acuminata and Musa balbisiana. But the old scientific names of banana are Musa sapientum and Musa paradisiacal. It is not used longer. Bananas are rich source carbohydrates and potassium. They are the first choice by athletics due to its high energy giving capability. The funny thing to notice about banana is its shape (like an arc) which makes its appearance appealing. And why not, they are the favorite fruit of monkeys!