CSS common tricks – Avoid text wrapping at whitespace

  • December 11, 2019
  • CSS

Here is how to avoid wrapping of text in elements like btn, div etc (block, or inline-block elements).

add this to the btn styling:
white-space: nowrap;

You will find this code often. We strip off any padding around ul because it is automatically added by browsers
ul{
padding: 0;
}

If you want the list items to be displayed horizontally, instead of vertically, just put an inline-block
ul li {
display: inline-block;
}




No Comments


You can leave the first : )



Leave a Reply

Your email address will not be published. Required fields are marked *