Html attributes cont.

This is the part 2 of HTML attributes


Since now you know how to create a HTML file and run it, i directly insert the codes and the explanation only.


  • Consider if you need to bold a text in the HTML you can use <b> tag. for example,
<!DOCTYPE html>
<html>
<head>
<title>Lesson-3 Attributes cont</title>
</head>
<body>
<p><b>This text is bold</b></p>
</body>
</html>

  • If you need to make italic to a text you can use <i> tag like following,
<!DOCTYPE html>
<html>
<head>
<title>Lesson-3 Attributes cont</title>
</head>
<body>
<p><b>This text is bold</b></p>
<p><i>This text is italic</i></p>
</body>
</html>

  • If you need to underline some text you can use <u> tag
<!DOCTYPE html>
<html>
<head>
<title>Lesson-3 Attributes cont</title>
</head>
<body>
<p><b>This text is bold</b></p>
<p><i>This text is italic</i></p>
<p><u>This line is underlined </u> from this paragraph</p>
</body>
</html>

  • Superscript a tag. Use <sup> tag to close </sup>
<!DOCTYPE html>
<html>
<head>
<title>Lesson-3 Attributes cont</title>
</head>
<body>
<p>2<sup>nd</sup></p>
</body>
</html>

  • Subscript a text <sub> to close </sub>
<!DOCTYPE html>
<html>
<head>
<title>Lesson-3 Attributes cont</title>
</head>
<body>
<p>H<sub>2</sub>O</p>
</body>
</html>






No comments:

Post a Comment