Start Web Dev With Basic Html
Published: 2023-02-03 19:35:42

<p>Let’s Make Our Step Toward Web Development.</p><p>Learning HTML helps you build the structure of any website, isn’t it awesome? let’s go through it.</p><p>Now, Before Starting Our Programming Journey, We need an editor to write our code. (We can write it in notepad as well, but that will make our developer life challenging)</p><p>so, Let’s choose a code editor, below I am writing down some good options.</p><ul><li>Sublime Text: A popular, cross-platform code editor with a vast library of plugins and a minimalistic UI.</li><li><strong>Atom:</strong> An open-source, hackable code editor developed by GitHub, with a large plugin ecosystem and customizable interface.</li><li><strong>Visual Studio Code:(We will be using it)</strong> A free, open-source code editor developed by Microsoft, with support for debugging, version control, and embedded Git.</li><li><strong>vim: </strong>A powerful, terminal-based code editor known for its efficient keyboard shortcuts and steep learning curve.</li><li><strong>IntelliJ IDEA</strong>: A proprietary code editor developed by JetBrains, with a focus on developer productivity and intelligent code assistance.</li><li><strong>Eclipse:</strong> A widely-used, open-source code editor for Java development with a large ecosystem of plugins and extensions.</li><li><strong>TextMate: </strong>A proprietary code editor for macOS, with a “bundle” system for extending its features.</li></ul><p>You can choose any of the above code editors (Remember not to love or hate any of them, as each one of them has its pros and cons)</p><p><strong>Now we can start with HTML in the code editor:</strong></p><p>Create a file and name it index.html or index.htm, as you have understood we can use <strong>both .html and .htm</strong> extensions for HTML files, but generally, we use <strong><em>.html</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*LLns1eovkWSqmK2-eBhU5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*3QS54aITLlmZwd_4NBEy2A.png" /></figure><p>now we can write anything here we want and if we open this file in browser we will see that in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*ONWPnz3vByrzXclOJfZxRg.png" /></figure><p>But we will write it in proper structure and will use the power of HTML.</p><p>Now generally emmet comes installed in the code editor, so if we will type ! and press enter. we should be able to see the boiler plate code of HTML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*exyV_egfx1rIeyK74W7GZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e6XH3r5GJ-rq5y7UvOMMTQ.png" /></figure><p>if it is not working for you, just copy and paste the below code, (we will understand what it is one by one.</p><pre><!DOCTYPE html><br><html lang="en"><br><head><br>    <meta charset="UTF-8"><br>    <meta http-equiv="X-UA-Compatible" content="IE=edge"><br>    <meta name="viewport" content="width=device-width, initial-scale=1.0"><br>    <title>Document</title><br></head><br><body><br>    <br></body><br></html></pre><p>This is a basic HTML document that sets up the structure of a web page.</p><p>The first line, <!DOCTYPE html>, is a document type declaration, which tells the web browser that this is an HTML document.</p><p>The <html> element is the container for all the other elements on the page, and it has a lang attribute set to "en" for English.</p><p>Inside the <html> element, we have the <head> element, which contains information about the document that is not visible to the user. Inside the <head> element, we have several <meta> tags. The first one <meta charset="UTF-8"> specifies the character encoding for the document, which is set to UTF-8.</p><p><meta http-equiv="X-UA-Compatible" content="IE=edge"> is a compatibility mode tag, this will force Internet Explorer to use the latest rendering engine rather than an older one.</p><p><meta name="viewport" content="width=device-width, initial-scale=1.0"> helps make the website look good on all devices (i.e. responsive design), by setting the width of the viewport to the width of the device and setting the initial scale to 1.0.</p><p>The <title> element contains the text that appears in the browser's title bar or tab. The text inside the <title> element "Document" is used as the title of the web page.</p><p>The <body> element contains the visible content of the web page. Currently, it is empty, but this is where you would put the main content of your webpage like text, images, links, etc.</p><p>Finally, the </html> closing tag indicates the end of the HTML document.</p><p>In summary, this code sets up the basic structure of a web page, including the head section with metadata such as the character encoding, viewport and a title; and the body section where the main content of the webpage will reside.</p><p>Let’s see how it is looking in browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gvBTLxV6f_grsU0C-jbtQ.png" /></figure><p>Let’s first replace Document with name Vivek and see how it changing in browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*182HiDoJsVu0lKoZnvPXpQ.png" /></figure><p>As you can see title changed to Vivek in the browser as well, but there is nothing in the body of the browser. because there is nothing in the body tag of HTML as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*5M8pnBCbTKz9_f7GBZ6-mg.png" /></figure><p>The <body> tag is an essential element in HTML as it represents the content that will be displayed on the webpage. It's where you put all the visible elements such as headings, paragraphs, images, links, and more.</p><p>Speaking of headings, there are six different levels of heading tags in HTML, ranging from <h1> to <h6>. Each heading level decreases in size as you go from <h1> to <h6>. For example, <h1> is the largest heading size and it's typically used for the main title of a webpage.</p><pre><body><br>    <h1>Heading 1</h1><br>    <h2>Heading 2</h2><br>    <h3>Heading 3</h3><br>    <h4>Heading 4</h4><br>    <h5>Heading 5</h5><br>    <h6>Heading 6</h6><br></body></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*QU1YQjpS4bOw7mL1FNzk0Q.png" /></figure><p>Paragraph tags, or <p>, are used to add text and other types of content to a webpage. You can add a title attribute to a paragraph tag, as in <p title="viv">Vivek News</p>. This title attribute will appear as a tooltip when a user hovers over the paragraph.</p><pre>  <p title="viv">Vivek News</p></pre><p>Hyperlinks, or links, can be added to a webpage using the anchor tag, or <a>. The href attribute is used to specify the destination URL of the link. It's a good practice to use descriptive link text that accurately describes the destination webpage. For example</p><pre><a href="./research.html">Learn more about our News research</a></pre><p>The <img> tag is used to add images to a webpage. The src attribute is used to specify the URL or file path of the image, and the alt attribute provides alternative text for the image in case it can't be displayed. You can also add attributes such as srcset, sizes and width where srcset is used to define different size of images, sizes attribute which defines how the image will be displayed on the webpage, and width which is used to define the width of the image on webpage.</p><pre><img src="./news.png" alt="A Imp News" width="400" height="300" class="featured-image" title="Imp News"></pre><p>In summary, the body tag is an essential element in HTML and it’s where you put all the visible elements of a webpage. The heading tags, paragraph tags, anchor tags, and image tags are some of the most commonly used elements within the body section. Each tag has its own specific attributes that can be used to customize the appearance and behavior of the elements on the page.</p><p>Here is all the code we have written</p><pre><!DOCTYPE html><br><html lang="en"><br><head><br>    <meta charset="UTF-8"><br>    <meta http-equiv="X-UA-Compatible" content="IE=edge"><br>    <meta name="viewport" content="width=device-width, initial-scale=1.0"><br>    <title>Vivek</title><br></head><br><body><br>    <h1>Heading 1</h1><br>    <h2>Heading 2</h2><br>    <h3>Heading 3</h3><br>    <h4>Heading 4</h4><br>    <h5>Heading 5</h5><br>    <h6>Heading 6</h6><br>    <p title="viv">Vivek News</p><br>    <a href="./research.html">Learn more about our News research</a><br>    <img src="./news.png" alt="A Imp News" width="400" height="300" class="featured-image" title="Imp News"><br></body><br></html></pre><p>Let’s see what our web page looks like now :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wC4UjxOxuqz80ct82387Zg.png" /></figure><p>See, how easy it was to make our first web page.</p><p>GitHub Link for Learning Html: <a href="https://github.com/viveksinra/FSJS_LEARNING/tree/master/html_only">https://github.com/viveksinra/FSJS_LEARNING/tree/master/html_only</a></p><p>GitHub Link for Learning FSJS:</p><p><a href="https://github.com/viveksinra/FSJS_LEARNING">https://github.com/viveksinra/FSJS_LEARNING</a></p><p>Hope this article helped you learn something. Please consider to follow me</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4555b3742f59" width="1" height="1" alt=""></br><p style="color:#757CF9;">This article is published w/ <a target="_blank" href="https://scattr.io?ref=dev">Scattr  ↗️</a></p>