Using percentage values with background-position on a linear-gradient

TL;DR All the percentage values used with background-position are equivalent when using a gradient as background, so you won’t see any difference. You need to specify a background-size different from the container size: body { display: flex; flex-direction: column; justify-content: space-around; align-items: center; min-height:90vh; } .button { text-decoration: none; color: white; font-weight: bold; width: 350px; … Read more

Parent Height doesn’t follow their float children [duplicate]

Add overflow:hidden; to the container: #mainContainer{ width: 1000px; /*height: 1000px;*/ height:auto; margin-left:auto; margin-right:auto; background-color: #ff6600; padding-bottom: 20px; overflow: hidden; /* <— here */ } Because its content is floated, the container div collapses. Using a ‘clearfix’ class or, as I mentioned, adding overflow:hidden will cause the container to contain the floated elements. UPDATE Explanation of … Read more

Twitter Bootstrap 3 Modal with Scrollable Body

Just add: .modal-content { height:250px; overflow:auto; } The height can of course be adapted to your personal needs. Working Example Update: It’s actually pretty easy. Just add: .modal-body { max-height: calc(100vh – 212px); overflow-y: auto; } to your css. It uses vh and calc, which also happen to have a good browser support (IE9+). This … Read more

How to set the CSS content property with a Google Material Icon?

Update on 2018 Google removed the codes which were displayed earlier for IE9 and below. To get the codes visit the codepoints file in the GitHub repository. Link to codepoints in GitHub repository: https://github.com/google/material-design-icons/blob/master/font/MaterialIcons-Regular.codepoints Step 1: Include the Material Icons Stylesheet. <link href=”https://fonts.googleapis.com/icon?family=Material+Icons” rel=”stylesheet”> Step 2 : CSS Code: .bullet li a:before { font-family: “Material … Read more

Subtitles for with , how to display the subtitles

I’ve tested this out without jquery — as taylor-newton mentioned, you’ll need to create a tag for your text to appear in. document.getElementById(‘my-audio-player’).textTracks[0].addEventListener(‘cuechange’, function() { document.getElementById(‘my-subtitle-display’).innerText = this.activeCues[0].text; }); This does work with subtitles from audio tags too and using kind=”subtitles” in your track tag works with audio as well.

tech