Skip to content

HTML Tutorial Elements and Attributes

Global HTML Attributes: title, lang, hidden and style

Lesson 9 of 81 2 min read By Deepak Paswan Updated Oct 4, 2026

Some attributes can be used on almost any element. They are called global attributes. These are the ones you will use most often outside of id and class, which have their own lesson next.

title

title adds extra information, which many browsers show as a tooltip when you hover.

index.html
HTML
<abbr title="HyperText Markup Language">HTML</abbr>

Do not rely on title for important information. Touch screens and keyboards often cannot show tooltips.

lang

lang says what language the content is in. Set it on <html>, and override it on a smaller element when you switch languages.

index.html
HTML
<p>The French word for book is <span lang="fr">livre</span>.</p>

Screen readers use lang to choose the right pronunciation.

hidden

hidden removes an element from the page until something shows it again.

index.html
HTML
<p>Always visible.</p>
<p hidden>This paragraph is hidden.</p>

style

style applies CSS directly to one element.

index.html
HTML
<p style="color: #b84624;">A terracotta paragraph.</p>

This works, but use it sparingly. Styles written in a stylesheet are easier to reuse and change. You will compare the options in Inline CSS.

Other useful globals

AttributePurpose
tabindexControls keyboard focus order
contenteditableLets visitors edit the text
data-*Stores custom data for scripts, see Data Attributes
aria-*Accessibility information
warning
Using title for essential text
A form field that only says what it is in a title is hard to use on a phone. Use a visible label, covered in HTML Labels.