Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>Color Example</title> <style> div { padding: 20px; margin: 20px; } .textColor { color: #0000CD; background-color: white; } .borderColor { border-width: 3px; border-style: solid; border-color: #0000CD; } .backgroundColor { background-color: #0000CD; color: white; } .backgroundGradient { background: linear-gradient(to bottom, white, #0000CD); color: white; } .lighterColor { background: #4C4CDC; } .darkerColor { background: #00008F; } .lighterColor > p, .darkerColor > p { color: black; background: white; padding: 3px; border-radius: 3px; display: inline-block; } </style> <div class="textColor borderColor"> <h1>Testing Text in #0000CD</h1> <p>This text has been styled with a color of #0000CD.</p> <p>The border is also uses #0000CD.</p> <p>Try changing the values to see how it affects the output.</p> <p>And see this color applied to the <a target="_blank" href="/html/codes/color/color-tester.cfm?hexColor=0000CD">Color Tester</a>.</p> </div> <div class="backgroundColor"> <h1>Testing a background color of #0000CD.</h1> <p>This has a background color of #0000CD.</p> <p>Try changing the values to see how it affects the output.</p> </div> <div class="backgroundGradient"> <h1>Testing a background gradient.</h1> <p>This has a background gradient going between white and #0000CD.</p> <p>Try changing the values to see how it affects the output.</p> </div> <div class="lighterColor"> <p>Lighter color: #4C4CDC</p> </div> <div class="darkerColor"> <p>Darker color: #00008F</p> </div>