CSS

CSS3 Multiple background images

Firefox 3.6 supports multiple background images so I thought it was time to give them a go and figure out how they work. May contain small rant about beautiful markup.
Published in CSS on Monday, November 23rd, 2009

IE6 absolute positioning in parent with odd width

A small browser quirk for IE6 where absolute positioning with the CSS right property is one pixel out when the parent container has an odd number of pixels.
Published in Browser quirks, CSS on Monday, September 7th, 2009

Building javascript minification into MSBuild scripts

How to use a tool called Packer.NET to build javascript minification into a MSBuild script.
Published in ASP.NET, CSS, Javascript, Tools on Saturday, August 29th, 2009

Why I don't like reset stylesheets

I don't much like reset stylesheets. They make extra work when creating CSS and are an extra request for the browser to make to build a page.
Published in CSS on Sunday, August 23rd, 2009

SVG images as CSS backgrounds

Experimenting with using an SVG image as a CSS background image.
Published in CSS on Wednesday, August 12th, 2009

A great big welcome to inline-block!

Inline-block is a halfway point between setting an element's display to inline or to block. It keeps the element in the inline flow of the document like display:inline does, but you can manipulate the element's box attributes (width, height and vertical margins) like you can with display:block.
Published in CSS on Sunday, August 9th, 2009

Dust-me selector tool for finding unused CSS selectors

My find for today was a Firefox extension called Dust-Me Selectors from the SitePoint guys that scans a web site looking for unused selectors in the CSS. It extracts the style references for the current page and then looks at the page to see where they are used. It can look at the current page [...]
Published in CSS, Tools on Tuesday, October 21st, 2008

CSS3 box-sizing attribute

CSS3 is going to include a new attribute called box-sizing so we can choose whether the width set on an element will include borders and padding or whether borders and paddings will be added to the width. The difference is basically the difference between the IE5 and W3C box models. The default will still be [...]
Published in CSS on Monday, October 20th, 2008

Form layout using negative margins

Use negative margins and light weight semantic markup to display a form with the labels on one side and form elements on the other. No tables or divs needed at all. Works in all browsers. Noone who wasn't a web developer would believe what a pain it is finding a good solution to this little problem.
Published in CSS on Sunday, July 27th, 2008

The bleeding edge of web: media queries

Media queries are extra params for the CSS @media types that you can use to target styles for different devices based the device’s capabilities like dimensions and colour depth. They are part of the W3C CSS3 standard and are supported in the latest vesion of Opera (desktop and mini versions), Firefox and Safari. Media queries [...]
Published in CSS on Friday, July 18th, 2008

Child and sibling selectors

I was trying to style a bit of html without having to add a new class into the markup and came across two types of CSS selectors that I haven’t used before called child and sibling selectors. You can use child selectors to target the direct children of an element. The syntax is parent > [...]
Published in CSS on Saturday, January 20th, 2007

Containing floats in block elements

I just wanted to bookmark a really useful page about how to make block elements in CSS expand to contain floated elements. There are a couple of suggested ways to deal with this on the page but the one I needed today was adding an element to the end of the float that has the [...]
Published in CSS on Wednesday, January 25th, 2006

IE7 is planned to support CSS attribute selectors! Whee!

Yay! I’m so happy because I just read a post on the IE blog that says IE7 is going to support attribute selectors! In fact it says that IE7 is going to aim to be CSS 2.1 compliant! They’re also *finally* fixing the problems with rendering transparent png files. I was a bit cynical when [...]
Published in CSS on Thursday, October 13th, 2005

Request for comment on the CSS 3 spec

I saw an article on WASP today asking for comment from web developers on the CSS 3 standard that they’re currently working on. It’s kind of hard to tell how it’s going to be without trying to make a webpage with it, but the idea of being able to use multiple background images in the [...]
Published in CSS on Thursday, July 21st, 2005

PNG Alpha transparency code in IE

Because of incompatibilities between IE and the world, to get PNG transparency to work in IE you need to add this to your stylesheet: img.transparent { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='myimage.png',sizingMethod='scale');} There’s more information at A List Apart and WebFX
Published in CSS on Tuesday, October 19th, 2004

CSS2 @font-face threatens to make our pages prettier

It’s funny the way the universe echos sometimes. While I was walking to lunch yesterday I was thinking that it was high time developers got more choice about the fonts that their webpages display in. I mean we live in an age where bandwidth restrictions have relaxed so much there’s video linked from the homepage [...]
Published in CSS on Thursday, September 16th, 2004