Home  >  Article  >  Web Front-end  >  如何让文本水平居中对齐_html/css_WEB-ITnose

如何让文本水平居中对齐_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:31:271262browse

如何点击文本框清除所有文本:
建议:尽可能的手写代码,可以有效的提高学习效率和深度。
问题比较简单,只要将文本所在对象的text-align属性值设置为center即可。实例如下: 

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">div{  width:200px;  height:50px;  border:1px solid green;  text-align:center;}</style></head><body><div>蚂蚁部落</div></body></html>

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=4737

更多内容可以参阅:http://www.softwhy.com/divcss/

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn