Solved

Can't position my <HR> tag

Posted on 2011-03-02
6
346 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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

810 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