An HTML file contains HTML code which is known as HyperText Markup Language is the language used by the Web to create Web pages.
Therefore a .HTML file will contain HTML code that forms the framework of a webpage. HTML files come in both ‘.html’ and ‘.htm’ file extension.
There are many applications available for creating web pages with HTML code, including Sublime Text, Notepad++, Atom & Brackets.
HTML files contain HTML elements that are marked with HTML tags that are special codes used to make web pages. They are written between <> symbols. We use these tags to set the format of the text and other elements on the web page.
Here are some of the most commonly used HTML tags which help control the presentation of the webpage –
- <html> – container for the whole page.
- </html> – end of the page
- <head> – information about the document
- <title> – title of the document
- <body> – everything else
- </body> – end of the body content
- <h1> to <h6> – used to create headers of different sizes on a web page.
- <p> – tag for creating paragraphs.
- <b> – is used to display text as bold.
- <strong> – used to indicate important text in a webpage
- <a> – is used to create a hyperlink to an source.
- <center> – is used to centre-align large blocks of text.
How to open an HTML file?
HTML files can typically be opened with any web browser or text editor out there. You can also view the HTML content in a webpage by using the inspect element feature of browsers.
An HTML document that is saved as a .html file can be opened with Notepad which is usually available on your PC or mac or with any code text editor like Notepad++, Atom, Brackets or Sublime Text.
How do you create an HTML file?
Any code editor or even the default Notepad application on Windows can be used to create HTML files. Just type in your code in plain text and then save the file with a .html or .htm extension.
Open a code editor like Atom, then create a file like sample.html and then put your code in that, then save it and there you have your HTML file.
How do I convert HTML to PDF?
There are different methods by which you can convert HTML code or a web page to PDF –
- Press CTRL/CMD + P – With the webpage open, just press CTRL+ P for Windows or CMD + P for macOS and a dialog box will open inside the web browser, select the destination as ‘Save as PDF‘ and then click on the ‘Save‘ button to save the web page as a pdf file.
- Use an online tool – There are tools available like Pdfcrowd or Sejda which allow you to convert a web page available on the internet directly to pdf, convert HTML files to pdf which you can upload or HTML code which you can directly paste in the tools.
Is HTML a programming language?
HTML can’t really be designated as a programming language because it doesn’t function the same way that a programming language does. It doesn’t have any practical purpose, it can’t be used to add numbers or perform if/else functions.
HTML is used for structuring a web page and not for any functional purpose. It’s as we stated earlier a markup language that consists of elements that are denoted by tags.
An HTML file contains the HTML code that marks or defines elements with HTML tags and describes their purpose in the webpage. A web browser reads the HTML file then structures the page and data accordingly.