When I give a button and a link the same styles, why is the link one pixel higher?

Posted Almost 12 years ago by Henning Koch.

It's not logical, so don't be too hard on yourself. You need to give it a height and...

Convert a TrueType (.ttf) font to web font formats

Posted Almost 12 years ago by Henning Koch.

Note that you are not allowed to embed any font in a website. You need to check the license first...

Scroll a textarea to a given line with jQuery

Posted Almost 12 years ago by Henning Koch.

You can use this code: function scrollToLine($textarea, lineNumber) { var lineHeight = parseInt($textarea.css('line-height')); $textarea.scrollTop(lineNumber * lineHeight); }

Ruby: Making your regular expressions more readable with /x and alternative delimiters

Posted About 12 years ago by Henning Koch.

The following two hints are taken from Github's Ruby style guide: If your regular expression mentions a lot of...

Tabs in Textarea Plugin for jQuery

Posted About 12 years ago by Henning Koch.
teddevito.com

This is a demo of the "Tabby" Javascript jQuery plugin to use tabs in regular textareas to make them suitable...

Change how Capybara sees or ignores hidden elements

Posted About 12 years ago by Ulrich Berkmueller.

Capybara has a global option (Capybara.ignore_hidden_elements) that determines whether Capybara sees or ignores hidden elements.

Markdown/Commonmarker examples

Posted About 12 years ago by Arne Hartherz.

This card shows you how to format a card's content using Markdown. We use the Commonmarker interpreter, so here...

What collapsing margins are, how they work and when margins do not collapse

Posted About 12 years ago by Ulrich Berkmueller.

Imagine you have 2 HTML boxes. The first one has a margin-bottom of let's say 30px and the...

CSS: Change text selection color

Posted About 12 years ago by Arne Hartherz.

You can change the color for text selection via CSS, using the ::selection and ::-moz-selection pseudo-elements.

High-level Javascript frameworks: Backbone vs. Ember vs. Knockout

Posted About 12 years ago by Henning Koch.

This is a very general introduction to MV* Javascript frameworks. This card won't tell you anything new if you...

New cards feature: Github-style code blocks

Posted About 12 years ago by Henning Koch.

You can now add code blocks without indentation, by using triple-backticks: ``` Code block goes here. ```

Flexible overflow handling with CSS and JavaScript

Posted About 12 years ago by Arne Hartherz.

You can use text-overflow to truncate a text using CSS but it does not fit fancy requirements.

Use CSS "text-overflow" to truncate long texts

Posted About 12 years ago by Arne Hartherz.

When using Rails to truncate strings, you may end up with strings that are still too long for their container...

jQuery UI Bootstrap

Posted Over 12 years ago by Henning Koch.
addyosmani.github.com

Twitter's Bootstrap CSS blueprint as a jQuery UI theme. Even if you don't want to use Bootstrap as...

How to print Github wiki pages

Posted Over 12 years ago by Arne Hartherz.

I have no idea how it's supposed to work (or why the don't have a print CSS), but...

Repeat an element on every printed page with CSS

Posted Over 12 years ago by Henning Koch.

Firefox, Opera and Internet Explorer will repeat elements with position: fixed on every printed page (see attached example).

CSS box-shadow not working in IE9 inside tables with collapsing borders

Posted Over 12 years ago by Arne Hartherz.
stackoverflow.com

Though Internet Explorer 9 supports the box-shadow CSS property there is a nasty bug which sometimes prevents it from...

Pull Quotes with HTML5 and CSS

Posted Over 12 years ago by Henning Koch.
miekd.com

A pull quote is a typographical technique in which an excerpt or quote from an article is duplicated within the...

How to embed images in higher resolutions for printing

Posted Over 12 years ago by Henning Koch.

When you print out a HTML pages, all raster images (like PNGs) will appear aliased. This is because a printer...

Detect mobile or touch devices on both server and client

Posted Over 12 years ago by Henning Koch.

Although it's tempting flirt with detecting mobile/touch devices with CSS media queries or Javascript feature detection alone, this approach...

Right-align or center panel items in XFCE

Posted Over 12 years ago by Henning Koch.

Add a separator between left-aligned and right-aligned items. In the separator properties, set the style to "Transparent" and...

Vendor-prefixed CSS Property Overview

Posted Over 12 years ago by Ulrich Berkmueller.
peter.sh

A list of CSS vendor-prefixes.

Change image scaling algorithms with CSS

Posted Over 12 years ago by Henning Koch.
developer.mozilla.org

List of non-standard CSS attributes that change how the browser resamples scaled images. Only use them if you know...

Useful script to collect downloads from several sites

Posted Over 12 years ago by Dominik Schöler.

For university I have to stay up-to-date with lecture documents. Since my university doesn't offer RSS feeds...