Thread: CSS button issue
CSS button issue
15 Mar 2012 @ 01.23
I have created a background image for use on each button in a navigation for a site.
However, when added via CSS to the individual list items, the background button image shrinks relative to the width of the text used.
This looks odd because you end up with a number of buttons, all with different widths.
I have tried specifying a width equal to that of the existing image I am using, this doesn't seem to work.
Anyone know how I can specify the same width for all button backgrounds regardless of the width of the text?
I would also like to center the text on the button background.
15 Mar 2012 @ 07.55
Something like this, perhaps?
Edit this Fiddle - jsFiddle
15 Mar 2012 @ 09.13
Sorry Mike, had to fork it: Edit this Fiddle - jsFiddle
Originally Posted by Mike Hopley
I like the whole button clickable
15 Mar 2012 @ 10.47
Much better, and so do I!
Originally Posted by Frinkky
16 Mar 2012 @ 22.02
Thanks guys. Will have a play around.
What element would you say makes the buttons the same width?
17 Mar 2012 @ 08.34
It's the width declaration on the li tag.
Tags for this Thread