You can preload custom fonts using in your head. This allows the browser to schedule the download of the font even before it finds the font in the CSS @font-face rule. It’s kind of like letting the quartermaster know about a particular need or requirement before he finds where it’s listed. He can send an... Read More
Semantic code helps ensure consistent browser rendering because the browser has to make fewer decisions (read guesses) about what you intended. It knows how semantic code should be displayed. It does not know how some non-semantic gobbledygook somebody handed it is supposed to be displayed and so it guesses. Different browsers will make different guesses... Read More
loading=“lazy” is an attribute for images that allows it to be loaded later unless it’s needed i.e. when it’s visible in the viewport. In this way you can hold off downloading images further down the page (like setting the zombies to come in one-by-one vs all at once). This prevents those images from delaying the... Read More
Browsers ignore tags and such that they don’t understand. So, if you’re showing Mom your web exploits on her computing dinosaur, the picture and source elements may get ignored, and it’ll just display the one it knows: the img tag. In this way we can add new things (HTML elements, CSS properties etc) without old... Read More
Some HTML attributes, like most apocalyptic politicians, do not require values. These are usually boolean (true or false) in nature, and so adding the attribute constitutes true. For example, in the video element, if you want to include play/pause/stop controls, you can use the controls attribute... Read More
There are two kinds of web components: autonomous (name your own element) and customized built in elements (supercharge an existing element). Note: Safari does not support customized built in elements, but all other browsers do. Custom elements require a dash in their name and some JavaScript. Custom built in elements need the is attribute and... Read More
On ol/ul elements the type attribute let’s you change what type of numbering/bullets used. With ol set the type to “i” for lowercase Roman numerals or “I” for uppercase ones. “A” sets capital letters while “a” uses lowercase ones. On ul change the type with disc (default), circle or square. You can also use the start attribute to start... Read More
HTML5 was a major release for the HTML language. It was initially released in October 2014. It brought a wide variety of new functionality and smoother syntax to HTML. HTML4, the previous major standard, was released in April of 1998 and had only minor revisions during those 16 years. The current release is the HTML Living... Read More
Use target="_blank" very, very sparingly. You should really only use it to prevent users from losing their place in a site or when they need to reference material while looking at the current page. It can annoy users if every link opens in a new tab when they have thirty-seven tabs open just for your... Read More
Use as little HTML code as possible to achieve your goals. The less code you write the easier it is to maintain and the faster it downloads to your visitor.... Read More
A block level element should not go inside an inline level/phrase element. There are exceptions, but generally a block level element can contain either block or inline elements, but an inline element can only hold other inline elements. The major exception is the a tag, that, since HTML5, is an inline element that is allowed... Read More