Not learned HTML yet, but these are some of the things I have picked up so far through my first Django project.
HTML tag
When writing in HTML, we must first introduce this by using the tags. Everything we want to write goes in between:
<html>
<CONTENT GOES HERE>
</html>
Head
The information in the head is not displayed on screen. For example, it may contain the webpage title:
<head>
<title>Abhiyan's Django project</title>
</head>
Body
Contains everything else displayed as part of the web page. Note the div
tags which divides sections.
<body>
<div>
<h1>Hello there</h1>
</div>
</body>
Basic HTML
Here is my first webpage written in HTML!
- [1-4] Opening HTML tag and title of the webpage
- [6-9] Introducing the body, H1 title
- [11-14] H2 and H3 subtitles
- [16-22] Line breaks and paragraph tags in the body
- [24-27] Some quick formatting in italics and bold
- [29-31] Link
- [33-43] Lists and closing tags
<html>
<head>
<title>Abhiyan's Django project</title>
</head>
<body>
<div>
<h1>Hello there</h1>
</div>
<div>
<h2>This is my first Django project, how exciting!</h2>
<h3>Indeed, very exciting!</h3>
</div>
<div>
<p>Hi there!</p>
<br>
<p>These div tags define a section of the page.</p>
<br>
<p>And these br tags create a break (no closing tag).</p>
</div>
<div>
<p>It works! Isn't that <em>very</em> cool?</p>
<p>It works! Isn't that <strong>very</strong> cool?</p>
</div>
<div>
<p>Visit Google by clicking <a href="https://google.com">here</a></p>
</div>
<div>
<p>Go to the shop and buy:</p>
<ul>
<li>Milk</li>
<li>Eggs</li>
<li>Banana bread</li>
</ul>
</div>
</body>
</html>
Preview
Here's what the above HTML code looks like:
![](../content/images/2020/06/image-1.png)