Пустой шаблон HTML5
В новом стандарте многое упростилось и теперь базовая часть выглядит так:
Новые теги HTML5
В HTML5 для структуры кода введено несколько новых тегов: , , , , , которые заменяют в некоторых случаях привычный . Сделано это для поисковых роботов, чтобы они лучше распознавали код страниц и отделяли основной контент от вспомогательных элементов.
С использованием новых тегов пустой шаблон HTML5 может выглядеть так:
Заголовок страницы Контент - основное содержимое страницы.
Упрощение написания DOCTYPE
Вспомним как было раньше, в HTML4 тег DOCTYPE выглядел так:
Теперь же запись минимальна, проще, наверное некуда :
Похожие упрощения произошли и с остальными тегами, так что переход на стандарт HTML5 существенно облегчает написание.
Необязательные теги в HTML5
Новый стандарт принес много послаблений верстальщикам. В частности, использование элементов HTML, HEAD и BODY уже не является обязательным для разметки HTML5. Если их нет, то браузер все равно считает, что они существуют. По сути из обязательных в HTML5 остался только .
Трактовка русского языка как основного языка HTML документа
Тег определяет язык документа. В сети регулярно возникают дискуссии о правильном его написании, в частности правильность написания «ru-RU». Я склоняюсь к варианту, что «-RU» является избыточным, так как у русского языка нет диалектов и вариантов написания как у Английского языка (Британский и Американский). Суффикс RU уточняет, где говорят на русском языке. То есть если en-US означает «английский язык на котором говорят в США», то ru-RU означает «русский язык на котором говорят в России», что является излишним.
В прочем, ничего страшного не случится, если вы и дальше будете использовать вариант «ru-RU».
Благодарности
При написании статьи были использованы следующие источники:
This is a blank HTML page
Step 5: The next step in the process of creating a blank HTML page is saving this file. Notepad will usually try to save your documents with a .txt extension, but to save an HTML file you need to save your file with a .html extension. So, type the name of your file and add a .html extension to it. Even .htm works well.
Here’s an example to help you understand better:
Step 6: Click on the Save button. That’s it, there you go, you have your new HTML page absolutely ready.
Step 7: Now, open the folder where you saved this file. You’ll see something like this:
How to Save an HTML File?
Now that we have learned how to create a blank page using HTML, in this section we will talk about how you can save an HTML file.
We know what you’re thinking, and yes, that’s right! It is the same process as to how you saved your blank document, you just need to add a .html or .htm extension to your notepad file, and click on the Save button.
You have your HTML file saved.
Debugging the “blank page” code:
Anything that is enclosed inside the <> bracket is called a tag in HTML. In the example of our blank
HTML page, we started with :
What does this mean?
The declaration shows the document type, it helps the browsers to identify and display web pages correctly.
This is a must of all HTML files.
This is an essential tag to write an HTML code. All the codes in any HTML file must be within these tags.
This is the opening tag for HTML.
We call this the body tag. Usually, all the main content is written within these tags.
Fun fact: Most of the tags in HTML must be closed.
is how you start the tag and by adding a slash you close it. For example:
This is a blank HTML page
This is the heading tag. There are six heading tags from to .
is used to display bigger and important headings whereas, is used to display the least important headings.
That is how easy it is to create a blank HTML page. We hope this article was informative and helped you learn the smoothest way to create a blank HTML page and save an HTML file.
If you wish to learn more about HTML, CSS, PHP, and jQuery, among other technologies, you must go through the Full Stack Development Career Program by Testbook Select. If you are someone who wants to get access to tips & tricks, practice papers, videos, and other similar study material, we highly recommend that you download the Testbook app for from Google PlayStore right away!
The act of developing websites for the internet as a single static page or a complex website having many web pages within it is called Web Development. Web development is a growing area and according to statistics, there are close to a million web development jobs at present with anuual salary of 4.5 LPA. The vacancies and opportunities are countless as well those who seek a well-qualified web developer to fill those roles. Candidates can check out the Topp 5 Best Web Development Books to Learn HTML, CSS, JavaScript, & JQuery.
How to Create A Blank HTML Page FAQs
Yes, it’s a must to add to any HTML file as it makes it easier for the browser to display the appropriate HTML file. While coding in HTML5, this is necessary.
Can I not add any content or sentence and still create the blank HTML file? What is the code for doing so?
Yes! You can choose to do so if you do not want to add any content and still wish to create a blank HTML page. Here’s how you can do it –
Can the aforementioned process of creating a blank html page be applied on other text editors too?
When creating a blank HTML page, you can follow the same process with all the text editors that you use.
Is it always essential to close the tag?
Yes, it is always necessary to close the tags, even while creating a blank HTML page. Only very few tags like ,
,
that do not need closing.
Can I open my HTML file in any browser?
Yes, absolutely. You can open your HTML file in any browser. Be it google chrome, Mozilla Firefox, Safari, Microsoft Edge, Internet Explorer, or anything, the process to be followed will remain the same, as mentioned above in the article.