Home

Gallery

Archives

Blog

About

Contact Me

"Personal thoughts, ramblings, and nonsense from Drew, himself."

CSS Hack: Hide from IE

As I have been designing small-based, bear-minimum CSS design layouts I have just coded and been done with it. The past six months have been a learning experience and have come to love CSS for what it’s worth. Sometimes, though, designing gets hedious and I have to use hacks; for today, we aim one at Internet Explorer. Please note: This is yet another older piece of writing of mine. As it still probably holds value, I do try to stay away from CSS hacks, but sometimes, they really do come in handy.

There is one hack that I seem to come across more than I really should, but apparently it is one of the most important hacks of today, or should I say, of Internet Explorer? When designing the new layout for Dev-News, I had to use this once. What happened was, Internet Explorer wasn’t spacing bulleted items like ALL the other broswers were; even Opera.

To send different CSS rules to Internet Explorer, I had to use the child selector command, in which Internet Explorer can’t understand (figures). The child selector command involves two elements, one is the parent, and the other the child to the parent. So, the following refers to the child, body, contained within the parent, html:

CSS

html>body

Now let’s take a practical example from Dev-News (now, non-existant website):

CSS

#info ul li a {
           display:block;
           width:175px;
           background:url('path_to_image.gif') no-repeat left top;
           padding:0px 0 0 15px;
           margin-top:-5px;
           color:#fff;
}

html>body #info li a { margin-top:2px; }

Internet Explorer can’t understand the second CSS rule, due to the hack, so it will ignore it and use the first rule and all other browsers will use the second rule. This has really helped me out with designing a layout. I used to pull my hair out and just let it be. Now that I design compliant websites, I have no room for anything less than perfect - so to speak.

Enjoy, and have fun with your CSS.

The Notebook

Windows Fix: "Insufficient system resources exist to complete the API"
Ugh. Another Windows error. Another Windows error that really doesn’t tell you what is really wrong; some (most) people aren’t nerds. Don’t worry, I’ve got your fix right here. This has to do with memory on your Windows XP system. Have you tried Hibernating or putting your system into standby after upgrading your RAM? If you have, keep on reading. More...

Curing 'Symbolic link not allowed' (Apache 2.0)
Awhile back when trying to add a directory to Apache on my Ubuntu 6.06 LTS server, I ran into some issues. These issues, of course were the infamous 403 “Forbidden” error that your web barfs up when you try to access a server that is not publicly viewable, because of permission issues. I’m going to give you my scenario and explain how you can fix this issue, so that you don’t have to go through an hour of throwing your hands up in disgust. More...

VMWare: "Failed to create named-pipe directory" error
Have you ever received the Failed to create named-pipe directory error message via the vmware-mui error log files, and not able to access the VMWare Management Interface? If so, here’s the fix. More...

/bin/rm: Argument list too long
Removing gigs and gigs, or just alot, of unwanted “opened” email that often clutters the system. More...