Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Why can't I left-justify my links?

Reply
Thread Tools

Why can't I left-justify my links?

 
 
Mike Silva
Guest
Posts: n/a
 
      04-05-2009
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

 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      04-05-2009
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.


 
Reply With Quote
 
 
 
 
richard
Guest
Posts: n/a
 
      04-05-2009
On Sat, 4 Apr 2009 18:44:56 -0700 (PDT), Mike Silva
<(E-Mail Removed)> 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>
 
Reply With Quote
 
Adrienne Boswell
Guest
Posts: n/a
 
      04-05-2009
Gazing into my crystal ball I observed richard <(E-Mail Removed)>
writing in news:(E-Mail Removed):

> On Sat, 4 Apr 2009 18:44:56 -0700 (PDT), Mike Silva
><(E-Mail Removed)> 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

 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      04-05-2009
Adrienne Boswell wrote:
> Gazing into my crystal ball I observed richard <(E-Mail Removed)>
> writing in news:(E-Mail Removed):
>
>> On Sat, 4 Apr 2009 18:44:56 -0700 (PDT), Mike Silva
>> <(E-Mail Removed)> 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


 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      04-05-2009
In article
<(E-Mail Removed)>,
Mike Silva <(E-Mail Removed)> 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
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      04-05-2009
In article <(E-Mail Removed)>,
dorayme <(E-Mail Removed)> wrote:

> In article
> <(E-Mail Removed)>,
> Mike Silva <(E-Mail Removed)> 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
 
Reply With Quote
 
Mike Silva
Guest
Posts: n/a
 
      04-05-2009
On Apr 4, 11:10*pm, Adrienne Boswell <(E-Mail Removed)> wrote:
> Gazing into my crystal ball I observed richard <(E-Mail Removed)>
> writing innews:(E-Mail Removed):
>
>
>
>
>
> > On Sat, 4 Apr 2009 18:44:56 -0700 (PDT), Mike Silva
> ><(E-Mail Removed)> 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
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      04-05-2009
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; }
 
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
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Cisco 2611 and Cisco 1721 : Why , why , why ????? sam@nospam.org Cisco 10 05-01-2005 08:49 AM
Why, why, why??? =?Utf-8?B?VGltOjouLg==?= ASP .Net 6 01-27-2005 03:35 PM
Why Why Why You HAVE NO IDEA MCSE 31 04-24-2004 06:40 PM



Advertisments