/    Sign up×
Community /Pin to ProfileBookmark

IE filters with small fonts

I realize there’s a problem with IE opacity. See [URL=”http://www.webmasterworld.com/css/3676444.htm”]here [/URL]for an example. Setek’s code there fixes the problem if you supply a background color, but [B]if your fonts are small, it doesn’t[/B]. Example:

[code=html]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
<html>
<head>
<style type=”text/css” >
body {
background-color: #9cf;
font-family: sans-serif;
font-size: 6pt;
}
p {
padding: 10px 15px;
background-color: #444;
color: #fff;
}
p.filter {
opacity: 0.4;
filter: alpha(opacity=40); /* this is because ie doesn’t render the opacity property */
zoom: 1.0; /* this triggers hasLayout */
}
p.filter_nobackground {
background-color: transparent; /* this is what happens without a background colour */
opacity: 0.4; /* ie 6 & 7 */
filter: alpha(opacity=40);
zoom: 1.0;
}
</style>
</head>
<body>
<p>This is a test paragraph</p>
<p class=”filter”>This should work but doesn’t!!!!!!</p>
<p class=”filter_nobackground”>This is a test paragraph with the alpha opacity filter, but with no background colour set</p>

</body></html>[/code]

Anyone know how to properly give an opacity to elements with a small font in IE? I’m working with version 7 at the moment if it matters.

to post a comment
CSS

0Be the first to comment 😎

×

Success!

Help @Coolness spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.30,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...