Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to align the <hr> element to the left?

Reply
Thread Tools

How to align the <hr> element to the left?

 
 
K Viltersten
Guest
Posts: n/a
 
      04-09-2009
I've used the following.

<hr style="width: 50%; text-align: left" />

While the width works just fine, the
alignment does not. How can i force the
horizontal separator to be left-aligned?

Why doesn't the above work? It only
places the (shortened to half of the
screen's length) element in the middle.

--
Regards
K Viltersten
 
Reply With Quote
 
 
 
 
Stefan Hoffmann
Guest
Posts: n/a
 
      04-09-2009
hi K,

K Viltersten wrote:
> While the width works just fine, the alignment does not. How can i force
> the horizontal separator to be left-aligned?

Basically, it's deprecated, otherwise:

http://blakems.com/experimental/hr/



mfG
--> stefan <--
 
Reply With Quote
 
 
 
 
K Viltersten
Guest
Posts: n/a
 
      04-09-2009
>> While the width works just fine, the
>> alignment does not. How can i force
>> the horizontal separator to be
>> left-aligned?

>
> Basically, it's deprecated, otherwise:
> http://blakems.com/experimental/hr/


Huh?! I didn't know that. Are you saying
that <hr> is deprecated? Surely, you
don't mean that left-alignment is...?

And thanks for the answer, by the way!

--
Regards
K Viltersten

 
Reply With Quote
 
Stefan Hoffmann
Guest
Posts: n/a
 
      04-09-2009
hi,

K Viltersten wrote:
> Huh?! I didn't know that. Are you saying that <hr> is deprecated?

Yes:

http://www.w3.org/TR/REC-html40/pres...cs.html#h-15.3


mfG
--> stefan <--
 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      04-09-2009
re:
!> Are you saying that <hr> is deprecated?
!> Yes:

While that is undoubtedly true, deprecated features remain in the current version,
although their use may raise warning messages recommending alternate practices
and deprecation may indicate that the feature will be removed in the future.

I.o.w., a deprecated feature still works although programmers should strive to
eventually use alternate programming to be ready for when the feature is removed.

In this case, HR is not deprecated.

What is deprecated is the method by which alignment is obtained,
among other attributes which have been deprecated for the HR tag.

Now, the preferred method to modify a horizontal rule's attribues is with style sheets/CSS.

http://blakems.com/experimental/hr/

offers excellent examples of usage of styles for the horizontal rule.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
=========================
"Stefan Hoffmann" <> wrote in message news:%...
> hi,
>
> K Viltersten wrote:
>> Huh?! I didn't know that. Are you saying that <hr> is deprecated?

> Yes:
>
> http://www.w3.org/TR/REC-html40/pres...cs.html#h-15.3
>
>
> mfG
> --> stefan <--




 
Reply With Quote
 
K Viltersten
Guest
Posts: n/a
 
      04-09-2009
>> Huh?! I didn't know that. Are you
>> saying that <hr> is deprecated?

>
> Yes:
> http://www.w3.org/TR/REC-html40/pres...cs.html#h-15.3


I only see that the attributes are
deprecated. Nothing about the element
itself being deprecated. What do i miss?

Also, if it's deprecated, what should
one use now?

Thanks!

--
Regards
K Viltersten

 
Reply With Quote
 
K Viltersten
Guest
Posts: n/a
 
      04-10-2009
> In this case, HR is not deprecated.
>
> What is deprecated is the method by which
> alignment is obtained, among other
> attributes which have been deprecated for
> the HR tag.
>
> Now, the preferred method to modify a
> horizontal rule's attribues is with style
> sheets/CSS.


Hmm... I used the following but didn't get
any difference in the horizontal alignment.
The width changes, though. Any thoughts?

<hr style="width: 50%; text-align: left" />

--
Regards
K Viltersten

 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      04-11-2009
hr is a block element, and text-align has no effect on block elements in
css compliant browsers .you should set the

<hr style="margin-left:0px" />

the problem is older versions of ie are not css compliant, but use
text-align, so you need to set both:

<hr style="margin-left:0px;text-align:left" />

-- bruce (sqlwork.com)


K Viltersten wrote:
> I've used the following.
>
> <hr style="width: 50%; text-align: left" />
>
> While the width works just fine, the alignment does not. How can i force
> the
> horizontal separator to be left-aligned?
>
> Why doesn't the above work? It only places the (shortened to half of the
> screen's length) element in the middle.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
<div align=center> also affects align of dynamic dropdown item text Steve Richter ASP .Net 1 06-24-2007 07:11 PM
left align within centre align Paul Lautman HTML 3 03-03-2006 02:45 PM
text-align vs align tshad HTML 1 06-23-2005 10:29 PM
how to Align text left & vertical align middle Kay ASP .Net 2 07-25-2003 08:32 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57