DFS MB SDN Stuff PIX CAL Home Stereos Snacks Batman Shop



You are at the section Intro to CSS

Fun With Backgrounds: Colors

examples using Background CSS tags

Using the p element: (you can also use h1, h2, h3, h4, h5, h6, body, and div elements too).
<p style="INSERT CSS HERE">
Let's change the background of the paragraph to white. Also, we'll change the text to black.
<p style="background-color:white; color:black">

The background in this paragraph is white, and the color of the text is black. The background in this paragraph is white, and the color of the text is black. The background in this paragraph is white, and the color of the text is black. The background in this paragraph is white, and the color of the text is black.

</p>

You can do the same in a DIV element. Let's set the background to yellow and the text to red.
<div style="background-color:yellow; color:red">
The background in this paragraph is yellow, and the color of the text is red. The background in this paragraph is yellow, and the color of the text is red. The background in this paragraph is yellow, and the color of the text is red. The background in this paragraph is yellow, and the color of the text is red.
</div>

Let's nest the p element inside the div element using the same colors:
<div style="background-color:yellow; color:red">
The background in this paragraph is yellow, and the color of the text is red. The background in this paragraph is yellow, and the color of the text is red.
<p style="background-color:white; color:black">

The background in this paragraph is white, and the color of the text is black. The background in this paragraph is white, and the color of the text is black. The background in this paragraph is white, and the color of the text is black. The background in this paragraph is white, and the color of the text is black.

</p>
The background in this paragraph is yellow, and the color of the text is red. The background in this paragraph is yellow, and the color of the text is red.
</div>

Menu:
Intro to CSS Main Page Fun With Font: Font Families Fun With Fonts: Font Styles Fun With Fonts: Font Weights Fun With Fonts: Font Sizes Fun With Text: Color Fun With Text: Decoration Fun With Text: Transformation Fun With Text: Alignment Fun With Text: Indentation Fun With Background: Color
Related:
Dave's Fun Stuff's Stuff Your Screen Size Electricity Rates HTML Colors Small Color Tables Large Color Tables Color Spans Creating CSS Colorful Link Buttons PC Keystroke Codes Eat More Potassium! State Abbreviations Intro to CSS D.T.'s Web Icons Optical Illusions Star Codes Windows Alt Codes Fun With Money Bits 'N' Bytes Celebrity Autographs TV Died Fast Food Fish Sandwich Reviews San Diego Apartment and Condo Maps Calendar History Jesus' Date of Conception Calendar Coincidence Software You Need DFS Bookmarks MikeMan Stupid Cat Videos Unicode Madness Unicode Tables Emoji Codes Alternative Letter Codes Unicode Country Flag Codes Game Piece Codes Dingbat Codes
Market Zone:
Amazon Shopping The DFS Market
TV Zone:
Find your favorite TV shows with "Let's Watch TV!"
Notable:
The Del: Dave's Entertainment Library! Celebrities a2z Hit Song Titles Stuff! Gregorian Calendar Collection Desktop Gregorian Calendar Collection (Mobile)-English Picture Gallery SDN Media News and More
Footer:
Dave's Fun Stuff Mega Birthdays Contact Webmaster





© 1995-2018. davesfunstuff.com All Rights Reserved. Reproduction of any part of this website without expressed written consent is prohibited.

Website Cookie Policy