HTML classes
Example
Using CSS to style all elements with the class name "city":<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
.city {
background-color: tomato;
color: white;
padding: 10px;} </style>
</head>
<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>
0 comments:
Post a Comment