The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> <hr> alignment problems, Can't align <hr> to center
Seniorbfc
post 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;
}
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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 }
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Seniorbfc
post 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;
}
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 12:15 PM