How to use the class attribute to define style in HTML and CSS

1 Answer

0 votes
<!DOCTYPE html>
<html>
<head>
<style>
.class_example {
    background-color:black;
    color:green;
    padding:10px
}
</style>
</head>
<body>

<div class="class_example">
  <h1>HTML</h1>
  <p>Hypertext Markup Language (HTML) is the standard markup language
     for creating web pages and web applications.</p>
</div>

</body>
</html>

 



answered Dec 18, 2018 by avibootz
...