How to define equal style for elements with the same class name in HTML and CSS

1 Answer

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

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

<div class="class_for_div">
  <h1>CSS</h1>
  <p>Cascading Style Sheets (CSS) is a style sheet language used for describing
     the presentation of a document written in a markup language like HTML.</p>
</div>

</body>
</html>

 



answered Dec 18, 2018 by avibootz
...