4 ms·
a {padding: 1rem} This increases area by padding the link. Just don’t want the rap areas of different elements to overlap with too much padding. You can also
by deftturtle 7y ago
a {padding: 1rem}
This increases area by padding the link. Just don’t want the rap areas of different elements to overlap with too much padding.
You can also put a border around the new area, or a box shadow, to indicate larger click area, making it a button sort of:
{border: thin solid grey}
- eurasiantiger 7y agoNote that the <a> element is inline by default, which means top and bottom padding is not applied. Set display: inline-block; to have padding apply all around while retaining the element’s flow in the layout.
- deftturtle 7y agoThank you! I’m still learning CSS and will have to adjust my style sheets! :)