Posts in category: "css"
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...
My CSS Reset/Base
Since writing about the state of CSS resets in 2018, I’ve had a few people ask what my modified CSS reset looks like. As I mentioned in that article, my reset is more like a base at this point because, in addition to resetting some default browser styles, I...
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...
The visibility property isn’t just about visibility
When we hear the world “visibility”, we tend to only think of vision. But the visibility: hidden rule actually affects different kinds of visibility - visual, spatial, assistive technology, and interaction - in different ways....
When do the :hover, :focus, and :active pseudo-classes apply?
When we select an element by its .class or #id, we’re using predefined and unchanging attributes that are baked into the DOM. With pseudo-classes, we can select elements using information that isn’t already in the DOM and can change based on how a user interacts with the page....
Page 1 of 11
Older →