text-align vs align

Discussion in 'HTML' started by tshad, Jun 23, 2005.

  1. tshad

    tshad Guest

    I am curious about using align="right" vs style="text-align:right".

    I have set up styles to left justify my <td> tags (because of a problem with
    having to using loose.dtd).

    I have some <td> tags that I need to right justify and I assume that
    align=right on specific tags would override the style. The problem was it
    didn't. I did find that using style="text-align:right" would override the
    style.

    http://www.payrollworkshop.com/samples/testalignright1.htm
    http://www.payrollworkshop.com/samples/testalignright2.htm

    Why is that?

    I had used style="vertical-align:top" before and was mentioned that it would
    be better to use the valign=top.

    What is the difference here?

    Thanks,

    Tom
     
    tshad, Jun 23, 2005
    #1
    1. Advertising

  2. tshad wrote:

    > I have some <td> tags that I need to right justify and I assume that
    > align=right on specific tags would override the style. The problem was it
    > didn't. I did find that using style="text-align:right" would override the
    > style.


    See http://www.w3.org/TR/CSS21/cascade.html#q13

    "The UA may choose to honor presentational attributes in an HTML source
    document. If so, these attributes are translated to the corresponding CSS
    rules with specificity equal to 0, and are treated as if they were inserted
    at the start of the author style sheet. They may therefore be overridden by
    subsequent style sheet rules."

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Jun 23, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kay
    Replies:
    2
    Views:
    7,214
  2. acko bogicevic

    Align text in text box

    acko bogicevic, Jan 9, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    60,856
    Michelle Stone
    Jan 9, 2004
  3. kai
    Replies:
    3
    Views:
    25,392
  4. Paul Lautman

    left align within centre align

    Paul Lautman, Mar 3, 2006, in forum: HTML
    Replies:
    3
    Views:
    593
    Paul Lautman
    Mar 3, 2006
  5. Steve Richter
    Replies:
    1
    Views:
    934
    Mark Rae
    Jun 24, 2007
Loading...

Share This Page