Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Why can't I left-justify my links?

0 views
Skip to first unread message

Mike Silva

unread,
Apr 4, 2009, 9:44:56 PM4/4/09
to
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

rf

unread,
Apr 4, 2009, 10:08:52 PM4/4/09
to
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.


richard

unread,
Apr 4, 2009, 10:57:27 PM4/4/09
to

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

Adrienne Boswell

unread,
Apr 4, 2009, 11:10:10 PM4/4/09
to
Gazing into my crystal ball I observed richard <mem...@newsguy.com>
writing in news:9d7gt4pfel1su02co...@4ax.com:

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

rf

unread,
Apr 4, 2009, 11:25:14 PM4/4/09
to
Adrienne Boswell wrote:
> Gazing into my crystal ball I observed richard <mem...@newsguy.com>
> writing in news:9d7gt4pfel1su02co...@4ax.com:
>
>> On Sat, 4 Apr 2009 18:44:56 -0700 (PDT), Mike Silva
>> <snarf...@yahoo.com> 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 :-)


dorayme

unread,
Apr 4, 2009, 11:27:52 PM4/4/09
to
In article
<7362125f-224e-439b...@e18g2000yqo.googlegroups.com>,
Mike Silva <snarf...@yahoo.com> wrote:

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

might help in respect to text-align.

--
dorayme

dorayme

unread,
Apr 4, 2009, 11:43:29 PM4/4/09
to
In article <doraymeRidThis-BA9...@news.albasani.net>,
dorayme <dorayme...@optusnet.com.au> wrote:

Or perhaps, more specifically, this might be instructive:

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

--
dorayme

Mike Silva

unread,
Apr 5, 2009, 10:19:12 AM4/5/09
to
On Apr 4, 11:10 pm, Adrienne Boswell <arb...@yahoo.com> wrote:
> Gazing into my crystal ball I observed richard <mem...@newsguy.com>
> writing innews:9d7gt4pfel1su02co...@4ax.com:

>
>
>
>
>
> > On Sat, 4 Apr 2009 18:44:56 -0700 (PDT), Mike Silva
> ><snarflem...@yahoo.com> 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

Harlan Messinger

unread,
Apr 5, 2009, 11:44:52 AM4/5/09
to
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; }

0 new messages