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.

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 | ॐ अर्यमणे नम:

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 f...

Moringa Soup 🍲

I don't like taste of Moringa but as it has a lot of health benefits, I think it should be eaten once in a week or in fifteen days. Health benefits of Moringa leaves Though bitter in taste, it is considered rich in nutrients and antioxidants. It has anti-inflammatory properties, also it is supposed to lower down cholesterol and blood sugar level. It is considered to have numerous health advantages. Where to find Moringa?  Available at any vegetable shop, weekly mandi market or search 'em at online stores. Moringa Soup Ingredients: Moringa cut into 2 inches pieces, onions, garlic, masoor dal (लाल वाली), ginger, shimla mirch, green chili, rock salt, kali mirch, and turmeric powder.

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.

Nutritional Diet Plan (Raw) To Any Disease

It may help in any kind of chronic disease -- we just need to learn how to prepare them.  Things to eat / drink: Smoothie Salad / fruits / vegetables Steamed vegetables (when raw vegetables are difficult to eat.) Juices Soup Coconut Milk Cold-pressed edible virgin coconut oil (to be taken as raw one to three teaspoons a day.) Taste enhancers: Chutney / Tahini / Kokum etc. Crushed "garlic, ginger, raw turmeric, raw amala, green chilly" (It is v. good) Banana Icecream (sometimes, not to be eaten regularly, as it may slow down digestive fire.) Once in a day Moon Dal and brown rice. Soaked peanuts and dry-fruits in lower quantity initially. We need to choose what to eat in breakfast, lunch, evening-snacks and dinner. In raw diet, we need to eat a lot.  Just open Youtube and search for "Smoothie" you may get plenty of videos, like that you can search for Soup, Chutney and other items. Try to use above diet plan for a week. Also one needs to check nutritional deficiency f...

Why Two Types Of Navratri Are More Popular

Navratri comes four times in a year: 1) In Chitra (Vasant) Maas, 2) In Sharad (Ashwin) Maas, 3) In Ashadha (आषाढ़) Maas, and 4) in Magh Maas. As it is written in the following Shaloka: चैत्रे आश्विने तथाषाढे, माघे कार्यों महोत्सवः। नव रात्रे महाराज! पूजा कार्या विशेषतः ।।  Generally, we are told that two Navratri are for public and rest two Navratri are called Gupt Navratri. These two Gupt Navratri are for the Sadhak --- but it isn't the exact fact. All four Navratri are for general public and for all dedicated Devi Sadhak, there is no secret. Fact is during the time of Chaitra and Sharad, weather changes a lot -- so there are chances of getting diseases. During Navratri due to fasting and purification, all kind of diseases can be avoided, that's why these two Navratri gained significance among public.

Shap Vimochan & Shapoddhar (शाप-विमोचन एवं शापोद्धार) of Shri Batuk Bhairav Mantra / Stotra

The meaning of "Shap" is "Curse," many mantras / Stotras are cursed / Keelit by Rishis and Devatas to stop their misuse. If powerful thing goes in wrong hands, only misuse happens. To remove that Shap, or say to unlock them some Vidhis (methods) were used to be given. So, below is like that. (Pls also consider Utkeelan Mantra & Stotra of Shri Batuk Bhairav .) The Shap Vimochan (Shapoddhar) Vidhi of Shri Batuk Bhairav Mantra / Stotra is as the followings: Before chanting Batuk Bhairv Mool Manta / Stotra, 1) chant below mantra ten times, 2) and Batuk Stav for once. मन्त्र: ॐ ह्रीं बटुक ! शापं विमोचय विमोचय ह्रीं क्लीं । बटुक-स्तवः ॐ वृन्दारक - प्रकर वन्दित - पाद - पद्मम्, चञ्चत् - प्रभा - पटल - निर्जित- नील पद्मम् ।  सर्वार्थ साधकमगाध दया समुद्रम्, वन्दे विभुं बटुक - नाथमनाथ - बन्धुम् ।।1 ॥