{"id":987,"date":"2020-09-19T17:40:23","date_gmt":"2020-09-19T17:40:23","guid":{"rendered":"https:\/\/www.datatype.co.in\/blog\/?p=987"},"modified":"2022-11-15T05:52:56","modified_gmt":"2022-11-15T05:52:56","slug":"how-to-develop-website-part-1","status":"publish","type":"post","link":"https:\/\/datatype.co.in\/blog\/how-to-develop-website-part-1\/","title":{"rendered":"How to Develop a Website &#8211; Part 1"},"content":{"rendered":"\n<p>In this tutorial, I will teach you how to develop a website from scratch step by step. I will start from basics and gradually move to advance level. In order to develop a website, you should know three technologies &#8211; HTML, CSS and JavaScript. <strong>HTML <\/strong>is used to develop web pages, <strong>CSS <\/strong>is used to design and beautify web pages and <strong>JavaScript <\/strong>is used to make the web pages dynamic. Let&#8217;s  start with HTML.<\/p>\n\n\n\n<p><strong>Introduction:<\/strong><\/p>\n\n\n\n<p><strong>H<\/strong>yper<strong>T<\/strong>ext <strong>M<\/strong>arkup <strong>L<\/strong>anguage (HTML) is the markup or tag based language that is used to create web pages or html documents. HTML comes with couple of tags using which we can define the structure of the document  and logically organize the content in it, for example defining headings,  sections, paragraphs and data tables, or embedding images and videos in the page. Collection of such inter-related web pages is known as <strong>Website<\/strong>. <\/p>\n\n\n\n<p>The standard structure or markup of a basic web page is given below &#8211;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html> \n&lt;html>\n  &lt;head>\n    &lt;title>First Web Page&lt;\/title>\n  &lt;\/head>\n  &lt;body>\n    &lt;p> Hello there! &lt;\/p>\n  &lt;\/body>\n&lt;\/html><\/code><\/pre>\n\n\n\n<p>Here the words enclosed with<strong><code>&lt;&gt;<\/code> <\/strong>brackets (like <code><strong>&lt;html&gt;, &lt;head&gt;, &lt;body&gt;<\/strong> <\/code>etc.) are known as <strong>tags<\/strong>.<\/p>\n\n\n\n<p> In HTML we have two types of tags, the first type of tags come in pair &#8211; opening and companion closing tags.  These tags are called <strong>Paired Tag<\/strong> or <strong>Container Tag<\/strong>. A forward slash (\/) is added in the beginning of a tag to close it. For example, <strong><code>&lt;html&gt;<\/code><\/strong> is opening tag and <strong><code>&lt;\/html&gt;<\/code><\/strong> is the companion closing tag. Almost 99% of tags in HTML are paired.<\/p>\n\n\n\n<p>The second type of tags do not have the companion closing tag. Such tags are known as <strong>Singular Tag<\/strong> or <strong>Stand-alone Tag<\/strong> or <strong>Empty tag<\/strong>.  Some of the Singular tags are listed below-<\/p>\n\n\n\n<table class=\"wp-block-table table bordered\"><tbody><tr><td><strong>Tag<\/strong><\/td><td><strong>Name<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td>&lt;hr&gt;<\/td><td>Horizontal Rule<\/td><td>Insert a horizontal line<\/td><\/tr><tr><td>&lt;br&gt;<\/td><td>Line Break<\/td><td>Insert a line break<\/td><\/tr><tr><td>&lt;img&gt;<\/td><td>Image<\/td><td>Insert Image<\/td><\/tr><tr><td>&lt;input&gt;<\/td><td>Form Input<\/td><td>Insert form input<\/td><\/tr><tr><td>&lt;!DOCTYPE&gt;<\/td><td>Document Type<\/td><td> Specify the html version used<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>There are close to 100 tags in HTML, but we end up using only few of them. In the last 12 years, being a Web Developer, I might have used hardly 30-40% of the tags and it is perfectly normal. Some of the most commonly used tags while building web pages are given below &#8211;<\/p>\n\n\n\n<table class=\"wp-block-table table bordered\"><tbody><tr><td><strong>Tag<\/strong><\/td><td><strong>Name<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td>&lt;!&#8211; &#8211;&gt;<\/td><td>Comment<\/td><td>  This tag is used to apply comment in an HTML document <\/td><\/tr><tr><td> &lt;!DOCTYPE&gt; <\/td><td> Document Type <\/td><td> This tag is used to specify the version of HTML <\/td><\/tr><tr><td>&lt;html&gt;<\/td><td>Html<\/td><td>Root element of html document<\/td><\/tr><tr><td>&lt;head&gt;<\/td><td>Head<\/td><td>Contains meta data of the document<\/td><\/tr><tr><td>&lt;title&gt;<\/td><td>Title<\/td><td>Contains page title of the document<\/td><\/tr><tr><td>&lt;body&gt;<\/td><td>Body<\/td><td>Contains document&#8217;s main content<\/td><\/tr><tr><td>&lt;div&gt;<\/td><td>Division<\/td><td>A section in the document<\/td><\/tr><tr><td>&lt;p&gt;<\/td><td>Paragraph<\/td><td>Defines a paragraph<\/td><\/tr><tr><td>&lt;span&gt;<\/td><td>Span<\/td><td>A smaller section<\/td><\/tr><tr><td>&lt;table&gt;<\/td><td>Table<\/td><td>Defines a table<\/td><\/tr><tr><td>&lt;ol&gt;<\/td><td>Ordered List<\/td><td>Defines an ordered list<\/td><\/tr><tr><td>&lt;ul&gt;<\/td><td>Unordered List<\/td><td> Defines an unordered list <\/td><\/tr><tr><td>&lt;li&gt;<\/td><td>List Item<\/td><td> Defines an item in list <\/td><\/tr><tr><td>&lt;form&gt;<\/td><td>Form<\/td><td>Defines a html form to capture user inputs<\/td><\/tr><tr><td>&lt;input&gt;<\/td><td>HTML Form Input<\/td><td>Html for controls<\/td><\/tr><tr><td>&lt;select&gt;<\/td><td>Dropdown List<\/td><td>Defines a dropdown list<\/td><\/tr><tr><td>&lt;option&gt;<\/td><td>Dropdown List Option<\/td><td>Defines a dropdown list option<\/td><\/tr><tr><td>&lt;b&gt;, &lt;strong&gt;<\/td><td>Bold<\/td><td>Makes text bolder<\/td><\/tr><tr><td>&lt;i&gt;<\/td><td>Italic<\/td><td>Makes text italic<\/td><\/tr><tr><td>&lt;u&gt;<\/td><td>Underline<\/td><td>Underline text<\/td><\/tr><tr><td>&lt;sup&gt;<\/td><td>Super Script<\/td><td>Create superscripted text (appears above)<\/td><\/tr><tr><td>&lt;sub&gt;<\/td><td>Sub Script<\/td><td>Create subscripted text (appears below)<\/td><\/tr><tr><td>&lt;h1&gt; to &lt;h6&gt;<\/td><td>Header<\/td><td>Define page headers<\/td><\/tr><tr><td>&lt;a&gt;<\/td><td>Anchor<\/td><td>Create a hyper link<\/td><\/tr><tr><td>&lt;link&gt;<\/td><td>Link<\/td><td>Link external style sheet (CSS) file<\/td><\/tr><tr><td>&lt;script&gt;<\/td><td>Link JavaScript<\/td><td>Link external JavaScript file<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p><code><strong>&lt;html&gt;<\/strong><\/code> is the root tag of a web page, and it contains<strong><code>&lt;head&gt;<\/code><\/strong> and <strong><code>&lt;body&gt;<\/code><\/strong> tags. The  <strong><code>&lt;head&gt;<\/code><\/strong> tag contains information about the web page and other meta data.  The<strong><code> &lt;title&gt;<\/code><\/strong> tag comes under <code><strong>&lt;head&gt;<\/strong><\/code> tag and it contains the title of the web page. Any thing you write inside the title tag will appear in the browser tab when you view the page. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"557\" height=\"195\" src=\"https:\/\/www.datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-12.png\" alt=\"Web Page Title\" class=\"wp-image-1027\" srcset=\"https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-12.png 557w, https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-12-300x105.png 300w\" sizes=\"auto, (max-width: 557px) 100vw, 557px\" \/><\/figure>\n\n\n\n<p>The title tag may also contain many more other tags which I will discuss as we progress. The <strong>body <\/strong>tag contains the actual content of the page, anything you write inside <strong>body <\/strong>tag will be visible in the browser. <\/p>\n\n\n\n<p><strong>Elements and Attributes:<\/strong><\/p>\n\n\n\n<p>In html, a tag along with it&#8217;s content is known as <strong>element<\/strong>. For example, in the following code, <strong>p<\/strong> is an element.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ An element\n&lt;p class=\"text\"> This is a paragraph &lt;\/p><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"617\" height=\"282\" src=\"https:\/\/www.datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image.png\" alt=\"HTML Tag, Attribute, Value and Element\" class=\"wp-image-891\" srcset=\"https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image.png 617w, https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-300x137.png 300w\" sizes=\"auto, (max-width: 617px) 100vw, 617px\" \/><\/figure>\n\n\n\n<p>HTML attributes provide additional information about HTML elements. It is not mandatory that every element should have some attribute. In the above example, the element has an attribute <strong>class<\/strong> with value <strong>text<\/strong>, which is nothing but a CSS class that defines the style of the element. At this point you might not be familiar with CSS. While learning CSS, you will understand the use of this attribute. An element may have multiple attributes as well. Some of the commonly used attributes are &#8211;  <strong>id, class, style and title<\/strong>.<\/p>\n\n\n\n<p>The are some tag specific attributes which can not be used in any other element. For example, <code><strong>src<\/strong><\/code> and <code><strong>alt<\/strong><\/code> can be used with <strong><code>&lt;img&gt;<\/code><\/strong> tag only. Similarly, <strong><code>href <\/code><\/strong>and <strong><code>target<\/code><\/strong> can be used only with <strong><code>&lt;a&gt;<\/code><\/strong> tag.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Only image (img) element may have src, alt attributes\n&lt;img src = \"images\/some-image.png\" alt=\"This text will appear if the image is not found.\"\/>\n\n\/\/ Only anchor (a) element may have href and target attributes \n &lt;a href = \"www.facebook.com\" target=\"_blank\">Go to Facebook&lt;\/a><\/code><\/pre>\n\n\n\n<p><strong>Getting Started:<\/strong><\/p>\n\n\n\n<p>We have sufficient theoretical knowledge now. Let&#8217;s get into coding now!<\/p>\n\n\n\n<p>1. Create a folder anywhere in your computer and give a name of your choice, let&#8217;s say <strong>mywebsite<\/strong>. Open any text editor\/notepad and write the html code given below. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html> \n&lt;html>\n  &lt;head>\n    &lt;title>First Web Page&lt;\/title>\n  &lt;\/head>\n  &lt;body>\n     &lt;h1> Hello world! &lt;\/h1>\n     &lt;p> I am learning HTML &lt;\/p>\n  &lt;\/body>\n&lt;\/html><\/code><\/pre>\n\n\n\n<p>2. Name the file <strong><code>index.html<\/code><\/strong> and save it in the folder you created. Note that html files should be saved with <strong><code>.html<\/code><\/strong> extension. You can also save the file with just <strong><code>.htm<\/code><\/strong> extension, but I will not recommend it. Let&#8217;s code clean.<\/p>\n\n\n\n<p>Technically, <strong><code>index<\/code><\/strong> means first page or home page of your website. Although, it is not mandatory, it is good practice to name it index. It also helps browser to understand which page it should display if there are multiple pages in the folder once we deploy our website in server. You will understand this later.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"570\" height=\"423\" src=\"https:\/\/www.datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-1.png\" alt=\"Save Html File\" class=\"wp-image-916\" srcset=\"https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-1.png 570w, https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-1-300x223.png 300w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/figure>\n\n\n\n<p>3. Open the file in a browser. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"469\" src=\"https:\/\/www.datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-2.png\" alt=\"Open Html File\" class=\"wp-image-918\" srcset=\"https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-2.png 768w, https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-2-300x183.png 300w, https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-2-710x434.png 710w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p>This is how the page will appear in the browser &#8211;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"282\" src=\"https:\/\/www.datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-3.png\" alt=\"First Web Page\" class=\"wp-image-920\" srcset=\"https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-3.png 583w, https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-3-300x145.png 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/figure>\n\n\n\n<p> That&#8217;s all. You have successfully developed your first web page. <\/p>\n\n\n\n<p>As you can see, content written inside body tag is only visible in the browser. Browser does not display the html tags, it just interpret the file and displays the content in the same order we wanted to display. The page seems very plain and null. To style &amp; make it look beautiful, we will have to write CSS code. <\/p>\n\n\n\n<p><strong>Tips:<\/strong> For better coding experience, you can use notepad++, it has some more features. You can download it from <a href=\"https:\/\/notepad-plus-plus.org\/downloads\/\">here<\/a>.<\/p>\n\n\n\n<p>Now, lets add some more content in the page and leverage other html tags.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html> \n&lt;html>\n  &lt;head>\n    &lt;title>First Web Page&lt;\/title>\n  &lt;\/head>\n  &lt;body>\n\t&lt;h1> Hello world! &lt;\/h1>\n\t&lt;p> I am &lt;b>learning&lt;\/b> HTML &lt;\/p>\n\t&lt;p> This text will appear &lt;i>italic&lt;\/i> &lt;\/p>\n\n        &lt;p> This is my 1&lt;sup>st&lt;\/sup> web page&lt;\/p>\n\t&lt;p> Scientific name of water is H&lt;sub>2&lt;\/sub>O &lt;p>\n\n\t&lt;h2> Unordered List Example &lt;\/h2>\n\t&lt;ul>\n\t  &lt;li>HTML&lt;\/li>\n\t  &lt;li> CSS &lt;\/li>\n\t  &lt;li> JavaScript&lt;\/li>\n\t&lt;\/ul>\n\n\t&lt;hr>\n\n\t&lt;h2> Ordered List Example &lt;\/h2>\n\t&lt;ol>\n\t  &lt;li>HTML&lt;\/li>\n\t  &lt;li> CSS &lt;\/li>\n\t  &lt;li> JavaScript&lt;\/li>\n\t&lt;\/ol>\n\n\t&lt;hr>\n\n\t&lt;div> \n\t  This is a division. Division can contain all other tags.\n\t  &lt;p> I am a paragraph inside div.&lt;\/p>\n\t  &lt;span> I am a span1 &lt;\/span>\n\t  &lt;span> I am a span2 &lt;\/span>\n\t&lt;\/div>\t\n  &lt;\/body>\n&lt;\/html><\/code><\/pre>\n\n\n\n<p>The output of the above code would be something like this-<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"513\" height=\"637\" src=\"https:\/\/www.datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-9.png\" alt=\"\" class=\"wp-image-974\" srcset=\"https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-9.png 513w, https:\/\/datatype.co.in\/blog\/wp-content\/uploads\/2020\/09\/image-9-242x300.png 242w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/figure>\n\n\n\n<p>Isn&#8217;t it easy? Okay. Now here is an exercise for you. Create your resume in html. Here are some hints:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Use &lt;div&gt; tags to separate each section. <\/li><li>Add description in &lt;p&gt; tags. <\/li><li>Use header tags &lt;h1&gt;, &lt;h2&gt; etc. for section&#8217;s titles. <\/li><li>Use &lt;ol&gt; and &lt;ul&gt; to list your skills and educational qualifications. <\/li><li>Use &lt;hr&gt; to separate sections. <\/li><li>Use &lt;b&gt;, &lt;i&gt;, &lt;u&gt; tags to highlight text. <\/li><\/ul>\n\n\n\n<p>Good luck. <\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.datatype.co.in\/blog\/how-to-develop-website-part-2\/\" target=\"_blank\">How to Develop a Website: Part 2<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, I will teach you how to develop a website from scratch step by step. I will start from basics and gradually move to advance level. In order&nbsp;[ &hellip; ]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[243],"tags":[245,246,247,244,249],"class_list":["post-987","post","type-post","status-publish","format-standard","hentry","category-website-development-tutorial","tag-develop-website-beginner","tag-how-to-develop-website","tag-website-development-course","tag-website-development-from-scratch","tag-website-development-tutorial-step-by-step","list-style-post"],"_links":{"self":[{"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/posts\/987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/comments?post=987"}],"version-history":[{"count":31,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/posts\/987\/revisions"}],"predecessor-version":[{"id":1331,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/posts\/987\/revisions\/1331"}],"wp:attachment":[{"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/media?parent=987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/categories?post=987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/tags?post=987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}