How to use ‘hover’ in CSS

If you want the underline to be present while the mouse hovers over the link, then: a:hover {text-decoration: underline; } is sufficient, however you can also use a class-name of ‘hover’ if you wish, and the following would be equally applicable: a.hover:hover {text-decoration: underline; } Incidentally it may be worth pointing out that the class … Read more

CSS :before on inline SVG

No, inline SVG is treated as an image, and images are replaced elements which are not allowed to have generated content. Strictly speaking, I think it’s undefined. CSS 2.1 just talks about “images, embedded documents and applets” in general and The HTML standard defines it for images, but not SVG explicitly.

Is it possible to reference one CSS rule within another?

No, you cannot reference one rule-set from another. You can, however, reuse selectors on multiple rule-sets within a stylesheet and use multiple selectors on a single rule-set (by separating them with a comma). .opacity, .someDiv { filter:alpha(opacity=60); -moz-opacity:0.6; -khtml-opacity: 0.6; opacity: 0.6; } .radius, .someDiv { border-top-left-radius: 15px; border-top-right-radius: 5px; -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; } … Read more

Remove extra button spacing/padding in Firefox

Add this: button::-moz-focus-inner { padding: 0; border: 0 } http://jsfiddle.net/thirtydot/Z2BMK/1/ Including the border rule above is necessary for buttons to look the same in both browsers, but also it removes the dotted outline when the button is active in Firefox. Lots of developers get rid of this dotted outline, optionally replacing it with something more … Read more

Center a div in CSS [closed]

The text-align: center; only centers the element’s inline contents, not the element itself. If it is a block element (a div is), you need to set margin: 0 auto;, else if it is an inline element, you need to set the text-align: center; on its parent element instead. The margin: 0 auto; will set top … Read more

Why did Bootstrap 3 switch to box-sizing: border-box?

The release notes tell you: (http://blog.getbootstrap.com/2013/08/19/bootstrap-3-released/) Better box model by default. Everything in Bootstrap gets box-sizing: border-box, making for easier sizing options and an enhanced grid system. Personally I think most benefits go to the grid system. In Twitter’s Bootstrap all grids are fluid. Columns are defined as percentage of the total width. But the … Read more

Position element fixed vertically, absolute horizontally

Position Fixed Element Horizontally Based Off Another Element (Disclaimer Note: The solution offered here is not technically “absolute horizontally” as the question title stated, but did achieve what the OP originally wanted, the fixed position element to be ‘X’ distance from the right edge of another but fixed in its vertical scroll.) I love these … Read more