Wednesday, 26 October 2016

HTML : Text Layout


Text Layout

Text layout defines position of text on a webpage. For make any matter or text effective we use many things like
  • New line
  • Paragraph
  • Space
  • Tab

New line

A newline is combination of carriage return and new line. IN HTML you can apply new line by using <br/> tag because HTML does not new line automatically

One </br>
Two </br>

<br/> apply one line at a one time if you want to more line then you will have to use <br/> repeatedly as your requirement.

One <br/><br/>

Paragraph

A paragraph is a combination of one or more than one lines.  When a paragraph starts it skip two lines. There is difference between paragraph and new line. New line automatically change line when specified margin over but in paragraph we need to explicitly change paragraph.

<p>


</p>

Space

A space differentiates two words and for some type of indenting or formatting purpose we need to use more than one space. By default HTML skip white space means if you have used more than one space in your HTML source code but your browser print only one space.

HTML source file

Girfa :                       Student Help

Output

Girfa : Student Help

Solution

&nbsp print one space

Girfa : &nbsp; &nbsp; &nbsp; &nbsp; Student Help

White space


Anything, instead of your source code known as white space. You print white space using <pre> Tag.
<pre>

               
                Name                         Raj Kumar
               Subject                       Computer
               City                            Varanasi
……………………………………………………………………………………………..
</pre>


 Run This Code

Download PDF