×    Online HTML Editor

Share 3

Share 3

×   Embed Video - Formatting tags in the HTML

Copy  

× Help - HTML Programming

YouTube

GSSS KHOKHAR Online HTML Editor

Write, Run & Share HTML code online using GSSS KHOKHAR HTML online Code editor for free.


About HTML

HTML(Hyper Text Markup language) is the standard markup language for Web pages, was created by Berners-Lee in the year 1991. Almost every web page over internet might be using HTML.

  • Any HTML document must start with document declaration <!DOCTYPE html>
  • HTML documents begin with <html> and ends with </html>
  • Headings are defined with <h1> to <h6> where <h1> is the highest important heading and <h6> is the least important sub-heading.
  • Paragrahs are defined in <p>..</p> tag.
  • Links are defined in <a> tag.

    Example:

    
    <!DOCTYPE html>
    <html>
    <head>    
        <title>Simple HTML Program</title>
    </head>
    <body>
        <h1>Simple HTML Program</h1>
        <h2>GSSS KHOKHAR, Sri Muktsar Sahib</h2>
    </body>
    </html>
    

Now, Click on the RUN button and output will display in output framework.

  • Images are defined in <img> tag, where src attribute consists of image name.
  • Buttons are defined in <button>..</button> tag
  • Lists are defined in <ul> for unordered/bullet list and <ol> for ordered/number list, and the list items are defined in <li>.

HTML Elements and Attributes

  • HTML element is everything present from start tag to end tag.
  • The text present between start and end tag is called HTML element content.
  • Anything can be a tagname but it's preferred to put the meaningful title to the content present as tag name.
  • Do not forget the end tag.
  • Elements with no content are called empty elements.
  • Elements can have attributes which provides additional information about the element.
  • In the below example, href is an attribute and a is the tag name.

    Example:

    
    <a href="https://www.gssskhokhar.com/html/">HTML</a>

CSS

CSS(cascading style sheets) describes how HTML elements will look on the web page like color, font-style, font-size, background color etc.

Example:

Below is a sample style sheet which displays heading in green and in Candara font with padding space of 25px.


body{
  padding: 25px;
}
.title {
	color: #228B22;
	font-family: Candara;
}

HTML Tables

  • HTML Tables are defined in <table> tag.
  • Table row should be defined in <tr> tag
  • Table header should be defined in <th> tag
  • Table data should be defined in <td> tag
  • Table caption should be defined in <caption> tag

HTML- Javascript

  • Javascript is used in HTML pages to make them more interactive.
  • <script> is the tag used to write scripts in HTML
  • You can either reference a external script or write script code in this tag.

Example


<script src="script.js"></script>

× Contact advertising

Coming Soon...



×    Video - Formatting tags in the HTML


×    Formatting tags in the HTML - HTML


HTML ਫਾਰਮੈਟਿੰਗ (Formatting) ਵੈੱਬ ਪੇਜਾਂ ਦੀ ਬਿਹਤਰ ਦਿੱਖ ਲਈ ਟੈਕਸਟ ਨੂੰ ਫਾਰਮੇਟ ਕਰਨ ਦੀ ਇੱਕ ਪ੍ਰਕਿਰਿਆ ਹੈ। HTML ਸਾਨੂੰ CSS (ਕਾਸਕੇਡਿੰਗ ਸਟਾਈਲ ਸ਼ੀਟਸ) ਦੀ ਵਰਤੋਂ ਕੀਤੇ ਬਿਨਾਂ ਵੀ ਟੈਕਸਟ ਨੂੰ ਫਾਰਮੈਟ ਕਰਨ ਦੀ ਯੋਗਤਾ ਪ੍ਰਦਾਨ ਕਰਦਾ ਹੈ। HTML ਵਿੱਚ ਬਹੁਤ ਸਾਰੇ ਟੈਗਜ਼ ਅਤੇ ਐਟਰੀਬਿਊਟਸ ਮੌਜੂਦ ਹਨ ਜੋ ਵੈੱਬਪੇਜ਼ ਦੇ ਕੰਟੈਂਟਸ ਫਾਰਮੇਟ ਕਰਨ ਵਿੱਚ ਸਾਡੀ ਸਹਾਇਤਾ ਕਰਦੇ ਹਨ। HTML ਵਿੱਚ ਵਾਰਮੈਟਿੰਗ ਲਈ ਆਮ ਤੌਰ ਤੇ ਵਰਤ ਜਾਣ ਵਾਲੇ ਟੈਗਜ਼ ਅਤੇ ਐਂਟਰੀਬਿਊਟਸ ਦਾ ਵਰਣਨ ਹੇਠਾਂ ਕੀਤਾ ਗਿਆ ਹੈ :

Bold, ਇਟੈਲਿਕ, ਅੰਡਰਲਾਈਨ ਅਤੇ ਸਟ੍ਰਾਈਕਰੋ (Bold, Italic, Underline und Strikethrough) :

