当前位置:Gxlcms > html代码 > 实现文本标题和input文本框垂直居中对齐_html/css_WEB-ITnose

实现文本标题和input文本框垂直居中对齐_html/css_WEB-ITnose

时间:2021-07-01 10:21:17 帮助过:13人阅读

实现文本标题和input文本框垂直居中对齐:
本章节分享一段代码实例,它实现文本标题与input文本框上下垂直居中效果。
需要的朋友可以做一下参考,代码实例如下:

  1. <meta charset=" utf-8"> <meta name="author" content="http://www.softwhy.com/"> <title>蚂蚁部落</title> <style type="text/css">#a{ height:30px; border:1px solid #ccc;}#b{ margin-top:20px; height:30px; border:1px solid #ccc;}#a input{ width:200px; height:30px; border:1px solid red;}#b input{ width:200px; height:30px; border:1px solid red; vertical-align:middle;}</style><div id="a"><input>蚂蚁部落一</div><div id="b"><input>蚂蚁部落二</div>

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

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

人气教程排行