24 April, 2008

Video: Bad Fat

Another video from yours truly. This is sort of a tribute to "Weird Al" and how immaculately he parodies songs and videos.

EDIT: It looks like Youtube has fancy content analyzers that I wasn't aware of, and because it identified "Fat," which apparently is owned by Sony/BMG, the video can't be embedded anymore. Check out the video on the original Youtube page.

18 April, 2008

Fixing Star Crash Blogger Theme in IE

The theme I am currently using for this blog, Star Crash by Blogcrowds, doesn't natively display correctly in Internet Explorer. The entire sidebar ends up at the end of all the blog posts, and that's really not acceptable. Here's how to fix that.

The Underscore Hack
The underscore hack is a way to hide certain CSS rules from all browsers except IE. Because our page renders correctly in more standards-compliant browsers (Firefox, Safari, etc.), we don't want to change the CSS for all of them. By putting an underscore in from of our property name (width: becomes _width:), we can show CSS to IE and all other browsers will ignore it. You can read more about this hack here.

The !important CSS Flag
The !important flag in CSS sets a rule to have precedence over any other rule that conflicts with it. If you have a paragraph with the class "note," and there are two rules that apply to that class, the one with the !important flag will take precedence. It can be quite handy. Here's an excerpt from the excellent book CSS Mastery by Andy Budd on the cascade and specificity:
With even a moderately complicated stylesheet, it is likely that two or more rules will target the same element. CSS handles such conflicts through a process known as the cascade. The cascade works by assigning an importance to each rule. Author stylesheets are considered the most important, followed by user stylesheets, and finally the default stylesheets used by your browser or user agent. To give users more control, they can override any rule by specifying it as !important–even a rule flagged as !important by the author.

The cascade works in the following order of importance:
  • User styles flagged as !important
  • Author styles flagged as !important
  • Author styles
  • User styles
  • Styles applied by the browser/user agent

The Fix
The <div> element we need to change the style of has the ID of #beta. I, unfortunately, am not entirely sure why IE wants the element's position to be absolute, but that seems to solve the problem. Using our newly-acquired knowledge of the IE underscore hack and specificity in CSS, here's the code we need to insert into our template:

#beta {
    _position: absolute !important;
}


Voila! The Star Crash Blogger theme now renders correctly in Internet explorer. You can insert the code anywhere in the template; I inserted mine near the top so I can remember that it's a manual edit I've made.

If you've fixed your Blogger template, learned about the IE underscore hack for the first time, or learned something new about CSS, let me know in the comments! I always like hearing from you.

Ajax Loader

Ever wanted those cool little spinner graphics that have come to be known as the "Ajax loader" in your webpages? Well, search no further. As you can see above, there are a wide range to choose from at AjaxLoad.info. You generate a custom loader graphic after selecting the loader type, loader color, and background color. There's also the option to have a transparent background (Although in my experience, some of the loaders don't look very good on a dark webpage even with the image background set to transparent). Once you've generated your file, click "Download It," and you're done!

AjaxLoad.info nice service that performs a specific task very well.  It has already proven useful to me in my web development.  Try it out!

AjaxLoad.info
 
 
Copyright © 2015 James Irwin.
Clear by BloggerThemes Design by Diovo.com, with serious alterations by the author.