- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 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.
How would I create a button using
https://css-tricks.com/examples/ButtonMaker
where there are multiple lines of text?
e.g.
Free Delivery
on orders over $70
I’ve tried this code by inserting a <br/> but the button wraps.
Hm, weird, it’s working for me?
http://codepen.io/senff/pen/lhAeg
Thanks Senff!!
My bad, I was using the following HTML
<a href="" class="button">Free Delivery<br>on orders over $70</a>
I got directed to that page direct from Google.. and didn’t see any sample HTML on how to use it.
Other sites used <a>
. Maybe a suggestion for someone to update that page to make it explicit?
Using should work too, but since that’s an inline element by default, you’ll have add some stuff: http://codepen.io/senff/pen/mafFe
Ah I see, thanks.
Setting <a>
to have float: left; works well. Are there benefits in doing that over width: 160px; ? I guess, for one, you don’t have to work out the best width.. it just fits. Would floating <a>
left also be the best for responsive designs?
Thanks Senff.
Would floating left also be the best for responsive designs?
Sometimes yes, sometimes no. Perhaps you want all your links/buttons to be the same width, perhaps you don’t.
It depends on the the design you are going for.
Multiple floated list items / link buttons etc are a real hassle to centre on the pages sometimes but if that’s not an issue then it’s fine.