Posts in category: "html"
Use the :lang pseudo-class over the lang attribute selector for language-specific styles
The content of HTML documents can be in many different languages. To specify the primary language of a document, we use the lang attribute on the root element. <html lang="en"> We can also use the lang attribute within the page to demarcate specific elements or...
Making the abbr element work for touchscreen, keyboard, and mouse
The <abbr> element is used to denote and define an acronym. For example, if we want to write the acronym “CSS” anywhere on a web page, we can also provide the full name “Cascading Style Sheets” for readers unfamiliar with the acronym. This is done by wrapping the...
Using aria-live
Many web pages today have their content dynamically changed using Javascript. An example of this is the search page on this blog. When the page is initially loaded, the only content in the <main> section of the page is a search form. But, when you type in a...
What is the Shadow DOM?
A couple of weeks ago, I wrote an article on what exactly the DOM is. To recap, the Document Object Model is a representation of an HTML document. It is used by browsers to determine what to render on the page, and by Javascript programs to modify the content, structure,...
How and when to use the tabindex attribute
tabindex is a global attribute that can be applied to most HTML elements with content. It controls two things: If an element is focusable, either by an input method such as the keyboard, or programatically such as with the focus() method; and At what point an element becomes focusable when...
Page 1 of 7
Older →