×    Online HTML Editor

Share 7

Share 7

×   Embed Video - Creating a Web Page with Basic Structure of HTML document

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 - Creating a Web Page with Basic Structure of HTML document


×    Creating a Web Page with Basic Structure of HTML document - HTML


ਵੈੱਬ ਪੇਜ਼ ਬਣਾਉਣ ਲਈ ਹੇਠ ਦਿੱਤੇ ਸਟੈਂਪਾ ਦੀ ਵਰਤੋਂ ਕਰੋ:

1. ਕੋਈਂ ਵੀ ਟੈਕਸਟ ਐਡੀਟਰ, ਜਿਵੇਂ Notepad, Notepad++ ਆਦਿ open ਕਰੋ।

2. ਜੇਕਰ ਅਸੀਂ Notepad++ ਦੀ ਵਰਤੋਂ ਕਰ ਰਹੇ ਹਾਂ ਤਾਂ ਨਵੀਂ ਫਾਈਲ ਬਣਾਉਣ ਲਈ File -> New ਉਪਰ ਕਲਿੱਕ ਕਰੋ ਜਾ ਸ਼ਾਰਟਕੱਟ Ctrl+N ਦੀ ਵਰਤੋਂ ਕਰੋ।

3. ਹੁਣ ਹੇਠਾਂ ਦਿੱਤੇ ਸਾਧਾਰਨ HTML ਪ੍ਰੋਗਰਾਮ ਦੀ ਉਦਾਹਰਣ ਅਨੁਸਾਰ ਕੋਡ ਟਾਈਪ ਕਰੋ।

4. HTML ਕੋਡ ਟਾਈਪ ਕਰਨ ਤੋਂ ਬਾਅਦ ਹੁਣ ਇਸ ਨੂੰ File -> Save ਆਪਸ਼ਨ ਜਾ ਸ਼ਾਰਟਕੱਟ ਕੀਅ Ctrl+S ਦੀ ਮਦਦ ਨਾਲ save ਕਰੋ। ਫਾਇਲ ਨੂੰ save ਕਰਦੇ ਸਮੇਂ ਇਸਦੇ ਨਾਂ ਨਾਲ HTML ਦੀ extension .html ਟਾਈਪ ਕਰਨਾ ਨਾ ਭੁੱਲੋ, ਜਿਵੇਂ ਕਿ: filename.html ਉਦਾਹਰਣ ਲਈ : index.html

ਜਾਂ Try Demo ਤੇ ਕਲਿੱਕ ਕਰਕੇ Online HTML Editor ਦੀ ਵਰਤੋਂ ਕਰਕੇ Online ਹੀ Coding ਕਰੋ।

 

HTML Documents

All HTML documents must start with a document type declaration: <!DOCTYPE html>.

The HTML document itself begins with <html> and ends with </html>.

The visible part of the HTML document is between <body> and </body>.


<!DOCTYPE html>
<html>
<head>
<title>Example Page</title>
</head>
<body>

<h1>Introduction to HTML</h1>
<p>HTML stands for Hypertext Markup Language</p>

<p>HTML ਦਾ ਅਰਥ ਹੈ ਹਾਈਪਰਟੈਕਸਟ ਮਾਰਕਅੱਪ ਲੈਂਗੂਏਜ</p>

</body>
</html>


Output


The <!DOCTYPE html> Declaration

<!DOCTYPE html> ਟੈਗ HTML ਦੇ ਵਰਜ਼ਨ (Version) ਨੂੰ ਬਿਆਨ ਕਰਦਾ ਹੈ। ਇਸ ਟੈਗ ਨਾਲ ਇਹ ਦਰਸਾਇਆ ਜਾਂਦਾ ਹੈ ਕਿ HTML ਡਾਕੂਮੈਂਟ html ਦੇ ਵਰਜ਼ਨ 5 ਦੀ ਵਰਤੋਂ ਕਰ ਰਿਹਾ ਹੈ। ਇਹ ਟੈਗ ਸਿਰਫ ਇੱਕ ਵਾਰ ਡਾਕੂਮੈਂਟ ਦੇ ਸਿਖਰ ਤੇ (ਕਿਸੇ ਵੀ HTML ਟੈਗ ਤੋਂ ਪਹਿਲਾਂ) ਲਿਖਿਆ ਜਾਣਾ ਚਾਹੀਦਾ ਹੈ।

The <!DOCTYPE> declaration represents the document type, and helps browsers to display web pages correctly.

It must only appear once, at the top of the page (before any HTML tags).

The <!DOCTYPE> declaration is not case sensitive.

The <!DOCTYPE> declaration for HTML5 is:

<!DOCTYPE html>


HTML Headings

HTML headings are defined with the <h1> to <h6> tags.

<h1> defines the most important heading. <h6> defines the least important heading: 

Example

<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>

 

HTML Paragraphs

HTML paragraphs are defined with the <p> tag:

Example

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

 

HTML Links

HTML links are defined with the <a> tag:

Example

<a href="http://gssskhokhar.com/">This is a link</a>

 

The link's destination is specified in the href attribute. 

Attributes are used to provide additional information about HTML elements.

You will learn more about attributes in a later chapter.


HTML Images

HTML images are defined with the <img> tag.

The source file (src), alternative text (alt), width, and height are provided as attributes:

Example

<img src="/media/images/cat.jpg" alt="cat.jpg">

Run