简体   繁体   English

如何在html中的href中添加垂直文本对齐?

[英]How to add vertical text align in href in html?

Hai我有一个列表(动态我创建了html),在该列表中我添加了许多超链接。现在我想在中心添加该链接如何做到这一点?请帮助我

"<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>");

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. 我使用line-height来进行垂直对齐和text-align: center以使文本居中。

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> 

Hi you can give vertical text in href in HTML through easy css like this:- 嗨,您可以通过简单的CSS这样在HTML中的href中给出垂直文本: -

  <a href="#" style="width:200px; height:100px; background:red; display:table-cell; vertical-align:middle; text-align:center; color:black;">shailender</a>

i hope this can be helpful for you..... 我希望这对你有所帮助.....

or see the demo:- http://jsbin.com/uwemuy/edit#html,live 或者看看演示: - http://jsbin.com/uwemuy/edit#html,live

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM