How to resize an image to fit in the browser window?

Update 2018-04-11 Here’s a Javascript-less, CSS-only solution. The image will dynamically be centered and resized to fit the window. The [other, old] solution, using JQuery, sets the height of the image container (body in the example below) so that the max-height property on the image works as expected. The image will also automatically resize when the client window is resized. … Read more

Horizontal list items

Updated Answer I’ve noticed a lot of people are using this answer so I decided to update it a little bit. No longer including support for now-unsupported browsers.

Playing Sound In Hidden Tag

I agree with the sentiment in the comments above — this can be pretty annoying. We can only hope you give the user the option to turn the music off. However…  Run code snippetExpand snippet The css hides the audio element, and the autoplay=”true” plays it automatically.

CSS max-height not working

The problem is your browser. Maybe you could wrap this div in another div that has the fixed height of 25px. Of course this wouldn’t be exactly the same as max-height. An article about a solution. Edit: According to Microsoft it should work in IE7+. Have you set an appropriate doctype? If not IE7 uses an old … Read more

How do I embed a Vimeo video in HTML?

If you are signed in on Vimeo, an go to your video settings, there should be an menu “Embed”. Click this item and you will get various embedding options. At the right side of the window (below your profile icon) there will be a button Embed code. Clicking this will give you the Embed code. Here … Read more