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;
}

Tek Shinobi
Author: Tek Shinobi

Hiya Ninjas, I am the ninja who invented the fire, wheel, science, technology and everything intelligent this humanity has ever experienced since its evolution from monkeys and germs. Actually, above is a partial list. I also was involved with the Big Bang that created this universe. What was it like before the Big Bang is so secret that if I tell you, I will have to turn you into a hobbit and force you to be my gardener. Okay. Sayonanra, Namaste Tek Shinobi




No Comments


You can leave the first : )



Leave a Reply

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