Monthly Archives: June 2008

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;
[…]

Reset styles

Comments (8)

Kevin Cupp posted earlier about a way to style everything at once using the universal selector (*). That is not my method of choice though because:

It’s too general. I don’t think there should be a rule that applied to EVERY element. Especially margin and padding because those are modified all throughout the cascade.
It’s slower. The […]

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 (1)

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 […]

Easy PNG transparency for IE6

Comments (1)

In honor of Mager’s new transparancy-heavy (and f***ing sick) site redesign by Marc Mendell, here’s a quick and easy way to make png transparencies work in IE6.
So you have your background url set something like this and it looks awesome in all the real browsers:
#pngImage {
background: url(transparent-bg.png) no-repeat;
}
But in […]

<sup> tag in IE6

Comments (2)

What’s up with the <sup> tag? It’s a semantic way of marking up superscripts, but it acts funny in IE6 (are you surprised?).

You will notice here that the screenshot on the left looks a little cramped. Here is the fix:
sup {
text-align: vertical
}
If you want to move the number higher […]

vpn service