CSS force new line

Sebastian Starke picture Sebastian Starke · Jul 18, 2013 · Viewed 151.8k times · Source

I have something like this:

<li>Post by <a>Author</a></li>

And I want to display the link in a new line, like this

Post by
Author

How can I achieve this? Clear:left doesn't work.

Answer

Shiva Avula picture Shiva Avula · Jul 18, 2013

Use the display property

a{
    display: block;
}

This will make the link to display in new line

If you want to remove list styling, use

li{
    list-style: none;
}