Horje

Basic Example of Using The Span Attribute

In the following example we have two <span> elements with a class attribute with the value of "note". Both <span> elements will be styled equally according to the .note style definition in the head section:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
<style>
.note {
  font-size: 120%;
  color: red;
}
</style>
</head>
<body>

<h1>My <span class="note">Important</span> Heading</h1>
<p>This is some <span class="note">important</span> text.</p>

</body>
</html>

Output should be:

Basic Example of Using The Span Attribute




Type:
html
Category:
Web Tutorial
Sub Category:
HTML class Attribute
Uploaded by:
Admin