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



Single Articles
Basic Example of Using The class AttributeHTML class Attribute
Basic Example of Using The Span AttributeHTML class Attribute


Related Articles
What is HTML class Attribute HTML class Attribute
How to Use The class Attribute HTML class Attribute
How to use The Syntax For Class HTML class Attribute
How to create HTML Multiple Classes HTML class Attribute
How to create Different Elements Can Share Same Class HTML class Attribute
How to Use of The class Attribute in JavaScript HTML class Attribute

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