How to implement max-font-size?

font-size: 3vw; means that the font size will be 3% of the viewport width. So when the viewport width is 1200px – the font size will be 3% * 1200px = 36px. So a max-font-size of 36px can be easily implemented using a single media query to override the default 3vw font-size value. Codepen demo (Resize Browser) … Read more

Transition of background-color

As far as I know, transitions currently work in Safari, Chrome, Firefox, Opera and Internet Explorer 10+. This should produce a fade effect for you in these browsers: Note: As pointed out by Gerald in the comments, if you put the transition on the a, instead of on a:hover it will fade back to the original color when your … Read more

Completely disable scrolling of webpage

Presuming the simplified HTML code is: Set both body, html to height:100%; Put a div inside body, and set it to stretch across all the body height: This will prevent window from scrolling in weird ways, like, pressing mouse wheel and moving it, using anchors, etc. To remove the scroll bar itself (visually), you should … Read more

How (and why) to use display: table-cell (CSS)

After days trying to find the answer, I finally found display: table; There was surprisingly very little information available online about how to actually getting it to work, even here, so on to the “How”: To use this fantastic piece of code, you need to think back to when tables were the only real way to … Read more

JavaScript Loading Screen while page loads

You can wait until the body is ready:  Run code snippetExpand snippet Here is a JSFiddle that demonstrates this technique. Update Here is a modern version using promises. The promise is completely optional now, as it is only used for a delay. The DOMContentLoaded event will fire once the page is loaded.

Use images like checkboxes

Pure semantic HTML/CSS solution This is easy to implement on your own, no pre-made solution necessary. Also it will teach you a lot as you don’t seem too easy with CSS. This is what you need to do: Your checkboxes need to have distinct id attributes. This allows you to connect a <label> to it, using the label’s for-attribute. Example: … Read more