Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add vertical text align in href in html?

Hai i have a list(dynamically i created the html),in that list i added many hyperlinks .Now i want to add that link in center how to do this?kindly help me

"<FONT SIZE=5;face=Droid Sans>"+"<p style=text-align:center>"+"<a  id='"+i+"'  href='#' >" +value +  "</a>"+"</p>"+"<hr style='border:1px solid #EBEBEB'/>"+"</FONT>"+ "</li>");
like image 926
user1324068 Avatar asked Nov 15 '25 03:11

user1324068


1 Answers

Try to use embed of external style not inline style. I used line-height to make vertical align and text-align: center to center the text.

An example of adding vertical align to anchor:

.anch{
    font-size:12px;
    color:green;
    display:inline-block;
    height:100px;
    width:300px;
    border:1px solid black;
    text-align:center;
    vertical-align:top;
    line-height:100px;
}
<a href="#" class="anch">Anchor</a>
like image 88
palAlaa Avatar answered Nov 17 '25 20:11

palAlaa



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!