Category Archives: Presentation

Styling select dropdown with Javascript replacement

Comments (0)

My main issue was the lack of control on the look of select dropdown, especially with IE if an option width is wider than the select initial width. Firefox deals with that issue by automatically increasing the list but unfortunately IE cuts off the text.

I’ve been using the Mootools Javascript library to automatically hide the […]

Dreamweaver Fails Conditional Comments

Comments (2)

If you create Dreamweaver templates for yourself or clients and have pages in multiple subdirectories, you’ll notice Dreamweaver fails to update the relative path to the IE stylesheets if you use conditional comments for them. Because they’re comments, Dreamweaver ignores them. Luckily, Dreamweaver has a plethora of parameters to get around almost any problem, so […]

Conditional Comments Fix IE Bugs

Comments (2)

As pointed out in some earlier comments, there’s a great way to fix IE bugs without hacks or relying on one browser bug to solve another one. I present to you conditional comments.

<!–[if IE 6]><link rel=”stylesheet” href=”stylesheets/ie6.css” type=”text/css” media=”all” /><![endif]–>

Yes, you read that correctly. If the browser is IE6, apply these styles. It’s that simple.
Other […]

Styling the horizontal rule

Comments (8)

It’s never good practice to use HTML elements as presentation elements, but sometimes you gotta use an <hr />.

color: #000;
background-color: #000;
height: 4px;
border: none;

Note that you have to specify the color and background color so it works in IE.

Quick and easy IE hack for CSS

Comments (3169)

As you probably know, Internet Explorer has a bad habit of butchering CSS. While working on a project the other day, I came across a quick way to fix CSS that looks great in all browsers except for IE. If you weren’t aware (I wasn’t!), the underscore character preceding any property in a […]

Get rid of that dotted border

Comments (18)

Many times, when you click on someone’s logo, you see that little dotted border around the image when you click it. I think it looks sloppy.

There is an easy CSS fix for this:

a { outline: none; }

Try it.

Double-Margin Bug in IE6

Comments (18)

I always forget about this bug and end up being puzzled as to why the spacing on my page is all wrong, so remember this! This bug happens when you have a floated element with a margin defined in the same direction of the float. For example:
#sidebar {
float: left;
[…]

Attach Icons to Links Automatically

Comments (27)

Let your readers know before they click a link and it opens up some large application like Acrobat, Word, Excel, or Quicktime.

The HTML for the above link has no styles attached to it:
<a href=”news/issue12.pdf”>View Latest Issue</a>
The trick is all in the CSS:
a[href $=’.pdf’] {
padding-right: 18px;
background: transparent url(icon_pdf.gif) no-repeat center right;
}
Now when you link […]

Make the <pre> tag wrap

Comments (0)

The pre tag stands for preformatted text, but it acts differently in all browsers. Here is a snippet of code that should cover all bases:
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
[…]

Style Everything at Once

Comments (1)

Have a common property in the majority of your elements? Just style everything the same way with an astrisk:
* { margin: 0; padding: 0; }
For this example, now you only need to set margin and padding where you actually need some! The Universal Selector’s convenience doesn’t stop there, check out Eric Meyer’s post to learn […]

vpn service