Note 13.9.1.
If you work in a group, have only one member of the group fill in the answers on this page. You will be able to share your answers with the group at the bottom of the page.
<a>
tag?<img>
tag?<div>
and a <span>
tag?<table>
tag.<!DOCTYPE html>
<html>
<head>
<title>Page with Table</title>
</head>
<body>
<h1>The First Page</h1>
<table>
<tr>
<th>Country</th>
<th>Year</th>
<th>Unemployment Rate</th>
</tr>
<tr>
<td>United Kingdom</td>
<td>2017</td>
<td>4.33</td>
</tr>
<tr>
<td>India</td>
<td>2017</td>
<td>3.52</td>
</tr>
</table>
</body>
</html>
a
tag which is also known as a link tag as shown below.<a href="https://www.w3schools.com/">Visit W3Schools.com!</a>
<a>
contains an attribute href
and value "https://www.w3schools.com/"
. The text of the tag is Visit W3Schools.com!
which is the actual text of the link when it is displayed. If you click on the link you will be taken to the href
value: https://www.w3schools.com/
. The <a>
tag has a closing </a>
tag.<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<p> The anchor (link) tag is used to include hyperlinks. Click on "Visit the beach" to go to that url.
<a href="https://i.ibb.co/WfcrzVn/beach.jpg">Visit the beach</a>
</p>
</body>
</html>
src
that specifies the URL for the image and can have an alt
attribute to specify alternative text that describes the image.<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<p> The img tag is used to include images in web pages.</p>
<img src="https://i.ibb.co/WfcrzVn/beach.jpg" alt="A picture of a beach">
</body>
</html>
<img>
, does not have an end tag. All of the information is in the start tag.img
tag and the a
tag?alt
attribute of the img
tag. Attributes are specified by name and value pairs. The value should be in quotes.div
tag is used to contain other HTML tags (elements). It is often used to divide the HTML page into sections. The span
tag is used for inline grouping or styling. You can use Cascading Style Sheets (CSS) to change the look of each HTML tag (element). You can add the CSS directly in the head
section using the style
tag, but the recommended approach is to use external CSS.<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
<style>
div {
background-color: #EAF0F6;
color: #33475B;
border: 3px solid #00A4BD;
padding: 5px;
}
span {
background-color: #F6FF33;
}
</style>
</head>
<body>
<div> A div is a division or section in HTML. It is a container for other HTML elements.
<p> First paragraph </p>
<p> Second <span>paragraph</span> with a span in it.</p>
<p> Third paragraph</p>
</div>
</body>
</html>
<html>
<head>
<style>
p.warning {
color: red;
}
p.large {
font-size: 150%;
}
</style>
</head>
<body>
<h1>Demo using CSS classes</h1>
<p>This is a normal paragraph</p>
<p class="warning">This paragraph will be red.</p>
<p class="warning large">This paragraph will be red and in a larger font-size.</p>
</body>
</html>
warning
to use an orange color instead and render the HTML again.https://cspogil.org/Home