Sep 8, 2017

HTML Tutorial (6)

Line Break Tag

Whenever you use the <br /> element, anything following it starts from the next line. This tag is an example of an empty element, where you do not need opening and closing tags, as there is nothing to go in between them. The <br /> tag has a space between the characters br and the forward slash. If you omit this space, older browsers will have trouble rendering the line break, while if you miss the forward slash character and just use <br> it is not valid in XHTML.

<!DOCTYPE html>
<title>Line Break Example</title>
<p>Hello<br />
You delivered your assignment on time.<br />
Thanks<br />

This will produce the following result:

You delivered your assignment on time.


Back in the garage, you’re doing a little work on your project car and, as you prepare to replace the existing tires with a new set, you notice that your hubcaps aren’t bolted on: you’d stuck them to the car with nothing more than super glue. There must have been a good reason for doing that, but you can’t remember what it was. The trouble is, if you had a reason to attach the hubcaps that way before, surely you should do it the same way again. Wouldn’t it be great if you’d left yourself a note when you first did it, explaining why you used super glue instead of bolts? Then again, your car wouldn’t look very nice with notes stuck all over it. What a quandary. When you’re creating a web site, you may find yourself in a similar situation. You might build a site then not touch it again for six months. Then when you revisit the work, you might find yourself going through the all-too-familiar head-scratching routine. Fortunately, there is a solution.
XHTML—like most programming and markup languages—allows you to use com­ments.11 Comments are perfect for making notes about something you’ve done and, though they’re included within your code, comments do not affect the on-screen display. Here’s an example of a comment:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="">
<title>Comment example</title>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8"/>
<p>I really, <em>really</em> like this XHTML stuff.</p>
<!-- Added emphasis using the em element. Handy one, that. -->

shows the page viewed on-screen.

Comments must start with <!--, after which you’re free to type whatever you like as a “note to self.” Well, you’re free to type almost anything: you cannot type double dashes. Why not? Because that’s a signal that the comment is about to end—the --> part. Oh, and did you spot how we snuck another new element in there? The emphasis element, denoted with the <em>and </em>tags, is used wherever … well, do I really need to tell you? Actually, that last question was there to illustrate this point: did you notice that the word “really” appeared in italics? Read that part to yourself now, and listen to the way it sounds in your head. Now you know when to use them element.

Also Read

Previous Post
Next Post

post written by:

Hey! I’m Muhammad Abba Gana, popularly known as AbbaGana, a blog Scientist by mind and a passionate blogger by heart fountainhead of Guidetricks, Duniyan Fasaha, Duniyar Yau, Hanyantsirah, Gidan Novels, Abba Gana Novels and Be With Me Technology, I am twenty something year old guy from Jimeta, Adamawa State, Nigeria. I’m a Freelance writer, Information marketer, professional blogger, Web designer, Internet speaker, software Developer and also an author. I make living with my laptop and can work from anywhere I find myself (as long as there is a power supply and a reliable internet connection).


We Cherish Your Comments Most, Kindly Drop your comments below. Don't forget to click "Notify Me" to know if we have responded to your comments, Thank You.