Используя выравнивание текста в теге привязки? [дубликат] ⇐ CSS

Разбираемся в CSS
Гость
Используя выравнивание текста в теге привязки? [дубликат]

Сообщение Гость »


I am just starting with CSS and was reading about text-align:center; property.

I have a doubt about text-align:center; property. This property center the text inside its parent containing element or inside its box model.

For example:

Код: Выделить всё

p{   text-align:center; } 
This will set content of p center inside its box model or according to its parent containing element div.

I think it will center the content of p inside its box model and since p takes the whole width of div it will appear that content of p centered inside div.

text-align:center; with anchor tag ?

Код: Выделить всё

   [url=#]XYZ[/url]   
Why the below CSS is not centering the anchore inside div.

Код: Выделить всё

a{   text-align:center; } 
but using

Код: Выделить всё

div{   text-align:center; } 
center the anchor inside div?


Источник: https://stackoverflow.com/questions/781 ... anchor-tag

Вернуться в «CSS»