Skip to main content

One Page HTML

 I tried to write HTML in a single page, I hope it will help in understanding HTML quickly.

==============================

<!doctype> element: it stands for document type. It should be declared at the very beginning of HTML source code.
Example:
<!doctype html>

==============================

HTML is case-insensitive language, you could write <!DOCTYPE HTML> as well, but it is always good to stick with one writing style.

==============================

Root element <html>: after <!doctype> declaration is made, the root element starts; and everything comes in between opening and closing of root element.
Example:
<!doctpe html>
<html>
...
</html>

==============================

Attribute "lang": "lang" stands for language, it is declared in root element.
Example:
<!doctype html>
<html lang="en">
...
</html>

==============================

<head> element: after root element, <head> element starts; and between opening and closing of head element many things such as metadata, title, link, stylesheet, and javascript come.
Example:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Learning about Head element </title>
<meta name="keywords" content=" some keywords">
<link rel="canonical" href="url type you prefer">
<link href="style.css" rel="stylesheet">
<style>
body {background-color:#ddd;}
</style>
<script src="script.js"></script>
</head>
<body>
...
</body>
</html>

==============================

<body> element: after closing of </head> element, <body> element starts. And betwen <body></body> element comes 99% HTML: paragraph, image, audio, video, table, form, map and so forth.

==============================

Slash in HTML: "/" forward slash is used.

==============================

Comment in HTML: a web-browser doesn't display HTML comments if they are wrapped in between <!-- and -->. It can be used for single as well as multiple lines.
Example 1:
<!-- This is html comment -->
Example 2:
<!-- This
is
also
html comment -->

==============================

<main> element: it doesn't come inside <article>, <header>, <aside>, <footer> and so forth; but all can come inside it.

==============================

<aritcle> element: like an article in newspaper which contains <header>, images, <aside>, <footer> etc.,
example:
<article>
<header> <h1> Two women </h1></header>
<h3> First woman </h3>
<img src=" " alt=" ">
<p> Story about first woman [...] </p>
<h3> Second woman </h3>
<img src="" alt=" ">
<p> Story about second woman [...] </p>
<footer>
<h1> Few words </h1>
<p> blah blah blah [...] </footer>
</article>

==============================

<header> element: don't get it confused with <head></head>. It shouldn't contain long content, but it should contain thing like heading, search box, menu, ads. Check above example.

==============================

<section> element: it generally works as a child of <article></article>, <header></header>, <aside></aside> and <footer></footer>; it purpose is to put a "section (division) in a content.
Example:
<footer>
<section>
<h4> Social </h4>
<p> Social links [...]</p>
</section>
<section>
<nav>>
<h4> Menu </h4>
<p> Internal links [...]</p>
</nav>
</section>
</footer>

==============================

<nav> element: internal navigation of a site, you may put it in <header></header>, <aside></aside>, or <footer> </footer>. Or wherever you want.
Example:
<header>
<nav>
<h4>Menu </h4>
<ul>
<li> <a href="home.html"> Home </a> </li>
<li> <a href="about.html"> About </a></li>
</ul>
</nav>
</header>

==============================

<hgroup> element: it is used for grouping headings (h1,h2,h3,h4,h5,h6). I only use it when I put more than one heading together. When between two headings come bigger piece of content, then I don't use <hgroup></hgroup>
Example:
<header>
<hgroup>
<h1> Marketing Blog </h1>
<h5> I help people learn marketing </h5>
</hgroup>
</header>

==============================

<figure>, <figcaption> elements: this combination of elements help in giving "a caption" to an image.
Example:
<figure>
<img src=" " alt=" ">
<figcaption>A simpl image</figcaption>
</figure>

==============================

<aside> element: this element may work in plenty of ways, like, pull-quote or sidebar; to give links or ads within content.
Example:
<html>
<head>
<title> </title>
<style>
article {max-width:300px;}
aside {float:right; max-width:200px;}
</style>
</head>
<body>
<article>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor. </p>
<aside> <h1> Green dot movemment </h1></aside>
<p> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </p>
</article
</body>
</html>

==============================

<p> element: this element stands for paragraph, whatever paragrah you type, each paragraph comes in between <p></p>. That's so simple.

==============================

<ins>, <del>, <datetime> and <cite> elements: <ins> stands for insertion, <del> stands for deletion, and <cite> stands for reference. And <datetime> is easy to understand, its format is: YYYY-MM-DDTHH:MM-HH:MM (the last HH:MM is to set time zone).
Example:
<p> My name is <del>Tond</del><ins datetime="2050-12-31T23:11-5:00" cite="http://example.com/original.html"> Bond, James Bond.</ins></p>

==============================

<dfn>, <abbr>, <kbd>, <var> and <samp> elements: <dfn> stands for defining instace of a term, and <abbr> stands for abbreviaton and uses title=" " attribte for fullform. <kbd> element is used for keyboard keys, example 2; <var> is used for variable, example 3; and <samp> is used for computer generated sample output, example 4.
Example 1:
<p> Do it <dfn><abbr title="As Soon As Possible">ASAP</abbr></dfn>, otherwise don't do it. </p>
Example 2:
<p>Press <kbd>F12</kbd> to view in browser</p>
Example 3:
<p> There is <var>n</var> apples in the basket</p>
Example 4:
<p><samp> An error has occured, click to send report!</samp></p>

==============================

<mark>, <sup>, <sub>, <cite>, <q>, <code>, <time>, <a>, <em>, <strong>, <s>, <small>, <i>, <b>, <u> elements.
Check 'em all:
<mark> is used to highlight the text.
Example:
<p>There is an <mark>elephant</mark></p>
<sup> element stands for superscript.
Example:
<p>X<sup>2</sup>y <sup>2</sup></p>
<sub> element is for subscript.
Example:
<p>X<sub>1</sub>Y <sub>1</sub></p>
<cite> element is used for reference.
Example:
<p>My favourite movie <cite>The Godfather</cite> was directed by Francis Ford Coppola.</p>
<q> elements inserts double quotes.
Example:
<p>The man said <q>Women are beautiful</q>. I agreed with him.</p>
<code> element is used for codes, when we display code we wrap them in <code></code>.
Example:
<p><code>activate_default()</code>never worked</p>
<time> element: understanding below would be helpful.
date format = YYYY-MM-DD
time format = HH:MM-HH:MM
attribute = datetime (machine readable value)
<time> element with date.
Example:
<time datetime="2023-10-12" pubdate> October 12, 2023</time>
<time> element with date & time.
<time datetime="2023-10-12T13:59-04:00" pubdate> October 12, 2023 1:59pm</time>
Here flag "pubdate" is optional, stands for publication date.
<a> element is used for linking the text, and clicked it leads us to the linked address.
Example:
<a href=http://example.com> This is a demo website </a>
Element <em> stands for emphasis, and element <strong> is used to give strong importance.
Example:
<p><em>Red beak birds</em> are rare these days.</p>
<p><strong>Err!</strong> Your codes crashed</p>
Element <s> stands for strikethrough, it displays exactly like <del> element, but <s> stands for irrelevant or inaccurate text, not for deletion.
Example:
<p><s>Rat</s> Elephant is a big animal</p>
Element <small> is a small font-size than average, it is used in attribution, disclaimer, copyright, license or to fulfil any legal/ethical requirement.
<p> Bill $140, <small>Taxes Excluded</small> </p>
Elements <i>, <b>, <u> are used for italicize, bold and underline respectively.
Example:
<p>There was a <i>beautiful</i><u> woman</u>, named <b>xyz</b></p>

==============================

<hr> element stands for "horizontal rule", its a horizontal line. I think there should be "vertical rule" for vertical line, there is no such. Pls check example for <hr> element.
Example:
<p> Line 1 </p>
<hr>
<p> Line 2 <p>
<hr>

==============================

<pre> elements stands for pre-formatted text, it removes formating from the text; it is very useful in displaying codes, where all the alighnment and space are required.
Example:
<pre>
<p>There is a big space between this and that.</p>
</pre>

==============================

<blockquote> element: this element is mostly used in blogging for multiple purpose, like text from another source, to gain attention. In blogging, the later one is used blatantly decorated and well alighned with CSS.
Example:
<blockquote>
Your text goes here.
</blockquote>

==============================

<ol>, <ul>, and <dl> elements: <ol> stands for ordered list; <ul> stands for unordered list; and <dl> stands for description list. Let's see how they work:
Example for <ol>:
<ol>
<li> America </li>
<li> England </li>
</ol>
Example for <ul>:
<ul>
<li> America </li>
<li> England </li>
</ul>
In above example <li> is a child of <ol> and <ul>, and it means "list."
Example for <dl>:
<dl>
<dt> Milk Brands:v</dt>
<dd> Amul</dd>
<dd> Mother Dairy</dd>
</dl>
Here <dt>/<dd> works as name/value.

==============================

<div> element: this is most loved and most used block element. You can put any number of <div> inside <div>; but try to use <header>, <article>, <aside>, <section>, <footer> elements where-ever they are needed. Don't use <div> element so ruthlessly.
Example:
<div> anything in between </div>

==============================

<span> element: it is inline element, mostly used for inline style or css class.
Example of inline style:
<p>This is <span style="color:orange">orange color.</span></p>
Example of using using CLASS:
<p>This is <span class="orange">orange color.</span></p>
==============================

<details> and <summary> elements: this combo is mostly used in writing FAQs, when you click on a question, and an answer comes out.
Example:
<details>
<summary> How does a baby born?</summary>
<p> Answer: It takes lots of hard work.</p>
</details>
In above example use attribute "open" if you don't want to hide your answer,like <details open>.

==============================

<address> element: this element has contact information, whether virtual or of a physical place.
Example:
<address>
Contact at:
Twitter, Facebook,
or at->
Box 9454543, Mars
Universe
</address>

==============================

<footer> element: it comes at the last (down) location of a webpage, contains information regarding copyright and attribution. It could be used for menu (<nav></nav>) and contact information (<address></address>)
Example:
<footer>
© Copyright 2009-2018, All Rights Reserved
</footer>

==============================

Embedded elements: <img>, img map, <iframe>, <embed>, <object>, <param>, <video>, <audio>, <source>, <track>, <media>, <mathml>, <svg>. Let's take each one of them by an example and explanation.
Example of <img> element:
<img src=" " alt=" " height=" " width =" ">
Example of img map elements:
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/01/Moscow_July_2011-16.jpg/220px-Moscow_July_2011-16.jpg" width="200" height="200" alt="Planets" usemap="#wow">
<map name="wow">
<area shape="rect" coords="0,0,50,50" href="http://example.com/">
<area shape="rect" coords="50,0,200,200" href="http://example.org/">
</map>
Combo of img and map elements is used to link different part of an image. Pls note that hash (#) is used in <img> element and not in <map> element. Attributes "usemap" and "name" both help in linking <img> element to <map> element.
Example of <Iframe> element:
it embeds other webpage into your webpage.
<iframe src="http://example.com" height="600px" width="600px"></iframe>
Example of <embed> element:
Preferably used for embedding flash.
<embed src="somefile.swf">
Example of <object> element:
It works something like <iframe> / <embed>
<object data=" " type= " ">
Example of <param> element:
<param> stands of parameter.
<object data="xyzfile.wav">
<param name="autoplay" value="false">
<param name="controller" value="true">
</object>
Example of <video> element:
This element is used for embedding video on a webpage.
<video src="thisfile.mp4" controls width=" " height=" "></video>
Example of <audio> element:
<audio src="somefile.mp3" controls></audio>
Example 1 of <source> element for audio
<audio controls>
<source src="somefile.mp3" type="audio/mp3">
<source src="somefile.ogg" type="audio/ogg">
</audio>
Example 2 of <source> element for video
<video controls width="500px" height="400px">
<source src="thisfile.mp4" type="video/mp4">
<source src="thisfile.ogv" type="video/ogg">
</video>
Note: <source> element is used for fallback purpose for <audio> and <video>, when one format doesn't run, it opts for alternate given format.
Example of <track> element:
Skipped. But you can read it at https://www.html5rocks.com/en/tutorials/track/basics/.
Example of <media> elements:
Above <audio>, <video>, <source> and <track> elements come under media elements.
Example of MathML element:
MathML is a Mathematical Markup Language. Skipped. But you can read it at https://www.w3.org/TR/MathML2/chapter2.html.
Example of SVG element:
SVG (Scalable Vector Graphics). Skipped. But you can read it at https://www.ibm.com/developerworks/library/wa-scalable/index.html.

==============================

<a>, <link>, and <area> elements:
Example of <a> element:
<a href="www.example.com"> some text </a>
Example of <link> element:
<link> element is used between <head></head> of a webpage, for example, to link a stylesheet.
<link rel = "stylesheet" href = "style.css">
Example of <area> element:
It is used for linking different part of an image, see above "img map" element.

==============================

<table> element: main child elements of <table> are <caption>, <tr>, and <td>; <tr> stands for row (horizontal), and <td> stands for column.
Example:
<table border="1">
<caption> my table & chair </caption>
<tr><td> first chair </td><td> second chair </td></tr>
<table>

==============================

<form> element: here I used <fieldset> and <legend> for decorating a form. <label> help selecting input-field, when you click on the "Name"; attribute "autofocus" helps input-field to get selected just by itself; attribute "placeholder" suggests a text hint to a user; attribute "required" displays a hint that input-field must be filed, and a user can't go ahead without filling it. Attribute "disabled" disable a form. Or you can use "disabled" attribute in the submit button: <input type="submit" disabled>.
Example:


<form>
<fieldset>
<legend>Fill in the form</legend>
<p> <label>Name: <input type="text" autofocus placeholder="Pls write your name" required disabled></label></p>
<p> <input type="submit"></p>
</fieldset>
</form>

==============================

THE END.

Comments

Popular posts from this blog

Golden Rule Of Three Years To Get Success

Give yourself completely to whatever you like for three years -- let it be your career, business, health or any other thing of life. Why three years, exactly? Because what is the advantage of sticking to something which isn't giving any result. Time is precious, don't waste if the results aren't coming. Why not less than three years? If we spread these three years for success, we can assume first year is dominated by getting knowledge of the field, second year dominated by execution, and the third year comes the maturity where knowledge and experience of execution strike for success.  As an exeption we can stretch these three years into five or six years -- only when there are uncontrollable issues like of health or circumstantial issues.

Name List Of 64 Yogini / चौँसठ योगिनी

It is a list of 64 Yogini, if you want these names in Stotra form you can get from another post of this blog. These names are very useful for doing, Jaap, Puja, Tarpan, and Havan. These names are also used in making 64 Yogini Yantra in which there are 64 squares and in each square, name of each Yogini is written, then everyday worship of this Yantra starts.  For Pujan (Poojan): ओं ---------- देव्यै पूजियामि नम: ! (e.g., ओं गजानना देव्यै पूजियामि नम: ! ) For Tarpan: ओं ---------- देव्यै  तर्पयामि नम: ! (e.g., ओं गजानना देव्यै  तर्पयामि नम: !) Together Pujan+Tarpan: ओं ---------- देव्यै   पूजियामि / तर्पयामि नम:: ! (e.g., ओं गजानना देव्यै   पूजियामि / तर्पयामि नम:: ! ) For Jaap : ओं ---------- देव्यै नम:! (e.g., ओं गजानना देव्यै नम:!) For Havan:  ओं ---------- देव्यै स्वाहा ! (e.g., ओं गजानना देव्यै स्वाहा !) Note: in the empty space ( ---------- ) you can fill the name of each yogini for each time. List of 64 Yogini / चौँसठ योगिनी For better readability I put this list in four parag

108 Names Of Shri Surya From Mahabharata

Surya (Sun) is the most important planet as well as a deity. Worshiping Surya increases prana-shakti (life-force), it rays destroy many diseases and it is the biggest source of never ending energy. There is a Strota, called Surya-Kavach, it is chanted for protection, as a deity his protection is very strong — remember the case of Karna in Mahabharata, he was invincible due to Surya-Kavach. This Surya-Kavach wasn’t as it is shown in movies, it was a Mantrik protection which Karna had and on Indra request he promised not to use it in the war. We take note of popular deities, but Surya as a deity is not lesser than others — though there are less Sanskrit literature on Surya (as I know), but whatever it is, like Surya Kavach and Aditya Hriday Strota, I think, is very potent. English Name | हिंदी नाम 1) Om Suryaay Namah | ॐ सूर्याय नम: 2) Om AryMane Namah | ॐ अर्यमणे नम:

Shri Janaki Navami Vrat & Sita Anupras

 Sita is also known as Janaki, her festival that is Janaki Navami comes on Falgun Sudi Navami. This day is her birthday and she is worshiped, इस दिन सीताजी को समस्त पूजा सामग्री से पूजा कर सुहाग की वस्तुओ से उनका श्रृंगार करना चाहिए जैसे की बिंदी, मेहँदी, चूड़ी, काजल, लिपस्टिक, महावर, इत्यादि। ऐसा कहा जाता है की सुहाग की वस्तुओ से पूजा करने पर पूजा करने वाली महिलाओ का भी सुहाग बना रहता है। I think she should be worshiped with Ram, Lakshman & Hanuman ji, ‘coz she likes them a lot. Double Benefit

Essential Nyas For A Sadhak To Do Everyday

Nyas means to establish something (Devi / Devta energy) in our body: it purifies our body and makes our body and mind worthy of chanting a mantra / stotra. A Sadhak should do भूत-शुद्धि, बहिर्मातृका न्यास, अन्तर्मातृका न्यास, and षोढा-न्यास daily, 'coz we worship Devta by becoming a Devta, and in that Nyas helps us a lot. In every mantra generally many kinds of Nyas are given prior to chanting a mantra, they are usually shorter and doesn't take much time. They are essential and shouldn't be skipped. These  भूत-शुद्धि, बहिर्मातृका न्यास, अन्तर्मातृका न्यास, and षोढा-न्यास take comparatively longer time duration.  भूत-शुद्धि means purification of five elements in our body, that is Earth (Prithvi), Water (Jal), Fire (Agni), Air (Vayu), and Ether (Aakash). बहिर्मातृका Nyas and अन्तर्मातृका Nyas, establish  "energy of our VarnMala" in our body-parts and in our chakras respectively.   षोढा-न्यास is of two types Lagu Shoda Nyas and Maha Shoda Nyas.

