How to Change the Color in a General Section
Colors have a way of bringing Web pages to life, whether you're working with the entire page or a specific section. You can make the main, or general, section of your Web page stand out by changing its color. Doing so requires just a few lines of code, which can be added to existing HTML tags. Together with cascading style sheets, you can colorize a single word, a line of text, a paragraph or an entire section or background.
Instructions
-
-
1
Start Notepad, TextPad, EditPad or your favorite text editor. Select "File" and "Open" from the menu. A dialog box will open. Find and double-click the HTML file you want to modify.
-
2
Insert the following code between the opening and closing HEAD tags to color text within a section yellow. To apply a different color, replace "yellow" with the color you want to use. Replace "color:yellow;" with "background-color:yellow;" to color the section's background rather than its text.
<style type="text/css">
<!--
.myColor {
color:yellow;
}
-->
</style>
-
-
3
Add 'class="myColor"' to the general section within the opening and closing BODY tags as follows. It applies the style you created in the previous step to the section.
<div class="myColor">Your contents go here.</div>
-
1