"if you encounter any errors in SAP, send me a screenshot at pramod@learntosap.com, and I will help you resolve the issue."

HTML class Attribute Tag –

HTML TUTORIALS-

HTML class Attribute Tag –

Introduction-

The class attribute in HTML is used to assign one or more class names to an HTML element. These class names can be used to apply CSS styles or interact with JavaScript..

Trulli Trulli

βœ…Example 1: Styling with CSS: -πŸ‘‡

<!DOCTYPE html>
<html>
<head>
  <style>
    .highlight {
      background-color: yellow;
      font-weight: bold;
    }
  </style>
</head>
<body>
  <p class="highlight">This paragraph is highlighted using a CSS class.</p>
</body>
</html>

This paragraph is highlighted using a CSS class.


βœ… Example 2: Multiple Classes -πŸ‘‡


<!DOCTYPE html>
<html>
<head>
  <style>
   .box { border: 1px solid black; padding: 10px; }
    .rounded { border-radius: 10px; }
  </style>
</head>
<body>
  <div class="box rounded">This box has multiple classes applied.</div>
</body>
</html>

This box has multiple classes applied.

βœ… Example 3: JavaScript Access -πŸ‘‡


<!DOCTYPE html>
<html>
<body>
  <p class="clickable">Click me!</p>
  <script>
   document.querySelector('.clickable').addEventListener('click', function() {
     alert('Paragraph clicked!');
    });
 </script>
</body>
</html>

Click me!


βœ… Example 4: Grouping Elements -πŸ‘‡


<!DOCTYPE html>
<html>
<head>
  <style>
   .menu-item { color: blue; }
 </style>
</head>
<body>
  <ul>
    <li class="menu-item">Home</li>
    <li class="menu-item">About</li>
   <li class="menu-item">Contact</li>
 </ul>
</body>
</html>


Live Code Preview


May Be Like Important Link-

-Chart Of Account-OB13

-Define Plant-OX1

-Chart Of Account-OB13

-Define Financial Statement