\"Writing.Com
*Magnify*
SPONSORED LINKS
Printed from https://writing.com/main/books/entry_id/1066806-HTML-Basic
\"Reading Printer Friendly Page Tell A Friend
No ratings.
by GERVIC Author IconMail Icon
Rated: E · Book · How-To/Advice · #2311504
Your made-easy guide to create a webpage.
#1066806 added March 23, 2024 at 11:40pm
Restrictions: None
HTML Basic
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>.


Example:

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>




The <!DOCTYPE> Declaration
         
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. In addition, heading sizes and typography varies with h1 being the largest and h6 being the smallest. Their sizes may also vary depending on the device (desktop, tablet, mobile) but I won't tackle much on that.


Example:
<h1>This is heading 1</h1> :: Bold 2.125rem (34px) in desktop
<h2>This is heading 2</h2> :: Bold 1.875rem (30px) in desktop
<h3>This is heading 3</h3> :: Bold 1.5rem (24px) in desktop
<h4>This is heading 4</h4> :: Bold 1.25rem (20px) in desktop
<h5>This is heading 5</h5> :: Bold 1.125rem (18px) in desktop
<h6>This is heading 6</h6> :: Bold 1rem (16px) in desktop




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. The link's destination is specified in the href attribute.


Example:

<a href="https://www.writing.com">This is a link</a>




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="https://www.writing.com/main/photos/action/display/version/1705586980/id/1069732.png" alt="Gervic Portal Header" width="1920" height="250">
© Copyright 2024 GERVIC (UN: gervic at Writing.Com). All rights reserved.
GERVIC has granted Writing.Com, its affiliates and its syndicates non-exclusive rights to display this work.
Printed from https://writing.com/main/books/entry_id/1066806-HTML-Basic