Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Sep 2012
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    changing text color in css

    I'm trying to find the CSS for changing the color of text and can't seem to find it.

    http://www.healingaxis.ca/areas.html

    Code:
    body {
    	background-color: black;
    	
    	margin: 10px;
    }
    .content h2 {
    	margin-top: 0;
    }
    
    
    .header {
    	background-image: url(../images/banner.jpg);
    	height: 150px;
    	width: 780px;
    	margin: 0 auto;
    }
    .header h1 {
        color: white;
        float: right;
        font-size: 44px;
        font-style: italic;
        margin: 45px;
        position: relative;
        text-transform: uppercase;
        z-index: -1;
    }
    
    .menu {
    	background-color: #FFFFFF;
    	border: 1px solid black;
    	width: 780px;
    	margin: 0 auto;
    }
    .menu > ul {
    	
    	border: 1px inset black;
        list-style-type: none;
        margin: 2px;
        padding: 1px;
    }
    .menu > ul > li {
        float: left;
        margin-right: 0;
        width: 16.66%;
    	position: relative;
    }
    .menu ul li ul {
    	position: absolute;
    	background-color: white;
    	border: 1px solid black;
    	border-top: 2px solid white;
    	list-style-type: none;
    	margin: 0;
    	padding: 0;
    	width: 100%;
    	display: none;
    }
    .menu ul li:hover ul {
    	display: block;
    }
    .menu ul li ul li {
    	margin-top: 3px;
    }
    .menu a {
        color: black;
        display: block;
        text-align: center;
        text-decoration: none;
    }
    .menu a:hover {
        background-color: #000000;
        color: white;
    }
    
    .content {
    	background-color: white;
    	width: 760px;
    	margin: 0 auto;
    	min-height: 300px;
    	padding: 50px 10px 10px;
    }
    
    
    .eduTable {
    	width: 455px;
    	margin: 0 auto;
    	border: 0;
    	padding: 0;
    }
    .eduTable td {
    	vertical-align: top;
    	text-align: left;
    }
    .eduTable th:first-child, .eduTable td:first-child {
    	text-align: left;
    }
    .eduTable h4 {
    	margin: 0;
    }
    .eduTable ul {
    	margin-top: 0;
    	padding-left: 15px;
    	list-style-type: square;
    }
    
    .bio {
    	width: 455px;
    	margin: 0 auto;
    }
    
    .areas {
    	width: 455px;
    	margin: 0 auto;
    }
    
    .contact {
    	width: 550px;
    	margin: 0 auto;
    }
    
    .imageLeft {
    	float: left;
    	margin-right: 20px;
    	margin-bottom: 15px;
    }
    .imageRight {
    	float: right;
    	margin-left: 20px;
    	margin-bottom: 15px;
    }
    
    .clearfix:before, .clearfix:after { content: ""; display: table; }
    .clearfix:after { clear: both; }
    .clearfix { *zoom: 1; }
    
    .footer {
        text-align: center;
        margin-top: 50px;
    }
    
    .footer1 {
        text-align: center;
        margin-top: 50px;
    	color:#FFFFFF
    }

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    2,046
    Thanks
    15
    Thanked 241 Times in 241 Posts
    There really isn't any, that's a job for javascript, and all javascript styles are inline.
    Code:
    obj.style.color = "red";
    Just supply the identity of the obj and the text will turn red.
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • #3
    Regular Coder
    Join Date
    Sep 2012
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What do you mean by Just supply the identity of the obj and the text will turn red.

  • #4
    New Coder
    Join Date
    Apr 2013
    Posts
    39
    Thanks
    2
    Thanked 2 Times in 2 Posts
    if you want red font color in the content, you can add this in the css style

    color:red;

  • #5
    Senior Coder
    Join Date
    Sep 2010
    Posts
    2,046
    Thanks
    15
    Thanked 241 Times in 241 Posts
    Code:
    thehead = window.document.getElementsByClassName("header");
    thehead[0].style.color = "red";
    BTW, if you have only one header on your page, just give it an ID, classes are for multiple instances, ID are for oners.
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • #6
    Senior Coder
    Join Date
    Sep 2010
    Posts
    2,046
    Thanks
    15
    Thanked 241 Times in 241 Posts
    Quote Originally Posted by cssbutton View Post
    if you want red font color in the content, you can add this in the css style

    color:red;
    You may have a better idea of what he wants than I do, I'm just guessing he wants to change it at will, dynamically. Still simple though.
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • #7
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    837
    Thanks
    11
    Thanked 79 Times in 77 Posts
    1) Your .header and h1 text are white in color. "color: white;"

    2) .menu a text is black. "color: black;"

    3) .menu a:hover text is white. "color: white;"

    4) .footer1 text color is whte. "color:#FFFFFF"

    Change those to change your text color.
    ☠ ☠RON☠ ☠

  • #8
    New Coder
    Join Date
    Jun 2013
    Posts
    34
    Thanks
    1
    Thanked 2 Times in 2 Posts
    I don't understand why you don't find it; its very simple color: red.

  • #9
    New Coder
    Join Date
    Feb 2013
    Posts
    37
    Thanks
    1
    Thanked 4 Times in 4 Posts
    For CSS that syntax is relatively easy. Just add color: red; to the line of css.

    For example if I want all of the text in the body to be red I'll use the following:

    Code:
    body {
    	background-color: black;
    	color: red;
    	margin: 10px;
    }
    More information on setting text colors in CSS can be found at W3schools.com.

    I hope this helps.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •