Solved

Can't position my <HR> tag

Posted on 2011-03-02
6
344 Views
Last Modified: 2012-05-11
    I have this simple CSS document which has an endnote section at the bottom. I have this horizontal rule (horizontal line) that precedes the endnote. I want to position the line so that it's all the way to the left, but instead its centered and I can't figure out why. Can somebody please check the code and see why?
     Also, I want the line to be about one quarter the length of the screen. I specified its size in "em," but I'm not sure if there is a better method (like using pixels or percentages). I'm kind of fuzzy when trying to determine whether to use em's, pixels or percentages (or any other methods) when specifying sizes. Can anybody give me some pointers? HRtag.htm
0
Comment
Question by:john8217
6 Comments
 
LVL 19

Accepted Solution

by:
daveamour earned 125 total points
Comment Utility
try this:

<div class="endnote" style="text-align: left;">
0
 
LVL 19

Expert Comment

by:daveamour
Comment Utility
Ps - this for the width:

<hr width="25%" noshade>
0
 
LVL 19

Assisted Solution

by:Bardobrave
Bardobrave earned 125 total points
Comment Utility
Percentages are better suited for object measures, while "em"s are better suited for font sizes.

Both are dinamyc measure units, as they will adjust depending on external features (as container's window size or SO's font size preferences).

Pixels can be used for objects and fonts, but the measures you define in pixels are FIXED and won't be able to "autoadjust" dinamycally.

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 5

Expert Comment

by:h4mi
Comment Utility
.endnote
{
   position:relative;
   margin-left:0%;
}
.endnote hr
{
   text-align:left;
}
0
 

Expert Comment

by:userboy87
Comment Utility
If you don't mind conditional comments to circumvent IE < 8 weirdness...

<style type="text/css">
  .endnote hr {
    display: inline-block;
    width: 25%;
    margin-left: 0;
  }
</style>
<!--[if lte IE 7]>
<style type="text/css">
  .endnote hr {
    display: block;
    float: left;
    margin-bottom: -1em;
  }
</style>
<![endif]-->
0
 

Author Closing Comment

by:john8217
Comment Utility
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now