Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    Oct 2007
    Posts
    241
    Member #
    15910
    Hi
    How can I change color of text and font size etc within the cells of table? I want the same for every cell.
    Here is the css code I wrote:
    .topmenufix
    {
    font-size:10px;
    font-family: arial;
    color:red;
    }

    and here is the table:
    <div class="topmenufix">
    <table border="0" >
    <tr>
    <td>
    <a href="http://www.xxxxxxxxxxx.com">link text</a>
    </td>
    </tr>
    </table>
    Now, only the font family seems to take effect. I can not modify font color and size even if i type something else say font size 5 or color blue etc...it doesnt take effect. What might be the reason?

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    As the content of the td is a link, use the link selectors.

    Take the following example.

    HTML Code:
    <html>
    
    <head>
    
    	<title>CSS tr</title>
    
    	<style type="text/css">
    
    	table tr
    	{
    		color: green;
    	}
    
    	table tr a:link
    	{
    		color: red;
    		font-family: arial;
    		font-size: 10px;
    	}
    
    	</style>
    
    </head>
    <body>
    
    	<table>
    		<tr>
    			<td><a href="http://www.xxxxxxxxxxx.com">link text</a> I am green!</td>
    		</tr>
    	</table>
    
    </body>
    </html>
    The link will appear red and the text will appear green. If you did not have the color: red; in the a:link style the link would come out blue (or your browsers default color for links.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:36 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com