/    Sign up×
Community /Pin to ProfileBookmark

align link with css

hi,

i was trying to align links with css code text-align: center, however, this code doesn’t work.

please tell me how can i fix that.

i really need to know. so i can do something

i did it this way

a {text-align: center}

in style and then
wrote the link
<a href=”..”> …</a>
but the link stays on left, and doesn’t move at all.

tell me how can i align links to right and center using css
i really need it.

thanks.

nasrin

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@nasrinauthorJun 20.2005 — also bro or sis,

the div first-child code doesn't work in my computer, why not? tell me please.

thanks...
Copy linkTweet thisAlerts:
@acorbelliJun 20.2005 — Would it be possible to get a link to the page you're using this on? Or just the code for the page? It might help a bit...
Copy linkTweet thisAlerts:
@ShrineDesignsJun 20.2005 — text-align doesn't really work on inline elements, you will have to set the width for the link in order for the text-align to work

:first-child doesn't work in IE (IE only supports simple CSS selectors) to get it to work in IE you would have to do this:[code=html]<p:first-child>some text</p:first-child><p>some text</p>[/code]
Copy linkTweet thisAlerts:
@nasrinauthorJun 21.2005 — thanks a lot for the replies.

but brothers,

tell me then how can i align links with CSS to right and center. i need that really badly.

and i understood the problem with first-child code. thanks.
Copy linkTweet thisAlerts:
@nasrinauthorJun 21.2005 — Would it be possible to get a link to the page you're using this on? Or just the code for the page? It might help a bit...[/QUOTE]

it is actually code for the page, not for a perticular website.

i just want to align the links to the center of the page or right of the page, but i couldn't do it. now i know that text-center doesn't work for inline element.

so, what can i use to align the links to the center or right of the page.
Copy linkTweet thisAlerts:
@nasrinauthorJun 21.2005 — does one element property affect other elements that is below the first one.

as i saw, in my above p {...} property affect the below ones,

how can i prevent it and do i therefore, need to assign everything different way.


oh! the margin,

why doesn't the bottom margin work when it is set alone like no paragram or anything below it. it works when something else is below it otherwise doesn't.

take care.
×

Success!

Help @nasrin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...