Using custom fonts using CSS?

Generically, you can use a custom font using @font-face in your CSS. Here’s a very basic example: Then, trivially, to use the font on a specific element: (.classname is your selector). Note that certain font-formats don’t work on all browsers; you can use fontsquirrel.com‘s generator to avoid too much effort converting. You can find a … Read more

sass :first-child not working

While @Andre is correct that there are issues with pseudo elements and their support, especially in older (IE) browsers, that support is improving all the time. As for your question of, are there any issues, I’d say I’ve not really seen any, although the syntax for the pseudo-element can be a bit tricky, especially when … Read more

CSS Outside Border

I think you’ve got your understanding of the two properties off a little. Border affects the outside edge of the element, making the element different in size. Outline will not change the size or position of the element (takes up no space) and goes outside the border. From your description you want to use the … Read more

Prevent body scrolling but allow overlay scrolling

Theory Looking at current implementation of the pinterest site (it might change in the future), when you open the overlay a noscroll class is applied to the body element and overflow: hidden is set, thus body is no longer scrollable. The overlay (created on-the-fly or already inside the page and made visible via display: block, … Read more

vertical-align with Bootstrap 3

This answer presents a hack, but I would highly recommend you to use flexbox (as stated in @Haschem answer), since it’s now supported everywhere. Demos link:– Bootstrap 3– Bootstrap 4 alpha 6 You still can use a custom class when you need it: Expand snippet Bootply Using inline-block adds extra space between blocks if you … Read more

bootstrap 4 row height

Use the sizing utility classes… h-50 = height 50% h-100 = height 100% http://www.codeply.com/go/Y3nG0io2uE Or, for an unknown number of child columns, use flexbox and the cols will fill height. See the d-flex flex-column on the row, and h-100 on the child cols.

Positioning background image, adding padding

Updated Answer: It’s been commented multiple times that this is not the correct answer to this question, and I agree. Back when this answer was written, IE 9 was still new (about 8 months old) and many developers including myself needed a solution for <= IE 9. IE 9 is when IE started supporting background-origin. However, it’s … Read more

Why write script type=”text/javascript” when the mime type is set by the server?

Douglas Crockford says: type=”text/javascript” This attribute is optional. Since Netscape 2, the default programming language in all browsers has been JavaScript. In XHTML, this attribute is required and unnecessary. In HTML, it is better to leave it out. The browser knows what to do. He also says: W3C did not adopt the language attribute, favoring instead a type attribute … Read more

iPhone 6 and 6 Plus Media Queries

iPhone 6 Landscape@media only screen and (min-device-width : 375px) // or 213.4375em or 3in or 9cm and (max-device-width : 667px) // or 41.6875em and (width : 667px) // or 41.6875em and (height : 375px) // or 23.4375em and (orientation : landscape) and (color : 8) and (device-aspect-ratio : 375/667) and (aspect-ratio : 667/375) and (device-pixel-ratio … Read more