hi,
is there anyway to css the value=“” attribute of input fields?
Do you mean target input areas that have the attribute value=“” and style them? Or to use CSS to make input areas have the value = “”?
i want to style value=“First Name”, so i can css and style First Name text accordingly.
nofel, try this CSS3 selector:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Target a Selector by Attribute Value</title>
<style type="text/css">
input[value^="First"] {color:red;}
input[value^="Middle"] {color:green;}
input[value^="Last"] {color:blue;}
</style>
</head>
<body>
<input value="First Name">
<input value="Middle Name">
<input value="Last Name">
</body>
</html>
If you need to target older, non-compliant browsers, you will have to assign a class to the <input> field and style it via it’s class.