?
Solved

Can't position my <HR> tag

Posted on 2011-03-02
6
Medium Priority
?
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 19

Accepted Solution

by:
daveamour earned 500 total points
ID: 35018071
try this:

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

Expert Comment

by:daveamour
ID: 35018082
Ps - this for the width:

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

Assisted Solution

by:Bardobrave
Bardobrave earned 500 total points
ID: 35018184
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

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

Expert Comment

by:userboy87
ID: 35019075
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
ID: 35020342
Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

752 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