Forum Moderators: not2easy
label:first-letter {
font-weight : bold;
text-decoration : underline;
}
<form>
<label for="name" accesskey="n">name</label> <input type="text" id="name" tabindex="1">
</form>
If I set up the same pseudo-element for, say, a paragraph tag (P:first-letter), it works...
Any ideas on what I'm missing?
Thanks!
*:first-letter {
color: #00f;
}
<form>
<label for="name" accesskey="n">name</label> <input type="text" id="name" tabindex="1">
</form>
label:first-letter {
color: #00f;
}
<form>
<label for="name" accesskey="n">name</label> <input type="text" id="name" tabindex="1">
</form>
.lbl:first-letter {
color: #00f;
}
<form>
<label class="lbl" for="name" accesskey="n">name</label> <input type="text" id="name" tabindex="1">
</form>
I tried hanging a class on the label tag like you suggested, but with no luck. I think I've been looking at this so long, I might be overlooking an obvious mistake. Here's the code I've been working with:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled</title>
<style type="text/css">
.lbl:first-letter {
color: #00f;
}
</style>
</head>
<body>
<form>
<label class="lbl" for="name" accesskey="n">name</label> <input type="text" id="name" tabindex="1">
</form>
</body>
</html>
If you (or anyone else) sees a problem, I'd really apreciate the help.
Thanks again!
However, I should only work for block-level elements:
[w3.org...]
The :first-line pseudo-element can only be attached to a block-level element.