<hr> alignment problems, Can't align <hr> to center |
<hr> alignment problems, Can't align <hr> to center |
Seniorbfc |
Feb 17 2017, 01:27 PM
Post
#1
|
Newbie Group: Members Posts: 17 Joined: 16-January 17 Member No.: 26,267 |
I cannot align my <hr> to the center of the page, I can change the width but the alignment stays on the left. I have tried <hr align="center" width="20%">
CODE <div id="content"> <h1>Joshua Senior</h1> <hr align="center" width="20%"> <p>A Second Year Student At Sheffield Hallam University</p> <p>Studying BSc Hons Accounting And Finance</p> <br> <img src="portrait.jpg" alt="Portrait" style="width:300px;height:300px;"> </div> CODE #content { background: #fffff; width: 100% position: relative; top:400px; background:#ebebeb height: 1500px; padding-top: 70px; padding-bottom: 70px; font-family: "malgun gothic", malgun, serif; } #content h1{ font-size: 40px; } #content p{ font-size: 16px; } |
pandy |
Feb 17 2017, 02:34 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
It's as centered as can be for me. Maybe you have something more in the real page that disturbs this?
You may want to do it with CSS instead though, since those attributes have been deprecated some 20 years. CODE hr { width: 20%; margin-left: auto; margin-right: auto } |
Seniorbfc |
Feb 17 2017, 02:53 PM
Post
#3
|
Newbie Group: Members Posts: 17 Joined: 16-January 17 Member No.: 26,267 |
Thanks, I sorted it using CSS. Here's the code I used just in case someone else has the same issue.
CODE #break{ background: #777777; height: 1.5px; width: 30%; margin: auto; } |
pandy |
Feb 18 2017, 01:30 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
It shouldn't make a difference. The HTML should also work. Did you copy-paste what you showed here or did you type? Maybe you had a typo in the real page.
|
Lo-Fi Version | Time is now: 24th April 2024 - 12:15 PM |