Jump to content

how to stop same color warning with inline css


redarrow

Recommended Posts

advance thank you.....

 

becouse i use the same color with inline css i get the dreaded warning from valdation

please can u tell me how to get rid off the warning..

 

can someone kindly show me how to use the same color with inline css.....

 

thank you........

 

<table align="center" style="border-style: solid; background: #FF0000; border-color: #FF0000; width: 692px;">
<tr>
<td style="width: 20%; background: #808080;" align="center">
<a style="text-decoration: none;" href="index.php">Home</a>
</td>
<td style="width: 20%; background: #808080;" align="center">
<a style="text-decoration: none;" href="services.php">Service</a>
</td>
<td style="width: 20%; background: #808080;" align="center">
<a style="text-decoration: none;" href="sale.php">For Sale</a>
</td>
<td style="width: 20%; background: #808080;" align="center">
<a style="text-decoration: none;" href="links.php">Links</a>
</td>
<td style="width: 20%; background: #808080;" align="center">
<a style="text-decoration: none;" href="contact.php">Contact Us</a>
</td>
</tr>
</table>

Link to comment
Share on other sites

The same color as what? What is the error you are getting?

 

Your use of CSS here is very inefficient. It basically goes against the whole idea behind CSS - only have to declare something one time.

 

Put this in the head of your document:

 

<style type="text/css">
td
{
    width: 20%;
    background: #808080;
    text-align: center;
}

a
{
    text-decoration: none;
}
</style>

 

and change your td tags to look like this:

 

<td>

 

and your 'a' tags to look like this:

 

a

 

That will cut your code significantly, and if you want to change anything you will only have to change it in one spot, rather than every single tag on the page. It makes your code more compact and easier to read as well.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.