Workspace
Published in

Workspace

Image from LogRocketBlog

Headstart to HTML5

A Quick Guide to the basics of HTML5 for beginners

Image from Twitter
<!DOCTYPE html>
<html>
<head>
<title> My First Code </title>
</head>
<body>
<h1>Hello, World! </h1>
<p>My first paragraph. </p>
</body>
</html>
Image from Eizo Globa
Image from Medium
<img src=”MyCat.jpg” alt=”My Cat’s image”>

Nesting elements

<p>My cat is <strong>very smart. </p></strong>
<p>My cat is <strong>very</strong> smart. </p>

1. HTML tag

2. Head tag

3. Title tag

4. Body tag

Image from MentalStack
<BODY background = “filename.gif”>
<BODY bgcolor = “olive” text = “magenta” link = “aqua” vlink = “lime” alink = “red”>
<BODY leftmargin = “value”><BODY topmargin = “value”>

5. HTML Headings

<html>
<head>
<title> Sample </title>
</head>
<body>
<h1>This is heading 1 </h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>

6. HTML Paragraphs

<html>
<head>
<title> Sample </title>
</head>
<body>
<p> Put all your energy in things that excite you. </p>
</p>Even if it doesn’t make sense to people, all that matters is your happiness. </p>
</body>
</html>
<P align = alignment>

7. FONT and BASEFONT Tags

<FONT size = 4 face = “Consolas” color = “purple”>
<!DOCTYPE html>
<html>
<head>
<title>Font Color</title>
<style>
body {
font-size:40px;
font-weight:bold;
text-align:center;
}
</style>
</head>
<body>
<font color = “#009900”>Angels and Demons</font><br />
<font color = “green”>The Lost Symbol</font>
</body>
</html>

8. Horizontal Rule Tags

<!DOCTYPE html>
<html>
<head>
<title>hr tag with attributes</title>
</head>
<body>
<p>Normal horizontal line.</p>
<hr>
<p>Horizontal line with height of 30 pixels</p>
<hr size=”30">
<p>Horizontal line with height of 30 pixels
and noshade.</p>
<hr size=”30" noshade>
</body>
</html>

9. HTML Image tag

<img src = “url” alt=”alternatetext”>
<!DOCTYPE html>
<html>
<head>
<title>HTML Image Tag</title>
</head>
<body>
<img src = “https://www.indiewire.com/wp-content/uploads/2020/08/Screen-Shot-2020-08-20-at-3.16.21-PM.png"
alt = “Batman” height = “150” width = “140” />
</body>
</html>

10. HTML Link

<a href=”url”> link text </a>

Lists

<ul>
<li>milk</li>
<li>eggs</li>
<li>bread</li>
<li>hummus</li>
</ul>
<<ol>
<li>milk</li>
<li>eggs</li>
<li>bread</li>
<li>hummus</li>
</ol>

Tables

<!DOCTYPE html>
<html>
<body bgcolor=”pink”>
<table bgcolor=”silver” align=”center”
border=”5" cellspacing=”5"
cellpadding=”5">
<tr bgcolor=”purple”>
<caption align=”top”>
<h2 style=”color: #ff3300;”>
Train
</h2>
</caption>
<th bgcolor=”magenta”>train number</th>
<th bgcolor=”magenta”>departure</th>
<th bgcolor=”magenta”>arrival</th>
<th bgcolor=”magenta”>category</th>
</tr>
<tr>
<td>12267</td>
<td>23:25</td>
<td>05:15</td>
<td>duronto</td>
</tr>
<tr>
<td>12426</td>
<td>19:40</td>
<td>05:05</td>
<td>rajdhani</td>
</tr>
<tr>
<td>12019</td>
<td>06:05</td>
<td>13:15</td>
<td>shatabdi express</td>
</tr>
</table>
</body>
</html>

Comments

--

--

Make learning your daily ritual

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gayathri Ramesh

They call me the CEO of sarcastic remarks, but then I don't brag about it.