source:
the first line in an HTML file is the document type declaration.
The browser uses the document type declaration to know which standard to use to display the content.
<!DOCTYPE html>
We should write starting tag, content, ending tag.
For example,
<element>content</element>
<!DOCTYPE html>
<html>
<head>
head content
</head>
<body>
body content
</body>
</html>
If I select the most commonly used meta data element among the above tags, it will be title. The <title>
tag in <head>
tag area refer to name of tab.
like this!
I don't have to mention now, but the icon in the tab is called favicon(favorite icon).
The most used common character encoding in use is "UTF-8", which supports almost all of the characters you will need.
You can write like this!
<meta charset="utf-8">
UTF-8 is a variable-length encoding method that represents Unicode code points using 1 to 4 bytes.
Although modern search engines no longer rely heavily on the keywords meta tag, the name and content attributes in meta elements are still important, as they can provide descriptions and context that influence how a page appears in search results.
<meta name="description" content="...">
For improving SEO, you should write title
and description
well.
There are many ways to add comments in programming language. For example, we can use //
in C or Python.
In HTML, we can use <!-- ddd -->
this format to add comments.
<!-- information about this document -->
Using sectioning elements (such as <header>
, <nav>
, <section>
, <article>
, and <footer>
) helps define the structure and hierarchy of a web page. They make the content more meaningful and easier to understand, not only for developers and users but also for search engines and assistive technologies. By providing semantic structure, sectioning elements improve accessibility, SEO, and overall readability of the page.
To mark the page header, use the header
element.
To mark self-contained content, use the article
element.
To mark a navigation list of hypertext links, use the nav
element.
To mark a sidebar, use the aside
element.
To mark the page footer, use the footer
element.
To group general content, use the section
element.
If you want to group article content, you can use <p>
tag.