button vs. input type=”button” /. Which to use?

Here’s a page describing the differences (basically you can put html into a <button></button>) And another page describing why people avoid <button></button> (Hint: IE6) Another IE problem when using <button />: And while we’re talking about IE, it’s got a couple of bugs related to the width of buttons. It’ll mysteriously add extra padding when you’re trying to add styles, meaning … Read more

Position absolute but relative to parent

This works because position: absolute means something like “use top, right, bottom, left to position yourself in relation to the nearest ancestor who has position: absolute or position: relative.” So we make #father have position: relative, and the children have position: absolute, then use top and bottom to position the children.

Absolute position is not working

Elements with absolute positioning are positioned from their offsetParent, the nearest ancestor that is also positioned. In your code, none of the ancestors are “positioned” elements, so the div is offset from body element, which is the offsetParent. The solution is to apply position:relative to the parent div, which forces it to become a positioned … Read more

Align an element to bottom with flexbox

You can use auto margins Prior to alignment via justify-content and align-self, any positive free space is distributed to auto margins in that dimension. So you can use one of these (or both): Show code snippet Alternatively, you can make the element before the a grow to fill the available space: Show code snippet

Bootstrap 3 Glyphicons CDN

With the recent release of bootstrap 3, and the glyphicons being merged back to the main Bootstrap repo, Bootstrap CDN is now serving the complete Bootstrap 3.0 css including Glyphicons. The Bootstrap css reference is all you need to include: Glyphicons and its dependencies are on relative paths on the CDN site and are referenced … Read more

HTML table needs spacing between columns, not rows

If you can use inline styling, you can set the left and right padding on each td.. Or you use an extra td between columns and set a number of non-breaking spaces as @rene kindly suggested. http://jsfiddle.net/u5mN4/ http://jsfiddle.net/u5mN4/1/ Both are pretty ugly ;p css ftw