10 HTML TİPS FOR CODE NEWBIES

In this article, I want to focus on several HTML tips and tricks for code newbies. It will take time to learn all HTML tags and attributes, maybe this article can speed you up and encourage you to learn HTML more deeply. Let’s begin:

HTML Tip-1:

When naming your file, you can use “.htm” as well as “.html” as file extension. There is no difference between them.

HTML Tip-2:

In the <head> section, written things in the <title> element will be shown on the page’s tab at the browser’s title bar. If you don’t use <title> element, then the HTML file name will be shown (if your file name is “index.html”, it will be shown directly when not used <title> element.)

HTML Tip-3:

Besides the <title> element, there is the “title” attribute which gives information to be shown as a tooltip text when the mouse hovers on the element.

HTML Tip-4:

Use the lang attribute in the <html> tag, for declaring the web page’s language to search engines and browsers. By the way, the lang attribute can be used on any HTML element, like <p lang=”fr”>.

HTML Tip-5:

When using <input type=”file”>, we can declare the file type with the “accept” attribute. So, when a user wants to select a file for input, it will be shown only that type.

HTML Tip-6

Inside the <input> element, the autocomplete attribute allows the browser to predict the value with input types of text, search, url, tel, email, password. It is enabled(on) by default. If you want to disable it, make it off.

It is also possible to give a value (which is the form’s descendant) to autocomplete.

HTML Tip-7

In CSS, you can hide content with; { display: none; } which does not take up any space. Or you can use { visibility: hidden;} which also hides an element, but the element will still take up the same space. In addition to these, with HTML5 there is a new global attribute called “hidden”.

The hidden attribute can be used to keep a user from seeing an element until some confirmation, submitting or clicking a button, etc. After that, with JavaScript you can show the hidden attribute. (The hidden attribute is a boolean.)

HTML Tip-8

The “global attributes” are attributes that can be used with all HTML elements. One of these is the “spellcheck” attribute which makes it possible to check spelling and grammar for inputs or editable content.

HTML-9

To prevent from translating, for a text like company name or account name, you can use “𝘁𝗿𝗮𝗻𝘀𝗹𝗮𝘁𝗲” attribute with “no” value.

HTML-10

The <iframe> (inline frame) element is used to display another web page within the current web page.

I will continue to write other HTML tips in the next articles. Hope they are helpful to you. It is not important to memorize codes, just be aware of them so you know what to search for when you need it.

I am in “Clarusway IT Course”, “Full Stack Web Development Path”