Solved

Can't position my <HR> tag

Posted on 2011-03-02
6
347 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
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 125 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
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.

 
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

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.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

808 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