Title: css horizontal line
Last modified: August 19, 2016

---

# css horizontal line

 *  Resolved [avecchioni](https://wordpress.org/support/users/avecchioni/)
 * (@avecchioni)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/css-horizontal-line/)
 * I’m a newbie cleaning house. I’m down to my last validation error and I could
   use some help. The error comes from my static home page (which uses a page template
   called home2.php). See my [home page](http://spaghettiboxkids.com/blog/). You
   can see there that I have a centered red line between statements. The fact that
   the line has color is what triggers the validation error:
 * Line 152, Column 22: there is no attribute “color”.
    <hr width=”58%” color=”#
   cc3333″ size=”1″ /></center>
 * After much ado, I’ve gathered that my code for the centered line needs to be 
   in css. I tried this (in my home2.php template), but it doesn’t center in mozilla:
 *     ```
       <p><hr style="color:#cc3333; text-align:center; height:1px; width:38%; font-size:1px; border:none;">
       </p>
       ```
   
 * I also tried inserting this into my style sheet, but I’m not sure if it’s correct
   or what exactly to do after the insertion:
 * `hr { text-align: center; width: 38%; height: 2px; color: #cc3333; border: none;}`
 * Any help is greatly appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [annelions](https://wordpress.org/support/users/annelions/)
 * (@annelions)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/css-horizontal-line/#post-841445)
 * Instead of doing color=”#cc3333″ do style=”color:#cc3333″ and I think that should
   work.
 * A really helpful site you might want to visit is [http://www.w3schools.com](http://www.w3schools.com)
   and it has all sorts of PHP, HTML & CSS tutorials and try-it-yourself things.
   I use it all the time. 🙂
 *  [jbbrwcky](https://wordpress.org/support/users/jbbrwcky/)
 * (@jbbrwcky)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/css-horizontal-line/#post-841456)
 * Try:
 *     ```
       <div style='text-align:center;margin:0 auto;">
       <hr />
       </div>
       ```
   
 * Keep your css colour values in the stylesheet. Should work just fine as you want
   it.
 *  Thread Starter [avecchioni](https://wordpress.org/support/users/avecchioni/)
 * (@avecchioni)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/css-horizontal-line/#post-841485)
 * annelions– When I change color=“#cc3333” to style=“color:#cc3333” in my page 
   template as follows:
 *     ```
       <center>
       <hr width="58%" style="color:#cc3333"  size="1" /></center>
       ```
   
 * . . .the line turns grey in mozilla, but stays red in ie. To try to fix this,
   in my style sheet I added this: `.red2 { color: #cc3333; }` . . . but I’m not
   sure what to do with that in my page template. (w3schools looks like an awesome
   resource–right now I didn’t see anything specific re: horizontal lines.)
 * jbbrwcky– I tried:
 *     ```
       <div style='text-align:center;margin:0 auto;">
       <hr />
       </div>
       ```
   
 * in my page template, but right sidebar went blank in one instance and moved into
   page contents in another instance (and no line in either case). I’m not sure 
   what I’m doing wrong.
 *  Thread Starter [avecchioni](https://wordpress.org/support/users/avecchioni/)
 * (@avecchioni)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/css-horizontal-line/#post-841548)
 * This worked:
 *     ```
       <center>
       <hr style="color:#c33;background-color:#c33;height:1px;border:none;width:38%" /></center>
       ```
   
 * . . .Centers, with color, and works in mozilla and ie without validation error.
   Thanks so much for the assistance!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘css horizontal line’ is closed to new replies.

## Tags

 * [<hr>](https://wordpress.org/support/topic-tag/hr/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [horizontal line](https://wordpress.org/support/topic-tag/horizontal-line/)

 * 4 replies
 * 3 participants
 * Last reply from: [avecchioni](https://wordpress.org/support/users/avecchioni/)
 * Last activity: [17 years, 7 months ago](https://wordpress.org/support/topic/css-horizontal-line/#post-841548)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
