Search code examples
htmlcsshref

How to display an href vertically in the middle with the same underlining as the picture?


enter image description here

I want to display the href similar to this picture (home, About, Portofolio...) vertically, in the middle and same alignment.

HTML Code:

<body bgcolor="#E6E6FA" leftmargin=150px topmargin=20px link="blue" vlink="purple" hlink="darkpink"> 
 <a href="SiteMap.html" > Home </a> &nbsp; 
 <a href="About.html" > About </a> &nbsp; 
 <a href="Portfolio.html" >Portfolio</a> &nbsp; 
 <a href="Services.html" >Services </a> &nbsp; 
 <a href="info.html" >Contact </a> <br> <br> <br>

Solution

  • You can try this:

    I am not sure what you want in href static or hover:

    If href default:

    li a {
    border-bottom: 2px dashed #000;
    }
    

    if href hover:

    li a:hover {
    border-bottom: 2px dashed #000;
    }
    

    you can use border is dotted or dashed looking for your site.