New CSS Resource

As a developer, I needed an online repository for code design ideas. I began to use this site as that resource. But, its become more than a developer resource, it’s the place I rant, rave, and watch letters appear on the screen as my fingers clickety clack on the keyboard.

Introducing… drum roll please… last-child.com

I am now launching a new site for advanced CSS code. I’ve begun the process by copying code related posts; watch for book reviews, guest posts, and pure, simple code. I’ll be posting quick notes for problems I’ve encountered and the solutions I find.

This won’t be a gallery site. It won’t critique re-launched sites. It won’t discuss my fascination with Project Runway. In short, it’s the scrap book developers keep on their desks. It’s the photocopies taped to a wall, the notes scribbled on your hand, and the business card tucked away for later review. Visit it today: www.last-child.com

k2 theme

Kudos to the Binary Bonsai crew for building super fantastic K2 WordPress theme. You’ve made it possible for me to put this little project online quickly. I’ll begin transforming it to a more unique look quite soon. K2 will continue to be the backbone.

Z-index conflict with Flash and DHTML widgets

I’m working on a project that has a Flash movie and a DHTML dropdown menu on the same page. Flash movies like to sit on top of the page and the dropdown would slide behind the movie. Since this isn’t what I wanted, I needed to find a way to make the it have a lower z-index than the dropdown.

I did a Standardista Search for a cure and didn’t see it. But a quick message to the Web Standards Group returned the solution. It’s actually pretty easy.

UFO Flash detection and insertion script

I’m using the UFO JavaScript to detect the browser’s compatibility with the Flash movie and insert it on the fly. This method provides good default content to those without Flash and valid, shiny, happy Flash to those with it.

UFO gives you the ability to insert parameters into the movie and this is what you need to cure the z-index issue. You need to set the wmode parameter to “transparent.”

var FO = { movie:"swf/myMovie.swf", width:"300", height:"120", majorversion:"6", build:"40", wmode:"transparent" }

That’s all there is to it.

Do the Box Model Hack

box model hack designAbout a year ago, my friend Brian and I challenged each other to come up with the worst t-shirt design for our mythical band, the Box Model Hack. Personally, I think I came up with the worst design. Brian, in the midst of all that was the wicked worn look designed a shirt that was too wearable to be considered bad.

But not mine… I found some photo of a guy dancing in a speedo and boots and new my muse was getting tickled. With Photoshop’s newly released ability to set text on a path, I was on my own path to ugly tshirt lovin’.

ted, molly, and the shirtI even wore this lovely shirt to the @Media conference and witnessed dozens of people jealously admiring my lovely dancing hack guy. Yes, that’s me next to the lovely Molly. Notice her admiration for the lovely tshirt. Or is that fear in her eyes as she wonders who this maniac is with the camera phone.
In the spirit of the IE7 Beta 2 release, you can get your own version of this lovely shirt. So, head on over to my CafePress Box Model Hack store and stock up on the goodies before Microsoft actually fixes the box model problem… Now that’s funny.

IE7 Hacks

Microsoft has fixed much of the bugs that plagued IE6 and in the process removed the filters we used to target Internet Explorer in our CSS. As Lord God Martha would say, this is a good thing.

However, there will be a time when you need to send a rule to IE7 and not to IE6. Or perhaps you need to send a rule to IE7 and to IE6. I’ve put together a test page of IE6 hacks to see what IE7 doesn’t walk right past. I’m condensing the test page into the paragraph below.

Luckily, there is a loophole for us and we can use this for “offroad use only.” Why am I using this silly description? Because you and I need to move beyond hacks. Place browser specific (IE) in conditional comments or use a serverside script to place a class on the html or body (html class=”ie6″ ) to target these browsers in your main CSS file.

However, these hacks will let you develop your CSS on the fly and fix your issues before going the proper route.

Test Paragraph (condensed version of test page)

this is the test paragraph to see how IE7 will handle hacks

  • IE7 Beta2 understands #wrap>p.borderfun and applies correct color.
  • IE7 Beta2 ignores * html p.borderfun styles.
  • IE7 Beta2 recognizes the * hack.
  • IE7 Beta2 ignores the underscore hack.
  • In Firefox, Safari, and Opera, you should see a red border. In IE7, you should see a black border. In IE6, you should see a pink border.

How to use this

If you need to send something to IE6 and nothing else: use the underscore attribute hack (_border:1px solid pink;) If you want to send something to IE7 AND IE6, use the *attribute hack (*border:1px solid black;). If you want to send something to IE7 and NOT IE6, use a combination (*border:1px solid black; _border:1px solid pink;).

A call to arms

Get out there kids and begin removing your * html rules. Place those suckers in a conditional commented css file or at least begin replacing them with the underscore hack. When it comes time to tune for IE7, you’ll have less work to do.