Devi Lalita Vrat & Puja Vidhi

 This festival is celebrated on Bhadon Vadi Chhath. It is for Devi Lalita, this day she is worshiped. Women worship Devi Lalita by Vrat and Puja, ‘coz they want to see the Goddess as their friend. And as a friend Devi is supposed to solve their problems of life and fulfil other genuine wishes. गंगा द्वारे कुशावंते विल्वके नील पर्वते ॥ स्नात्वा कनखले देवि हरं लब्धवतीं पतितं ॥ ललिते सुभगे देवी सुख सौभाग्य दायिनी ॥ अनंतं देहि सौभाग्यम मह्यं तुम्भ नमोनमः:॥ In her worship, above stotra is chanted which means — हे देवी ! आपने गंगाद्वार, विल्वक, नीलपर्वत एवं कनखल इत्यादि पवित्र तीर्थो में स्नान कर भगवान शंकर को पति के रूप में वरण किया है, हे सौभाग्यदायिनी देवी ललिता आपको नमस्कार करता हूँ (करती हूँ ) ।

Mantra To Remove Poverty & Attract Lakshmi On Diwali

 Here are few things that previous generations used to do on Diwali. Mantra to remove poverty: This mantra is often chanted to beat away the poverty from the home. This is ritualistic where people imagine “poverty” and other kinds of negativity are going away and home is getting purer and cleaner to attract goddess Lakshmi. काने भेड़े दुखदायी दरिद्र तू मेरे घर से जा अब भाग ॥ देवी भगवती लक्ष्मी आई, तज घर मेरा और जा भाग ॥ डंडा बजाऊ मार लगाऊ नहीं तो जा अब भाग ॥ लक्ष्मी जी का वास हो गया मेरे यहाँ, तेरा नहीं निस्तार ॥ Mantra to attract Lakshmi:

