This content originally appeared on DEV Community and was authored by Oscar Ortiz
Hyper Text Markup Language
So how exactly do we write code for our web pages? There is this amazing language known as HyperText Markup Language or HTML in short. It is easy to learn for beginners who are just trying to code. I don't mean EASY as learning your ABC's but its a great way to start learning terminology, syntax, code editors, developer tools, and more. Before trying to learn how to style web pages or add functionalities, we need to learn some fundamentals that will carry on with us throughout our career as a developer. With these simple tricks and tips, we will pick up other languages a bit quicker and efficiently.
Reading Code
Anytime we are trying to learn a new language to help us develop any type of software or web pages. We first need to understand the languages' syntax. In HTML we use element tags to tell the web browser what exactly we want to display on the page.
<h1> HTML Syntax: header element </h1>
<p> Paragraph element </p>
Syntax: the arrangement of words and phrases to create well-formed sentences in a language. You can think of this as the set of rules to create out Web Page Structure.
HTML Element Tags
Here is a quick reference of very commonly used HTML Tags
// used for headers
<h1> </h1>
<h2> </h2>
<h3> </h3>
<h4> </h4>
<h5> </h5>
<h6> </h6>
// used for paragraphs or text
<p> </p>
// used for lists
<ul> </ul>
<ol> </ol>
// used to handle user forms
<form> </form>
If you want to dive more on HTML Tags check out this link.
Working with tags
As you can see we usually include two element tags when trying to pass in any content to the browser. We need a Opening Tag and Closing Tag. Inside the tags is where we put in our context that we want to show on the browser.
Here we have a h1
element tag. The opening tag will usually be between our < >
so it will look like <h1>
, now we put our context right after our element, once we are done with our context we add another tag but this time we add a /
right before our element tag
name, so it will look like </h1>
and that will be our closing tag for this header
.
<h1> Header Element </h1>
Code for the web
So how can we get our HTML code to work and show something onto the browser? There are so many ways to get code onto the web to do the same thing in modern web browsing. We would use a Integrated development environment or IDE to write code and communicate with the computer to create software. We can download some locally onto our machine, or we can use online code editors too! However, you would need to have one onto your local machine to create real-world projects in the real world. Online editors are fantastic for testing out new features or trying some methods before putting them into your project. So there are pros and cons for each of their own. However, it is recommended to use your OWN IDE for this project to get comfortable using the tools and even use them at your real job.
We will be using VS CODE as our IDE for this project. If you would like to download VS Code then check out this link. Just make sure to download for the correct machine you are using.
Creating HTML Page
Let's go ahead and open up our code editor to create a html file. When we create our code files we have to add the type of language we are using at the end of the file to let the computer know what type of program we are trying to create within the file. So for example if we want to write HTML code we would create a file like with a name of our choosing and add period .
at the end of the file name and add html
right after.
Once our file is created, we can write HTML Tags onto our file. We will write a header
tag to create simple text on the browser.
<h1> Hello World </h1>
e.g. file_name.html
HTML Live Page
Now that we know how to create HTML files, we can open them in the browser. There are numerous ways to start up our HTML file, but for this example, we will manually open it onto our web browser by clicking on our file. Depending on our default browser, it will vary on what browser it will open up. If we have multiple browsers, be sure to pick the most comfortable one. We will be using google chrome for this guide since it provides beneficial developer debugging tools to help make our lives easier when we need to fix our broken code.
- Locate where you saved your
file_name.html
file - Right click the file
- Open with (choose a browser)
- Browser opens HTML file and displays content
e.g.
Congratulations! We just learned how to create HTML files, open it with our browser, and wrote out our first HTML Tags! This is just the beginning of a whole new world! Soon enough you will be able to create much more attractive web pages with color, images, and sections to help readers find what they are looking for easier.
Conclusion
I hope by the end of this article you managed to learn how to create and understood what is going on in every line of code. It is very important to understand how your code fully works, not only does it help you become a better developer but can also help you use the tools you are working with more efficient.
These articles are mostly intended for personal use on becoming a better programmer, writer, and grow my programming skills. Feel free to drop any feedback or corrections that you believe that should be made to help me and others. Thank you for your time for sticking this far!
This content originally appeared on DEV Community and was authored by Oscar Ortiz
Oscar Ortiz | Sciencx (2021-12-21T19:45:01+00:00) What is HTML?. Retrieved from https://www.scien.cx/2021/12/21/what-is-html/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.