Wednesday, December 28, 2011

define color in CSS

color in CSS can be specified in the forms of keywords, hexadecimal, short hexadecimal, rgb(r, g, b) or rgb(r, g, b) in %.

example:
define color in CSS

<html>
<head>
<title>CSS - color</title>
</head>
<body
style="
margin-left:20px;
margin-right:20px;
background-image:url(http://goo.gl/ZTEx7);
background-repeat:no-repeat;
background-position:bottom right;
background-color:#e0e0e0;
">

<h1 style="font: bold 2em helvetica">Mobile-Web-App: color</h1>
<p>color in CSS can be specified in the forms of keywords, hexadecimal, short hexadecimal, rgb(r, g, b) or rgb(r, g, b) in %:</p>
<ul><li>
<p style="color:white; background-color:black">keywords: style="color:white; background-color:black"</p>
</li><li>
<p style="color:#101010; background-color:#f0f0f0">hexadecimal: style="color:#101010; background-color:#f0f0f0"</p>
</li><li>
<p style="color:#fff; background-color:#111">short hexadecimal: style="color:#fff; background-color:#111"</p>
</li><li>
<p style="color:rgb(255, 0, 0); background-color:rgb(0, 255, 255)">rgb(r, g, b): style="color:rgb(255, 0, 0); background-color:rgb(0, 255, 255)"</p>
</li><li>
<p style="color:rgb(100%, 100%, 100%); background-color:rgb(0%, 0%, 0%)">rgb(r, g, b) in %: style="color:rgb(100%, 100%, 100%); background-color:rgb(0%, 0%, 0%)"</p>
</li>
</ul>
</body>
</html>

No comments:

Post a Comment