Showing posts with label html pre tag. Show all posts
Showing posts with label html pre tag. Show all posts

Tuesday, August 30, 2022

html heading tag, html div tag

Body Tag




html tag

 


1] Font face, Size & Colour 


The <font> tag is used to change the format of the text on the web page. The HTML <Font> tag also supports following additional .Font face and color depends entirely on the computer and browser that is being used to view your page but you can use HTML <font> tag to add style, size, and color to the text on your website. You can use a <font> tag to set all of your text to the same size, face, and color.


Color 

Attribute 

Value  - rgb(x,x,x) Colorname

Description 

It Specifies the color of text. Either the color name or the six character color code may be used to specify color


 font

The face attribute allows the author to define one Roman", or more different fonts to be displayed (the browser will display the first font specified, but if that is not present on the computer, the browser will try the next one in the list and so on).


Value  font_family or "Times New "Verdana", and "Helvetica."

size

It Specifies the size of text. This can be absolute (0.. 6), or relative ("+1", "+2","+3",... or "-1", "-2", "_3" ...) 



<!DOCTYPE html>
<html>
<body>
<p><font size="3" color="red">This is some text! </font></p>
<p><font size="2" color="blue">This is some text ! </font></p> <p><font face="verdana" color="green">This is some text!</font></p>
<p><strong>Note:</strong> The font element is not supported in HTML5. Use CSS instead.</p>
</body>
 </html>


OUTPUT IN FONT FACE SIZE & COLOUR

This is some text!

This is some text !

This is some text!

Note: The font element is not supported in HTML5. Use CSS instead






2] Heading tag


Heading elements implement six levels of document headings, <h1> is the highest level and <h6> is the lowlest level. A heading element briefly describes the topic of the section it introduces. Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.

Several <header> elements can be present in one document. Use h1 to h6 elements only for headings. Do not use them just to make text bold or big. Use tags for that.


 <!DOCTYPE html>

 <html><body>
<h1>Heading 1</h1>
 <h2>Heading 2</h2>
 <h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
 <h6>Heading 6</h6> 
</body>

</html>


OUTPUT IN HEADING TAG 


Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6


3] Div


The <div> tag defines a division or a section in an HTML document The <div> element is often used as a container for other HTML elements to style them with CSS or to perform certain tasks with JavaScript.

The <div> element is very often used together with CSS, to layout a web page. 


<!DOCTYPE html>

 <html>
 <p>This is some text.</p>
 <div style="background-color:lightblue"> 
 <h3>This is a heading in a div element</h3>
 <p>This is some text in a div element.</p>
</div>
 <p>This is some text.</p>
 </body>

</html>


OUTPUT IN DIV TAG


This is some text.

This is a heading in a div element

This is some text in a div element.

This is some text.





4] Pre Tag  


The <pre> tag defines preformatted text.Text in a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks. Use the <pre> element when displaying text with unusual formatting, or some sort of computer code.


<!DOCTYPE html>

<html>
 <body>
 <pre>
 Text in a pre element 
is displayed in a fixed-width
 font, and it preserves
 both spaces and
 line breaks
 </pre> 
 </body>

 </html>


OUTPUT IN PRE TAG 


Text in a pre element 
is displayed in a fixed-width
 font, and it preserves
 both spaces and
 line breaks


5] Line Break

A line break ends the line you are currently on and resumes on the next line. Placing <br /> within the code to break the line. Use the <br /> tag within the <p> (paragraph) tag.

A line break is marked up as follows:

The <br> tag inserts a single line break. 

The <br> tag is an empty tag which means that it has no end tag.

The <br> tag is an empty tag which means that it has no end tag. 

The <br> tag is useful for writing addresses or poems.

<br> tag to enter line breaks, not to separate paragraphs.


<!DOCTYPE html>

<html>
 <body>
<p>
 To break lines<br>in a text,<br>use the br element.
 </p>
</body>

 </html>


OUTPUT IN LINE BREAK TAG


To break lines
in a text,
use the br element


Related Post

head-section tag html
server side scripting html
internet works html
number increasing reverse pyramid php
php program to print alphabet pattern n
login form html