|
| |
|
|
milo3169
Posts: 40 Joined: 4/26/2005 From: Dallas, TX Status: offline
|
text align in a link - 8/22/2005 12:31:57
Can I put a text-align in a <a href> Tag? If so, I do I do that?
|
|
|
|
Tailslide
Posts: 6046 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: text align in a link - 8/22/2005 13:58:39
It won't work as the link is an "inline element" and text:align only works on "block level elements". This however does: Either <p style="text-align:center;"><a href="index.html" >Click here</a></p> or better still: in your document head or external stylesheet: <STYLE TYPE="text/css">
<!--
.centeralign {text-align:center}
-->
</STYLE> Then in the HTML <p class="centeralign"><a href="index.html" >Click here</a></p> You're thinking what's the difference. Difference is with the style declared separately you can change it and it will change all over the page (or site if the style's external) whereas doing it inline (in the p tag) you have to change every one.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
milo3169
Posts: 40 Joined: 4/26/2005 From: Dallas, TX Status: offline
|
RE: text align in a link - 8/22/2005 14:18:01
That is what my problem is. I wanted to be able to align the link to the right inline with the text. But you are not able to do that?
|
|
|
|
Tailslide
Posts: 6046 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: text align in a link - 8/22/2005 14:26:52
Ah! Lightbulb moment! You can't use text:align BUT you can float a link like this: <a style="float:right;" href="#">Click here</a> You just need to be a bit careful about positioning the float - you might need to move it around a bit to get it exactly right. Edit: again as with the last example it'd be better to do it like this: <STYLE TYPE="text/css">
<!--
.rightalign {float:right}
-->
</STYLE> then <a class="rightalign" href="yourlink.html">Click here</a>
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
milo3169
Posts: 40 Joined: 4/26/2005 From: Dallas, TX Status: offline
|
RE: text align in a link - 8/22/2005 14:41:43
Thanks Tailslide, I will give that a try and see what happens
|
|
|
|
d a v e
Posts: 4087 Joined: 7/24/2002 From: England (but live in Finland now) Status: offline
|
RE: text align in a link - 8/22/2005 15:51:34
i think you might need to float it in a div... <div class="rightalign"> <a class="rightalign" href="yourlink.html">Click here</a> </div>
_____________________________
David Prescott Gekko web design
|
|
|
|
milo3169
Posts: 40 Joined: 4/26/2005 From: Dallas, TX Status: offline
|
RE: text align in a link - 8/22/2005 16:03:19
I have tried all of your suggestions, it does align right, but not in line with the text. It will put it on the next line. I'm not that this can be done.
|
|
|
|
Tailslide
Posts: 6046 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: text align in a link - 8/22/2005 16:10:08
Strictly speaking they don't need to be inside anything - floats will work on any un-positioned element be they inline or block. It is always a good idea to have them inside a div or a table or something otherwise they try to float off the screen!
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|