Toworkon
Toworkon
io/s/added-styles-to-walk-through-your-first-blog-page-forked-
9vkq6m?file=/index.html:0-14863
html....
<!DOCTYPE html>
<html>
<head>
<title>Walk through your first HTML page | blog.codingninjas.in</title>
</head>
<body>
<header id="main-header">
<link rel="stylesheet" href="style.css" />
<a href="http://blog.codingninjas.in/" id="logo"
><img
src="https://ninjasfiles.s3.amazonaws.com/0000000000001394.png"
alt="coding ninjas logo"
/></a>
<div>
<p id="site-title">
<a href="http://blog.codingninjas.in/">blog.codingninjas.in</a>
</p>
<p id="about-site">Coding Ninjas Official Blog</p>
</div>
<div id="header-image-container">
<img
src="https://ninjasfiles.s3.amazonaws.com/0000000000001395.png"
alt="coding ninjas love coding"
/>
</div>
</header>
<div id="content">
<main>
<header id="blog-header">
<h1>A step-by-step walk through of your first HTML page</h1>
</header>
<article id="blog-content">
<div id="blog-image-container">
<img
src="https://ninjasfiles.s3.amazonaws.com/asset_0000000000000010_1548494846_coding-
ninjas-step-by-step.png"
alt="Step-by-step walk"
/>
</div>
<p>
HTML is short for HyperText Markup Language.Basically, itâs the
âcodeâ behind every webpage â even this one. If youâre just
beginning to learn HTML, let us tell you that itâs a fairly easy
task. HTML, without styling, canât do anything more than setting a
layout, drawing a table, or creating frames â but it is handy as it
helps you structure the content correctly, which is important when
you sit down to add style to your HTML.
</p>
<img
src="https://ninjasfiles.s3.amazonaws.com/asset_0000000000000005_1548426333_coding-
ninjas-code-screenshot.jpeg"
alt="Code screenshot from laptop"
/>
<p>
However simple this might seem, it is a mighty useful tool when it
comes to full-fledged web development. Various tools easily
eliminate the HTML coding from your work process â but if you want
to be in full control of your web-page, youâll need to have some
command over HTML.
</p>
<p>
Through this article, we aim to give you the essential HTML building
blocks thatâll help you get up and running. Reading this, youâll be
able to understand an HTML source code and even modify it for your
own good!
</p>
<section>
<h3>Step One - TAGS</h3>
<img
src="https://ninjasfiles.s3.amazonaws.com/asset_0000000000000004_1548426302_coding-
ninjas-angle-brackets.png"
alt="Angle Brackets photo"
/>
<p>
Tags are what youâll see the most when you look at any HTML source
code. A tag can ideally be seen as a wrapper to any item on your
HTML document. Tags tell what magic is to be done on the content
enclosed by them.
</p>
<ol>
<li>
<tag-example-1>I need a closign tag<tag-example-1>
</li>
<li><tag-example-2/>I don't need a cloding tag.</li>
</ol>
<p>
In the first example, the sentence is wrapped by two tags. The
first one is called the opening tag and the second one is called
the closing tag. Everything in between is affected by the
properties of the tag. Very commonly used examples of such tags
are <html>, <head>, <body>, <strong>, etc.
</p>
<p>
The second example tags about loner tags â as in, they donât need
a closing tag to function. Although itâs not required, these type
of tags are often written as <tag/> to make the debugging of
code easier. Common examples of such tags are <hr/> â used
for horizontal line, <br/> â to break the line, etc.
</p>
</section>
<section>
<h3>
Step Two â HTML, HEAD, and BODY: The three pillars of your
document
</h3>
<img
src="https://ninjasfiles.s3.amazonaws.com/asset_0000000000000007_1548426400_coding-
ninjas-html-head-body.jpg"
alt="Head Body photo"
/>
<p>
These tags are essential for any HTML document. They parcel out
the significant parts of your HTML code.
</p>
<ul>
<li>
<BODY> </BODY> is placed below your <HEAD>
tag, and everything that you want to be displayed on your screen
comes under this tag. Text, images, links, and pretty much
anything you can see in your browser live inside this tag.
</li>
<br />
<li>
<HTML> </HTML> wraps your entire code. Everything
else in your HTML document needs to come inside these tags.
</li>
<li>
<HEAD> </HEAD> includes things like title, styles,
and scripts. Head is usually present at the top (hah!), just
inside the </HTML> tag.
</li>
</ul>
</section>
<section>
<h3>Step three â A few tags thatâll make your page pretty</h3>
<p>
Now that you know how to set up the skeleton of your document,
letâs proceed with the things that will go inside your
<BODY> tag and do some magic!
</p>
<ul>
<li><b> </b> makes your text look <b>bold</b></li>
<li><i> </i> makes you write in <i>cursive</i></li>
<li>
<u> </u> <u>underlines</u> what you just wrote
</li>
</ul>
<hr />
<code><html></code>
<br /><br />
<code>  <head> </head></code>
<br /><br />
<code>  <body></code>
<br /><br />
<code
>    <i> I am italics! </i>
<br/></code
>
<br />
<code
>    <b> I am bold! </b> <br/></code
>
<br />
<code
>    <u> And me, well, I'm underlined! </u>
<br/></code
>
<br /><br />
<code>  </body></code>
<br /><br />
<code></html></code>
<hr />
<br />
<br />
<p>
Should produce something like this on your browser: Donât fret too
much about the <br/>. Itâs just for breaking the line so
that you can start from the next line. Enter key does little when
it comes to changing lines in your HTML document.
</p>
<img
src="https://ninjasfiles.s3.amazonaws.com/asset_0000000000000009_1548426552_coding-
ninjas-html-page-screenshot.png"
alt="Bold, Italic and Underline"
/>
<ul>
<li>
<br/> breaks the line, making you continue to the next
line
</li>
<li>
<p> stands for paragraph. It divides your content into
paragraphs
</li>
</ul>
<p>
<i
>Note: You need to use these tags as space and enter keys do
very little when it comes to formatting content inside an HTML
document.</i
>
</p>
<section>
<h4>Heading Tags:</h4>
<p>
HTML provides you with six tags, from <H1> </H1> to
<H6> </H6> to help you create different sized
headers quickly.
</p>
<img
src="https://ninjasfiles.s3.amazonaws.com/asset_0000000000000006_1548426364_coding-
ninjas-headings.png"
alt="All heading photos"
/>
</section>
<section>
<h4>Inserting an Image:</h4>
<p>
All thatâs good, but what fun without images on the webpage?
Donât worry, <IMG/> to the rescue! The image tag has a
mandatory attribute called âsourceâ. Basically, it tells the
browser where it should look for the image. The syntax goes
something like:
</p>
<p>
Furthermore, it also has attributes like height and width that
let you specify the height and width you want your image to
take.
</p>
</section>
<section>
<h4>Lists:</h4>
<p>
HTML has two types of lists â ordered and unordered. Each item
of your list has to be enclosed in a tag. The syntax for
creating a list is fairly simple.
</p>
<hr />
<code><ul></code>
<br />
<code>  <li></code>
<code>Item 1</code>
<code></li></code>
<br />
<code>  <li></code>
<code>Item 2</code>
<code></li></code>
<br />
<code>  <li></code>
<code>Item 3</code>
<code></li></code>
<br />
<code></ul></code>
<hr />
<br />
<br />
<p>
This, by the way, was an example of an unordered list. For an
ordered list, all you need to do is replace <ul> with
<ol> and </ul> with </ol>.
</p>
<hr />
<code><html></code>
<br /><br />
<code>  <head> </head></code>
<br /><br />
<code>  <body></code>
<br /><br />
<code>    <ul></code>
<br />
<code
>      <li> I am unordered list's item 1!
</li></code
>
<br />
<code
>      <li> I am unordered list's item 2!
</li></code
>
<br />
<code
>      <li> I am unordered list's item 3!
</li></code
>
<br />
<code
>      <li> I am unordered list's item 4!
</li></code
>
<br />
<code>    </ul></code>
<br />
<code>    <ol></code>
<br />
<code
>      <li> I am ordered list's item 1!
</li></code
>
<br />
<code
>      <li> I am ordered list's item 2!
</li></code
>
<br />
<code
>      <li> I am ordered list's item 3!
</li></code
>
<br />
<code
>      <li> I am ordered list's item 4!
</li></code
>
<br />
<code>    </ol></code>
<br /><br />
<code>  </body></code>
<br /><br />
<code></html></code>
<hr />
<br />
<br />
<img
src="https://ninjasfiles.s3.amazonaws.com/asset_0000000000000008_1548426521_coding-
ninjas-html-page-list-screenshot.png"
alt="Ordered and Unordered List on HTML page"
/>
<p>
All of these tags, when arranged coherently, will provide you
with a simple webpage consisting of images, headings, and lists.
Further, there are various tags that HTML supports, and we
thoroughly recommend you to check them out and play with them!
</p>
</section>
<section>
<h2>In Conclusion</h2>
<p>
You now know enough to skim through and understand any part of
an HTML code. We request you to go ahead and try skimming
through the source code of any website (youâll find some tags
you donât know, but thatâs how you learn!). Oh, and welcome to
the world of web development. With HTML under your belt, your
next stop should be making your page look beautiful using CSS.
</p>
<p>
Let us know if you had any problems in the article, and donât
forget to have a look at a source code or two!
</p>
</section>
</section>
</article>
</main>
</div>
</body>
</html>
css...
body {
margin-left: 60px;
margin-right: 20px;
font-family: serif;
}
img {
width: 100%;
}
/*-----header-----*/
#main-header {
margin-top: 60px;
}
#logo img {
max-width: 210px;
}
#site-title {
margin-bottom: 0;
}
#site-title a {
font-size: 1.8rem;
color: #1a1a1a;
text-decoration: none;
font-weight: bold;
line-height: 1.25;
font-family: sans-serif;
}
#site-title a:hover {
color: #dc6520;
}
#about-site {
color: #3c5349;
margin-top: 5px;
}
#header-image-container {
margin-top: 50px;
}
/*-----main-----*/
#content {
margin-top: 80px;
}
main {
width: 70%;
display: inline-block;
}
#blog-header {
margin-bottom: 50px;
}
#blog-header h1 {
font-size: 3.2rem;
color: #13222c;
font-family: sans-serif;
}
/*-----author container-----*/
#author-container {
display: inline-block;
width: 29%;
margin-bottom: 30px;
vertical-align: top;
font-family: sans-serif;
font-size: 1rem;
}
#author-img {
max-width: 60px;
border-radius: 50%;
margin-right: 1rem;
margin-bottom: 1rem;
vertical-align: middle;
}
#author-name {
display: block;
margin-bottom: 1rem;
}
#author-container .slash {
display: none;
}
#author-container a {
color: #3c5349;
text-decoration: none;
}
#author-container a:hover {
color: #dc6520;
text-decoration: underline;
}
/*-----views-----*/
#views {
margin-bottom: 3px;
}
#views img {
margin-left: 2px;
width: 18px;
margin-bottom: -2px;
}
#views span {
font-size: 1rem;
font-family: sans-serif;
}
/*-----blog content-----*/
#blog-content {
display: inline-block;
font-size: 1.1rem;
word-spacing: 1px;
line-height: 1.4;
width: 70%;
}
#blog-content h4.h-style {
margin-bottom: 0;
}
#blog-content ol li p {
margin-top: 10px;
}
#blog-content .sources a {
text-decoration: none;
}
/*-----aside-----*/
aside {
display: inline-block;
vertical-align: top;
margin-left: 3%;
width: 25%;
}
.widget {
margin-top: 3.5rem;
border-top: 4px solid black;
line-height: 1.6;
font-size: 1.1rem;
}
.widget a {
color: #dc6520;
text-decoration: none;
}
.widget a:hover {
color: #1a1a1a;
}
.widget .widget-title {
text-transform: uppercase;
font-family: sans-serif;
line-height: 1.4;
letter-spacing: 0.05rem;
font-size: 1.1rem;
word-spacing: 0.1rem;
}
.widget li {
margin-bottom: 0.25rem;
}
.widget p {
margin-bottom: 0;
margin-top: 0;
}
label {
color: #3c5349;
padding-bottom: 3px;
display: block;
font-size: 1rem;
}
input,
textarea {
margin-bottom: 15px;
padding: 4px 10px;
background-color: #f7f7f7;
border: 1px solid #d1d1d1;
border-radius: 2px;
color: #686868;
width: 90%;
display: block;
line-height: 1.6;
font-size: 1.05rem;
color: #000000;
}
button[type="submit"] {
background-color: #1a1a1a;
font-size: 0.9rem;
border: none;
border-radius: 4px;
color: #fff;
letter-spacing: 0.1rem;
line-height: 1;
padding: 12px 18px;
text-transform: uppercase;
}
button[type="submit"]:hover {
background-color: #dc6520;
}
#subscription .sub-btn {
margin: 10px 0 0;
}
#search form {
margin-top: 30px;
margin-bottom: 70px;
}
#search input {
display: inline;
width: 80%;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
margin-bottom: 0;
}
#search img {
width: 18px;
vertical-align: middle;
}
#search button {
width: 12%;
margin-left: -4px;
padding: 7px 0 6px;
border-radius: 0 5px 5px 0;
line-height: 1.6;
}
#recent-posts li,
#recent-comments li {
margin-bottom: 0.4rem;
}
#recent-comments .name {
text-transform: uppercase;
font-size: 1rem;
}