HTML ਸਾਨੂੰ ਟੈਕਸਟ ਉੱਪਰ ਉਸੇ ਤਰ੍ਹਾਂ ਦੀ ਫਾਰਮੇਟਿੰਗ ਲਾਗੂ ਕਰਨ ਦੀ ਯੋਗਤਾ ਪ੍ਰਦਾਨ ਕਰਦਾ ਹੈ ਜਿਵੇਂ ਅਸੀਂ MS Word ਜਾਂ ਕਿਸੇ ਵੀ ਹੋਰ ਟੈਕਸਟ ਐਡੀਟਿੰਗ ਸਾਫਟਵੇਅਰ ਵਿੱਚ ਕਰਦੇ ਹਾਂ।ਹੇਠਾ ਦਿੱਤੇ ਟੰਗਜ਼ ਦੀ ਵਰਤੋਂ ਨਾਲ ਟੈਕਸਟ ਉੱਪਰ ਸਾਧਾਰਣ ਫਾਰਮੇਟਿੰਗ ਇਫੈਕਟਸ ਲਾਗੂ ਕੀਤੇ ਜਾ ਸਕਦੇ ਹਨ:

  • Bold (ਬੋਲਡ): <b> ਟੈਗ ਦੀ ਵਰਤੋਂ ਟੈਕਸਟ ਉੱਪਰ ਬੋਲਡ ਇਫੈਕਟ ਲਾਗੂ ਕਰਨ ਲਈ ਕੀਤੀ ਜਾਂਦੀ ਹੈ। ਇਹ ਇੱਕ ਪੇਅਰਡ ਟੈਗ ਹੈ। ਕੋਈ ਵੀ ਟੈਕਸਟ ਜੋ <b> </b> ਐਲੀਮੈਂਟਸ ਦੇ ਵਿਚਕਾਰ ਲਿਖਿਆ ਜਾਂਦਾ ਹੈ, ਬੋਲਡ ਫਾਰਮੇਟ ਵਿੱਚ ਪ੍ਰਦਰਸ਼ਿਤ ਕੀਤਾ ਜਾਂਦਾ ਹੈ।
  • Italic (ਇਟੈਲਿਕ): <i> ਟੈਗ ਦੀ ਵਰਤੋਂ ਟੈਕਸਟ ਉੱਪਰ ਇਟੈਲਿਕ ਇਫੇਕਟ ਨੂੰ ਲਾਗੂ ਕਰਨ ਲਈ ਕੀਤੀ ਜਾਂਦੀ ਹੈ। ਇਹ ਵੀ ਇੱਕ ਪੇਅਰਡ ਟੈਗ ਹੈ| ਕੋਈ ਵੀ ਟੈਕਸਟ ਜੋ <i> ... <i> ਐਲੀਮੈਂਟਸ ਵਿਚ ਕਾਰ ਲਿਖਿਆ ਜਾਂਦਾ ਹੈ, ਇਟੈਲਿਕ (Italic) ਫਾਰਮੈਟ ਵਿੱਚ ਪ੍ਰਦਰਸ਼ਿਤ ਕੀਤਾ ਜਾਂਦਾ ਹੈ |
  • Underline (ਅੰਡਰਲਾਈਨ): <u> ਟੈਗ ਦੀ ਵਰਤੋਂ ਟੈਕਸਟ ਉੱਪਰ ਅੰਡਰਲਾਈਨ ਇਫੈਕਟ ਲਾਗੂ ਕਰਨ ਲਈ ਕੀਤੀ ਜਾਂਦੀ ਹੈ। ਇਹ ਵੀ ਇੱਕ ਪੇਅਰਡ ਟੈਗ ਹੈ। ਕੋਈ ਵੀ ਟੈਕਸਟ ਜੋ <u> ... <u> ਐਲੀਮੈਂਟਸ ਵਿਚਕਾਰ ਲਿਖਿਆ ਜਾਂਦਾ ਹੈ, ਅੰਡਰਲਾਈਨਲ ਰੂਪ ਵਿੱਚ ਪ੍ਰਦਰਸ਼ਿਤ ਕੀਤਾ ਜਾਂਦਾ ਹੈ।
  • Strikethrough (ਸਟ੍ਰਾਈਕਥ): <s> ਟੈਗ ਦੀ ਵਰਤੋਂ ਟੈਕਸਟ ਤੇ ਸਟ੍ਰਾਈਕਸ ਇਫੇਕਟ ਲਾਗੂ ਕਰਨ ਲਈ ਕੀਤੀ ਜਾਂਦੀ ਹੈ। ਇਹ ਵੀ ਇੱਕ ਪੇਅਰਡ ਟੈਗ ਹੈ। ਕੋਈ ਵੀ ਟੈਕਸਟ ਜੋ <s> ... <s> ਐਲੀਮੈਂਟਸ ਵਿਚਕਾਰ ਲਿਖਿਆ ਜਾਂਦਾ ਹੈ, ਸਟਰਾਈਕਥ ਫਾਰਮੈਟ ਵਿੱਚ ਪ੍ਰਦਰਸ਼ਿਤ ਕੀਤਾ ਜਾਂਦਾ ਹੈ।

 

HTML contains several elements for defining text with a special meaning.

Example

This text is bold

This text is italic

This is subscript and superscript

 

HTML Formatting Elements

Formatting elements were designed to display special types 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
  • <s> - Strikethrough text

HTML <b> and <strong> Elements

The HTML <b> element defines bold text, without any extra importance.


<!DOCTYPE html>
<html>
<head>
<title>Formatting Tags</title>
</head>
<body>
<h1>Formatting Tags in the HTML</h1>
<HR>
<b> - Bold text</b><BR>
<strong> - Important text</strong><BR>
<i> - Italic text</i><BR>
<em> - Emphasized text</em><BR>
<mark> - Marked text</mark><BR>
<small> - Smaller text</small><BR>
<del> - Deleted text</del><BR>
<ins> - Inserted text</ins><BR>
<s> - Strikethrough</s>
5 <sub>  2</sub> - Subscript text<BR>
5 <sup>  2</sup> - Superscript text<BR>

</body>
</html>


Output


HTML Text Formatting Elements

Tag Description
<b> Defines bold text
<em> Defines emphasized text 
<i> Defines a part of text in an alternate voice or mood
<small> Defines smaller text
<strong> Defines important text
<sub> Defines subscripted text
<sup> Defines superscripted text
<ins> Defines inserted text
<del> Defines deleted text
<mark> Defines marked/highlighted text
Run « »