/    Sign up×
Community /Pin to ProfileBookmark

Transparent Valid Color?

I read on HTMLdog that transparent was a valid color, I tried it in HTML and it came out Blue. I was wondering if this is only true for CSS?

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelDec 19.2006 — "transparent" is a valid [B]background[/B]-color. When stating a "color:black;" for making the text "black", you need to also state a background-color. This is for Accessability reasons. In the absence of stating a default background-color, let's say you want WHITE text. Fine. "color:white;" for the text... but whoa... MY default background-color onf web page visited is already WHITE... so YOUR white-text will be invisible to me. Stating a default background-color is supposed to override MY default background-color... so if you stated "background-color:blue; color:white;", you will be showing me WHITE text on a BLUE background. That should work.

But if you wanted the text to be BLACK and allow the 'background' of your page to show-through the text... you have to state "background-transparent;" else MY browser might assume WHITE and thus, your background will not 'show through' the text as you intended it to...

And bear in mind, the user can set their default colors to something that renders your construct virtually useless (like, if I instruct my browser to show all text white and all background-colors white), all pages I visit will be ...white. :eek:

From what you say about 'blue', -are we talking about TEXT, or an ANCHOR? It sounds more like you are getting default link colors. If so, :

a:link {color:value;}

a:visited {color:value;}

a:hover {color:value;}

a:active {color:value;}

might help.

?
×

Success!

Help @7Changedotcom 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.20,
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,
)...