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


Thursday, August 25, 2022

HTML tag

Head section  


Html tag




1]  <BODY>  </BODY> TAG :-


The HTML <body> tag defines the main content of the HTML document or the section of the HTMI. document that will be directly visible on your web page. This tag is also commonly referred to as the <body> element. All those content which we write inside the <BODY> tag appear on the web browser.The <body> element contains all the contents of an HTML document, such as headings, paragraphs, images, hyperlinks, tables, lists, etc. Note: There can only be one <body> 


Html Body extra information

 

HTML syntax for body tag


<BODY>

<h1> This is body tag </h1>

</BODY>


Attributes Use Body Tag

 Bgcolor  :- To change the background color of the web document.

Background   :- To set the background image on the body of the web document

Text  :- To set the Foreground color of text.

Left Margin  :- To set the Left Margin of the web document. 

Top Margin :- To set the Top Margin of the web document. 

Link :- To set the Color of text for unvisited hyperlinks.

 VLink  :-To set the color of text for visited hyperlinks.

ALink  :- To set the color of text for selected hyperlinks.


For example

<!doctype html>

<html>

<head>

<title> Example of Body Tag</title> 

</head>

<body>

<h1>This is the Body of the web document </h1><p> This is the content </p>

</body>

 </html>



Output in body tag









2]  Formatting Tags 

Html formatting tags are used to make some text on your web pages to appear differently that normal text for better look and feel. In computer application, formatting data may associated with text data to create formatted text or we can say that formatting tags are used to change the style of text on a webpage there are following formatting elements were designed to designed to display special type of text. 


<b>- Bold text

<strong>- Important text

<i>- Italic text

<em>- Emphasized text

<mark > Marked text

<small>- Smaller text 

<del> Deleted text

<ins> • Inserted text

<sub> Subscript text

<sup>- Superscript text


Example of Formatting tags


<!DOCTYPE html>




<html>

<body><center><strong><u>All Formating tag</u></strong> </center>

<p>This text is normal.</p>                                                                    

<br><i>This text is italic.</i>

<br><em>This text is emphasized.</em>

<br><b>This text is Bold.</b>

<br><strong>This text is Stong.</strong>

 <br>This <sup>text is superscript</sup><br>H <sub>2</sub>

<br><small>This is some smaller</small>

<br><big>This is some smaller</Big> 

<br><Mark>This is some smaller/Mark>

<p>My favorite color is <del>blue</del> red.</p>

 <p>My favorite color is <del>blue</del> <ins>red</ins>.</p>

</html>


Formatting Tag

Output Formatting tag









3]  Bold  Tag

The HTML <b> tag which represents bold text in an HTML webpage."<b> and <strong> Elements" The <b> tag should be used to markup text as bold without conveying any extra importance.The <b> tag is written as <b> .....</b> with the text to be bold inserted between the start and end tags..

The HTML <strong> element defines text with strong importance. The content inside is type.

<strong>This text is important!</strong>

Example 

<! Doctype html>

</html>  <head>                                        

         <title>Bold Body Tag </title>

</head> 

<body>

<b>This is  BOLD Body Tag</b>

<strong>Element defines text with strong importance content inside</strong>

</body>

</Html>


Output in Bold Tag
Output in Bold Tag



 

4]  Itelic Tag

 <i> and <em> Elements

The <i> element was used for presentational purposes only i.e. to style text in italic.

The <i> tag is written as <i>.......</i> with the text inserted between the start and end tags.


<!IDOCTYPE html>

<html>                                                  

 <body>                                  

</h2> Itelic tag</h2>

 <i>Some italic text</i>

</body>

 </html>


Italic tag html  output

Output Itelic tag








5]  Underlined Tag

The <u> tag represents some text that is unarticulated and styled differently from normal text, such as misspelled words or proper names in Chinese text.

The <u> HTML element represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation.


<!DOCTYPE html>

 <html>                                   

      <head>

<title>Underlined Text Example</title>

</head>

<body>

 <p>The following word uses an <u>underlined</u> typeface.</p>

</body>

 </html>


Output in Underline
Output in Underline Tag








Related Post :-

Html tag formatting

introduction html

website work 

Saturday, August 20, 2022

html script tag attributes

 SCRIPT Element 


SCRIPT Element img


The SCRIPT element is used to declare a script, such as JavaScript, within an HTML document e embedded external javascript file through the src attribute. You can use the SCRIPT element for validating Web forms and manipulating the content and images present on these forms. 

<script>

document.getElementById("demo").innerHTML = "Hello JavaScript!";

</script>

 The SCRIPT element is used inside the HEAD element, which uses the type attribute. The type


1 Introduction to scripts

A client-side script is a program that may accompany an HTML document or be embedded directly in it. The program executes on the client's machine when the document loads, or at some other time such as when a link is activated. HTML's support for scripts is independent of the scripting language.

Scripts offer authors a means to extend HTML documents in highly active and interactive ways. For example Scripts may be evaluated as a document loads to modify the contents of the document dynamically.

Scripts may accompany a form to process input as it is entered. Designers may dynamically fill out parts of a form based on the values of other fields. They may also ensure that input data conforms to predetermined ranges of values, that fields are mutually consistent, etc. Scripts may be triggered by events that affect the document, such as loading, unloading, element focus, mouse movement, etc.

Attribute 

1. Async 

Value :- true, false

Description :-

For classic scripts, if the async attribute is present, then the classic script will be fetched in parallel to parsing and evaluated as soon as it is available. For module scripts, if the async attribute is present then the scripts and all their dependencies will be executed in the defer queue, therefore they will get fetched in parallel to parsing and evaluated as soon as they are available.

This attribute allows the elimination of parser-blocking JavaScript where the browser would have to load and evaluate scripts before continuing to parse. defer has a similar effect in this case. This is a boolean attribute: the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.


2.  NOSCRIPT element


The NOSCRIPT element is used to display the alternate content on the Web browser that either does not support JavaScript or has JavaScript disabled. If the JavaScript is enabled or supported by the Web browser, the NOSCRIPT element is not considered. The following code snippet shows an example of the NOSCRIPT element.

The noscript element represents nothing if scripting is enabled, and represents its children if scripting is disabled. It is used to present different markup to user agents that support scripting and those that don't support scripting, by affecting how the document is parsed.

<script type="text/javascript">

document.write("Good Morning.")

</script> 

<NOSCRIPT>Javascript is disabled or not supported on your browser.</NOSCRIPT>

The NOSCRIPT element can only be applied on the elements that are inside the BODY element. If you do not want to apply script on any session of the BODY element, you can define it in the NOSCRIPT element. This element cannot contain any nested elements.


3 The STYLE Element:

The STYLE element is used to declare the style sheets within the HTML document. This element specifies how the HTML elements are rendered in a browser. The STYLE element has three attributes: type, media, and scoped. Generally, the STYLE element is placed inside the HEAD element but if you use the scoped attribute, then you can place the STYLE element in the BODY element of the document. The following code snippet shows the use of the STYLE element in a document:

<HEAD>

<STYLE type="text/css">

body (background-color: powderblue;}

hi (color: red;)

p [color: blue;)

</STYLE></HEAD>


In the preceding code snippet, the STYLE element is used within the HEAD element


Script element extra information

Related Post


horizontal navigation bar

type css selectors

element tag