I am having some trouble changing the color of my HR tag in HTML. All it is doing is making a HR but it is not changing the color. Any help would be greatly appreciated.


This is the code I am using:

<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.css" />


<h1>Email Preferences</h1>
<hr color="#FF0000" />

<table class="form-body">
<td><a href="index.php?option=com_content&amp;view=article&amp;id=221"><span>Subscribe to Report of the Week</a>
<td><a href="index.php?option=com_content&amp;view=article&amp;id=222"><span>Unsubscribe to Report of the Week</a>
<td><a href="index.php?option=com_content&amp;view=article&amp;id=223"><span>Update Your Email Address</a>

Try applying this set of properties for maximum compatibility across browsers.

First remove the color attribute from the <hr> tag. Next apply this style in CSS.

hr {color: #FF0000; background-color: #FF0000;height: 1px; border:none;}

or if you just want to test it within the HTML page,

<hr style="color: #FF0000; background-color: #FF0000;height: 1px; border:none;" />

Awesome that works!


Great! Take care...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.