Jump to content

Centered Buttons


Trick_Master990

Recommended Posts

http://jsfiddle.net/f5w1dbbz/1/

 

If float is used it will override text-align: center; the old method was to use position: relative; using my example on nav and ul element with ul using float: left; nav would then use left: 50% which would force it and ul left edge right to be in dead centre. Then because ul is floated its width is determined by content, so you then force ul 50% of it length back left using left; -50%;, but with display: inline-block; it became more easy.

Edited by dsonesuk
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...