Genies Hour (3)
HTML- Class,Id
Know
The
class attribute specifies one or more class names for an HTML element.
The class name can be used by CSS and JavaScript to perform certain tasks for elements with the specified class name.
What I have learned
<style>
.city {
background-color: tomato;
color: white;
padding: 10px;
}
</style>
<h2 class="city">London</h2>
<p>London is the capital of England.</p>
<h2 class="city">Paris</h2>
<p>Paris is the capital of France.</p>
<h2 class="city">Tokyo</h2>
<p>Tokyo is the capital of Japan.</p>
The class attribute can be used on any HTML element.
The class name is case sensitive!
Different tags, like
<h2> and <p>, can have the same class name and thereby share the same style
What problem do I foresee happening?
Missing an end tag or (;)
Print it out to check all the detail.
Comments
Post a Comment