Posts Tagged ‘CSS’

Script identifying CSS shorthand possibilities

Wednesday, October 21st, 2009 by Jesper Rønn-Jensen

For my own convenience I created this script to identify css files where colors like #aaaaaa can be rewritten in the short form #aaa (saves bandwith, but can also make it easier to identify similar colors) grep -nE ‘#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3’ **/*.css output from a random project: css/actions.css:19: color: #000000; css/actions.css:38: color: #000000 !important; css/actions.css:53: color: #ffffff […]

Print CSS Background Logo Hack

Tuesday, September 29th, 2009 by Jesper Rønn-Jensen

I learned this nice little hack to bypass the standard browser setting that normally prevents background images from being printed. The hack makes use of converting the background-image to a list item with an image. /* Hack, to trick the browser to print another logo Unfortunetaly, Firefox on Windows doesn’t show logo on print — […]

CSS Styling Buttons Problem with Underlined Text

Wednesday, September 16th, 2009 by Jesper Rønn-Jensen

I ran into the challenge the other day to style a<button> element to make it look like a link (with underline and everything). Unfortunately, the <button> element does not react to text-decoration: underline; But according to a discussion at the CSS Creator forum, there is a way out: I was just messing around with it […]

IE CSS bug: Background-image Gap To Border

Wednesday, November 5th, 2008 by Jesper Rønn-Jensen

Workaround needed for this annoying bug: Background-image is 1px away from border on buttons. I have buttons that are styled with border and background-image. Must work in IE7. But there is a small 1px gap between border and the background-image. Look at this screenshot from IE7: ie7css-flaw-background-image-on-buttons Problem is that I have no idea if […]