Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make links one link per line, only in the footer via css?

Tags:

css

I do not want these links display next to each other on the web page (only in the <footer> element, I want one link per line and I don't want to use <br>:

<footer>
    <p>Copyright © 2013 </p>
    <a href="http://www.link.com/">link.com</a>
    <a href="http://www.link.com/">link.com</a>
    <a href="http://www.link.com/">link.com</a>
    <a href="http://www.link.com/">link.com</a>
    <a href="http://www.link.com/">link.com</a>
</footer>
like image 611
whySoSerious Avatar asked Dec 22 '25 10:12

whySoSerious


2 Answers

Set the a elements display property to block, which will cause each element to be displayed on their own line.

footer a{
   display: block;
}
like image 53
Kevin Bowersox Avatar answered Dec 24 '25 03:12

Kevin Bowersox


You can make them block elements:

footer > a { display: block; }
like image 29
Guffa Avatar answered Dec 24 '25 02:12

Guffa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!