Napredna Pretraga​ and CSS: button { dis...">

CSS text alignment not working

I have a code like this:

<button class="prikazi_pretragu">Napredna Pretraga</button>​ 

and CSS:

 button { display:inline; font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; float: right; clear: both; padding: 0 50px 5px 5px; text-align: left; margin: 0 0 10px 0; border: none; background: url('../img/resursi/advsearch_plus.png') no-repeat 0 -28px rgba(0,0,0,.09); font-size: 14px; height: 28px; text-align: right }​ 

text-align does not work. What is the problem?

http://jsfiddle.net/KjGBW/1/

+4
source share
1 answer

He works. It aligns to the right (completely pointless, since you obviously did not specify the width). It's just that you have 50px padding on the right and why it seems to be aligned on the left.

 padding: 0 50px 5px 5px; 

The values ​​for the upper right lower left corner in this order.

Set padding: 0 5px 5px 5px; value padding: 0 5px 5px 5px;

Also, if you set the let say width to 300px, you will see that it is clearly aligned to the right.

See http://jsfiddle.net/thebabydino/KjGBW/5/ - I changed the registration and added the width. Now you can clearly see that it is aligned to the right.

+13
source

Source: https://habr.com/ru/post/1414131/


All Articles