Setting the Foreground Color
color property sets the foreground color of an element.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
<style>
p {
padding: 5px;
border: medium double black;
background-color: lightgray;
font-family: sans-serif;
}
#myID {
font-size: x-large;
border: medium solid white;
background-color: green;
color: rgba(255, 255, 255, 0.7);
}
a:hover {
color: red;
}
</style>
</head>
<body>
<p>
<span id="myID">CSS</span>
<a href="http://java2s.com">java2s.com</a>
</p>
</body>
</html>
Home
HTML CSS Book
CSS
HTML CSS Book
CSS
Foreground Color Opacity:
- Setting the Foreground Color
- Setting Element Opacity
Related: