Why can't I left-justify my links?

Discussion in 'HTML' started by Mike Silva, Apr 5, 2009.

  1. Mike Silva

    Mike Silva Guest

    Newbie confusion here. I have a CSS style (#rightcolumn) with text-
    align: center. Then I have a CSS link style as follows:

    #rightcolumn a {
    color: #333;
    font-size: small;
    text-align: left;
    text-decoration: none;
    }

    But the links remain centered in the column (or rather, they obey the
    text-align in #rightcolumn whatever it is set to). All the other
    styles work (color, font-size, etc) but text-align: left has no
    effect. Any ideas on what I'm doing wrong? Thanks.

    Mike
    Mike Silva, Apr 5, 2009
    #1
    1. Advertising

  2. Mike Silva

    rf Guest

    Mike Silva wrote:
    > Newbie confusion here. I have a CSS style (#rightcolumn) with text-
    > align: center. Then I have a CSS link style as follows:
    >
    > #rightcolumn a {
    > color: #333;
    > font-size: small;
    > text-align: left;
    > text-decoration: none;
    > }


    Text-align is for block elements and <a> isn't one.
    rf, Apr 5, 2009
    #2
    1. Advertising

  3. Mike Silva

    richard Guest

    On Sat, 4 Apr 2009 18:44:56 -0700 (PDT), Mike Silva
    <> wrote:

    >Newbie confusion here. I have a CSS style (#rightcolumn) with text-
    >align: center. Then I have a CSS link style as follows:
    >
    >#rightcolumn a {
    > color: #333;
    > font-size: small;
    > text-align: left;
    > text-decoration: none;
    >}
    >
    >But the links remain centered in the column (or rather, they obey the
    >text-align in #rightcolumn whatever it is set to). All the other
    >styles work (color, font-size, etc) but text-align: left has no
    >effect. Any ideas on what I'm doing wrong? Thanks.
    >
    >Mike


    Try putting the link inside of a span and justify the span.
    <span style="text-align:left"><a>link</a></span>
    richard, Apr 5, 2009
    #3
  4. Gazing into my crystal ball I observed richard <>
    writing in news::

    > On Sat, 4 Apr 2009 18:44:56 -0700 (PDT), Mike Silva
    ><> wrote:
    >
    >>Newbie confusion here. I have a CSS style (#rightcolumn) with text-
    >>align: center. Then I have a CSS link style as follows:
    >>
    >>#rightcolumn a {
    >> color: #333;
    >> font-size: small;
    >> text-align: left;
    >> text-decoration: none;
    >>}
    >>
    >>But the links remain centered in the column (or rather, they obey the
    >>text-align in #rightcolumn whatever it is set to). All the other
    >>styles work (color, font-size, etc) but text-align: left has no
    >>effect. Any ideas on what I'm doing wrong? Thanks.
    >>
    >>Mike

    >
    > Try putting the link inside of a span and justify the span.
    ><span style="text-align:left"><a>link</a></span>
    >


    No, span is still inline, as is a. What is needed is either a block
    level element, or:
    #rightcolumn a {display:block;....}

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Apr 5, 2009
    #4
  5. Mike Silva

    rf Guest

    Adrienne Boswell wrote:
    > Gazing into my crystal ball I observed richard <>
    > writing in news::
    >
    >> On Sat, 4 Apr 2009 18:44:56 -0700 (PDT), Mike Silva
    >> <> wrote:
    >>
    >>> Newbie confusion here. I have a CSS style (#rightcolumn) with text-
    >>> align: center. Then I have a CSS link style as follows:
    >>>
    >>> #rightcolumn a {
    >>> color: #333;
    >>> font-size: small;
    >>> text-align: left;
    >>> text-decoration: none;
    >>> }
    >>>
    >>> But the links remain centered in the column (or rather, they obey
    >>> the text-align in #rightcolumn whatever it is set to). All the
    >>> other styles work (color, font-size, etc) but text-align: left has
    >>> no effect. Any ideas on what I'm doing wrong? Thanks.
    >>>
    >>> Mike

    >>
    >> Try putting the link inside of a span and justify the span.
    >> <span style="text-align:left"><a>link</a></span>
    >>

    >
    > No, span is still inline, as is a. What is needed is either a block
    > level element, or:
    > #rightcolumn a {display:block;....}


    Hey, but with the "try" approach we would have eventually got to that. After
    trying all HTML elements and then trying all CSS properties until a
    combination was found that worked :)
    rf, Apr 5, 2009
    #5
  6. Mike Silva

    dorayme Guest

    In article
    <>,
    Mike Silva <> wrote:

    > Newbie confusion here. I have a CSS style (#rightcolumn) with text-
    > align: center. Then I have a CSS link style as follows:
    >
    > #rightcolumn a {
    > color: #333;
    > font-size: small;
    > text-align: left;
    > text-decoration: none;
    > }
    >
    > But the links remain centered in the column (or rather, they obey the
    > text-align in #rightcolumn whatever it is set to). All the other
    > styles work (color, font-size, etc) but text-align: left has no
    > effect. Any ideas on what I'm doing wrong? Thanks.
    >


    <http://netweaver.com.au/centring/>

    might help in respect to text-align.

    --
    dorayme
    dorayme, Apr 5, 2009
    #6
  7. Mike Silva

    dorayme Guest

    In article <>,
    dorayme <> wrote:

    > In article
    > <>,
    > Mike Silva <> wrote:
    >
    > > Newbie confusion here. I have a CSS style (#rightcolumn) with text-
    > > align: center. Then I have a CSS link style as follows:
    > >
    > > #rightcolumn a {
    > > color: #333;
    > > font-size: small;
    > > text-align: left;
    > > text-decoration: none;
    > > }
    > >
    > > But the links remain centered in the column (or rather, they obey the
    > > text-align in #rightcolumn whatever it is set to). All the other
    > > styles work (color, font-size, etc) but text-align: left has no
    > > effect. Any ideas on what I'm doing wrong? Thanks.
    > >

    >
    > <http://netweaver.com.au/centring/>
    >
    > might help in respect to text-align.


    Or perhaps, more specifically, this might be instructive:

    <http://dorayme.netweaver.com.au/silva1.html>

    --
    dorayme
    dorayme, Apr 5, 2009
    #7
  8. Mike Silva

    Mike Silva Guest

    On Apr 4, 11:10 pm, Adrienne Boswell <> wrote:
    > Gazing into my crystal ball I observed richard <>
    > writing innews::
    >
    >
    >
    >
    >
    > > On Sat, 4 Apr 2009 18:44:56 -0700 (PDT), Mike Silva
    > ><> wrote:

    >
    > >>Newbie confusion here.  I have a CSS style (#rightcolumn) with text-
    > >>align: center.  Then I have a CSS link style as follows:

    >
    > >>#rightcolumn a {
    > >>  color: #333;
    > >>  font-size: small;
    > >>  text-align: left;
    > >>  text-decoration: none;
    > >>}

    >
    > >>But the links remain centered in the column (or rather, they obey the
    > >>text-align in #rightcolumn whatever it is set to).  All the other
    > >>styles work (color, font-size, etc) but text-align: left has no
    > >>effect.  Any ideas on what I'm doing wrong?  Thanks.

    >
    > >>Mike

    >
    > > Try putting the link inside of a span and justify the span.
    > ><span style="text-align:left"><a>link</a></span>

    >
    > No, span is still inline, as is a.  What is needed is either a block
    > level element, or:
    > #rightcolumn a {display:block;....}
    >

    Thanks, not only did that do the trick, but I even understand why it
    works - doesn't get any better than that!

    Mike
    Mike Silva, Apr 5, 2009
    #8
  9. Mike Silva wrote:
    > Newbie confusion here. I have a CSS style (#rightcolumn) with text-
    > align: center. Then I have a CSS link style as follows:
    >
    > #rightcolumn a {
    > color: #333;
    > font-size: small;
    > text-align: left;
    > text-decoration: none;
    > }
    >
    > But the links remain centered in the column (or rather, they obey the
    > text-align in #rightcolumn whatever it is set to). All the other
    > styles work (color, font-size, etc) but text-align: left has no
    > effect. Any ideas on what I'm doing wrong? Thanks.
    >

    The text-align attribute applies to a block element to indicate the
    alignment of inline content in that block. Try removing the text-align
    attribute above and instead adding

    #rightcolumn { text-align: left; }
    Harlan Messinger, Apr 5, 2009
    #9
    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. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,843
    Smokey Grindel
    Dec 2, 2006
  2. tshad
    Replies:
    5
    Views:
    496
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Jun 24, 2007
  3. =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

    Help on table align on left of page vs left hanging indent

    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=, Jul 10, 2007, in forum: XML
    Replies:
    2
    Views:
    1,001
    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
    Jul 16, 2007
  4. pc
    Replies:
    2
    Views:
    1,312
    crisgoogle
    Jun 8, 2011
  5. lawrence
    Replies:
    13
    Views:
    297
    Thomas 'PointedEars' Lahn
    Sep 4, 2004
Loading...

Share This Page