Bright Java Tutorial

is brought to you by DoITBright LLC

HTML

Break Line In HTML

Whenever we are writing a document, it is very common that we use line breaks to force the content we are including in the document to go to the next line. Most of the time, we accomplish this by using the 'Enter' button on our keyboard. However, in HTML, simply doing this will not achieve the goal of attaining a line break. The tag that will accomplish this task will be <br/> tag. Let us look at this example.

  <html>
    <head>
      <title>Break Line in HTML</title>
    </head>
    <body>
      The quick brown fox jumped over the lazy dog. 
I used the 'Enter' button to force a line break here.
It is unsuccessful.
I will now use the tag <br/> As you can see, it is successful. <br/><br/><br/> Here is more of it! </body> </html>
As shown in the above example, no matter how you use the 'Enter' button to make the content of your HTML go to the next line, it will not have any effect. The tag that did the job perfectly is the <br/> tag.

White Space In HTML

Another common thing that we do in writing a document is to force a white space (empty space or simply a space) in between a text and another text. In HTML, the way to accomplish this thing is by using the non-block space character sequence which is &nbsp;. Let us try it now.

  <html>
    <head>
      <title>White Space in HTML</title>
    </head>
    <body>
      I will put a lot of space in between this             and this!
<br/> It did not have any effect!
<br/> I will put a lot of space in between this &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;and this!
<br/> Oh yes! It is a success! </body> </html>
Knowing how to use white space and break line will help you a lot in designing web pages.


Back    Next