Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14-04-2009
Member
 
Join Date: Feb 2009
Posts: 80
How to Change CSS Text Color

hello
I use this code to set my background-color and my scrollbar color, but whatever I try, I can't seem to change my text-color. Can someone tell me how to edit that color ?
Reply With Quote
  #2  
Old 14-04-2009
Member
 
Join Date: Aug 2007
Posts: 1,098
Re: How to Change CSS Text Color

try to use Css to change text color (not using it for headers)
.navy {color:#000080;}
.black {color:#00000;}
etc
HTML= <div class="navy"> etc
Reply With Quote
  #3  
Old 14-04-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: How to Change CSS Text Color

  1. Open up your text-based HTML editor. Open up a file so you can see and edit the source.
  2. Set up default colors. Create a tag: <style type="text/css"> and insert it before the body tags. After that, begin defining the colors of different types of text. For example, to make all the headlines blue, type: H1 {color: blue}. Define all the text types, each one on a separate line. When you are done, close the tag with </style>.
  3. Use default colors. After defining default colors, whenever you use that particular tag, it will be in your predefined color. For example, we have set H1 to blue, so if you were to type <h1> WOW! </h1> it would automatically be in blue.
  4. Make an exception. If you want something to be something other than the default color, then simply place the CSS tag within the HTML tag to change it on the fly. For example, to change headlines to red, you would type <h1 style="color: red"> Now it's Red!</h1>.
  5. Use contextual selectors. When defining defaults in the beginning, you can also set up more exceptions, based on context. For example, if you want all italics in the headline to be green, you would type: <h1 i "color: green">. Now, whenever you make something italic within a headline, it will be green, but outside it will be the default color.
Reply With Quote
  #4  
Old 14-04-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: How to Change CSS Text Color

try this

<html>

<head>
<style type="text/css">
h1 {color: #00ff00}
h2 {color: #dda0dd}
p {color: rgb(0,0,255)}
</style>
</head>

<body>
<h1>This is header 1</h1>
<h2>This is header 2</h2>
<p>This is a paragraph</p>
</body>

</html
Reply With Quote
  #5  
Old 14-04-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: How to Change CSS Text Color

if you wish to set the text color for the whole page, then use this code....
Code:

Quote:
<style type="text/css">
<!--
body {
color:#ff0000;
}
//-->
</style>
....if you wish to set the text color for a specific element, then use this code....
Code:

Quote:
<style type="text/css">
<!--
.foo {
color:#ff0000;
}
//-->
</style>

...then add this to the element...
Code:


<div class="foo">this text will be red</div>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to Change CSS Text Color"
Thread Thread Starter Forum Replies Last Post
How to change title text color on Windows 8 Jason Voorhees Customize Desktop 4 24-09-2012 03:45 PM
How to change cell color in excel based on text input Chini mao Windows Software 2 06-01-2012 09:19 PM
Procedure to Change font text color in Windows 7 chyarte Windows Software 4 03-12-2010 06:45 AM
How to change text color using 'IF" in Excel Antrix Windows Software 2 26-06-2009 07:02 PM
Change text color in Console Zool Software Development 4 08-05-2009 11:19 PM


All times are GMT +5.5. The time now is 08:47 PM.