Html attributes
From Leechfinger
Default HTML page
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>My first page.</title>
<link rel="stylesheet" href="css/bootstrap-grid.css">
</head>
<body>
<a href="#" tabindex="1">First link</a>
<header>
<h1>Welcome to my crummy site</h1>
</header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About Me</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
<article>
<p>This is my paragraph.</p>
<nav>
this is my navigation. <br>
</nav>
<br>
<p title="do you see me">Hover over thei text to see more info.</p>
</article>
<footer>
<p>this is my footer.contact me. at [email protected]</p>
<img src="images/qais.png" alt="same thing again" width="300">
</footer>
<h1>Hello non world...!!!!!.......</h1>
<img src="images/bozo.png" alt="picture of my face" width="500">
<br />
<script src="js/bootstrap.bundle.js"></script>
</body>
</html>
Global attributes
<p title="more info">Hover over this text to see.</p>
<p lang="en">Hello</p>
<a href="#" tabindex="1">First link</a>
<article id="article" data-author="Bozo" data-published="2026-06-6">
Use of ID
ID is used on a single element all through the code. Example below shows for
and
.
In html
<p id="c2">This is my paragraph.</p>
<div><h1>Welcome to my crummy site</h1> </div>
In css:
c2 {
color: red;
}
div {
color: red;
}
Use of class
In html
<p class="bum">This is my paragraph.</p>
In css:
.bum {
color: red;
}