html5 - CSS text align not working -


i've got sicky footer

display:table-row; 

the text centered.

i have copyrights aligned left , social media aligned right. did this:

<div id="footer"> <div id="container"> <span id="copyright">copyright 2015</span> <span id="socials">facebook</span> </div> </div> 

the css

#footer { display: table-row; height: 10px; }  #copyright { text-align: left;} #socials { text-align: right;} 

it doesn't seem aligned. please help. thanks

you can use float achieve this.

#copyright { float: left; } #socials { float: right; } 

reason is, span default display: inline. means won't fill whole div you'll end seeing both next each other.

your other "issue" div has display:table-row - reason this? if have parent div footer, using display:table, should work is. if not, need remove display:table-row

http://jsfiddle.net/lqf91p8q/


Comments