18 Types Of Puja (Worship) Acc. To Fetkarini Tantra

Puja enhances our devotion to our Deity, and it is not an expensive affair we can learn to do it ourselves. Puja makes our heart-center (Air element) stronger, as our devotion increases it is bound to be happen. It is written in Fetkarini Tantra, about 18 kinds of worship (Puja). I think during Navratri, Holi, Deepawali (Lakshmi), Ganesh Chaturthi, MahaShivRatri and during all major festivals, Panchopachar Puja isn't sufficient one should go for either Shodosopchar Puja (16 types) or below 18 types of Puja. Try to do this in Navratri or at the time of Ganesh Chaturthi, because during these two festivals most of the Hindu do Murti Visarjan (point 18). आसनावाहनं चार्घ्य, पाद्यमाचमनं तथा। स्रानं वासोपवीतिं च, भूषणानि च सर्वशः ।। गन्धं पुष्पं तथा दीपं, धूपोऽत्रं चापि तर्पणम्। माल्यानुलेपनं चैव, नमस्कारो विसर्जनम् ।।  अष्टादशोपचारैस्तु, मातृ पूजां समाचरेत् ।। Means:1 आसन, 2 आवाहन, 3 अर्घ्य, 4 पाद्य, 5 आचमन, 6 स्नान, 7 वस्त्र, 8 उपवीत (जनेऊ), 9 आभूषण, 10 गन्ध, 11 पुष्प, 12 धूप, 13 दीप, 1