Font Face isn’t working in IIS 8.0

Great to see WOFF2 being included in Font Squirrel fonts! Whilst IIS 8 does not need a mime type added for WOFF it will need one for WOFF2. The W3C recommends: application/font-woff2 For more info on WOFF2 see here. To add the mime type in IIS, modify your Web.Config as follows: <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> … Read more

Is it possible to change only the alpha of a rgba background colour on hover?

This is now possible with custom properties: .brown { –rgb: 118, 76, 41; } .green { –rgb: 51, 91, 11; } a { display: block; position: relative; } div { position: absolute; bottom: 0; background-color: rgba(var(–rgb), 0.8); } a:hover div { background-color: rgba(var(–rgb), 1); } To understand how this works, see How do I apply … Read more

Tools to make CSS sprites? [closed]

Instant Sprite is an in-browser CSS sprite generator I’m working on. It’s really fast, but doesn’t have quite as many features as some of the others. It currently only works in Firefox or Chrome, since it uses JavaScript FileReader and HTML Canvas to generate the sprites inside the web browser without uploads.

Print styles: How to ensure image doesn’t span a page break

The only means I can think of is to use one (or potentially more) of the following css rules: img { page-break-before: auto; /* ‘always,’ ‘avoid,’ ‘left,’ ‘inherit,’ or ‘right’ */ page-break-after: auto; /* ‘always,’ ‘avoid,’ ‘left,’ ‘inherit,’ or ‘right’ */ page-break-inside: avoid; /* or ‘auto’ */ } I half-recall that these declarations only apply … Read more

Difference between @import and link in CSS

In theory, the only difference between them is that @import is the CSS mechanism to include a style sheet and <link> the HTML mechanism. However, browsers handle them differently, giving <link> a clear advantage in terms of performance. Steve Souders wrote an extensive blog post comparing the impact of both <link> and @import (and all … Read more

Align two inline-blocks left and right on same line

Edit: 3 years has passed since I answered this question and I guess a more modern solution is needed, although the current one does the thing 🙂 1.Flexbox It’s by far the shortest and most flexible. Apply display: flex; to the parent container and adjust the placement of its children by justify-content: space-between; like this: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)