- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Have made some css buttons would like to know if done correct.
Not bad, but I think there’s one big way that you could improve them: do a lot more of the styling on the _a_ tag. At the moment, you are only able to click on the text, because most of the button belongs to the li tag, which doesn’t react to clicking.
I’ve put together what I generally do for buttons [here](http://codepen.io/David_Leitch/pen/lmAws “Button examples”) to give you some suggestions. I’ve used a bit of Sass to put mine together, which you don’t need to use, but I just find it makes them a lot quicker.
Nothing wrong with them but they are actually list items rather than a `
However, as usual, you still have a lot of repeated CSS in there.
Firstly, if all of your link list items are going to be the same EXCEPT for the background color then you can combine those properties into a class and leave the individual coloring to a separate class.
Like this: http://codepen.io/anon/pen/Byxgh
Thanks every one I see that I could only click the text rather than the whole area will now change it makes sense doing it that way rather than just text click able
Just adding `display:block` to the `a` will get you most of the way.