如何在文本框正下方和中心显示文本? [英] How to show a text exactly below the text box and also in center?

查看:73
本文介绍了如何在文本框正下方和中心显示文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了此操作,但在文本框下方但不在中央显示文本"eg:0092"

i tried this but that displays text "eg:0092" below the textbox but not in the centre

<input type="text" name="cc" value="Contry Code" onfocus="removeCaption(this);"/>


<div id="eg" style="display:block"> eg:0092     eg:21</div>

推荐答案

甚至不要玩不使用CSS工作表的想法.顺便说一下,您的display样式没有任何作用,因为默认情况下div已经是block.使用属性"text-align: center".

参见:
http://www.w3.org/TR/CSS2/text.html [ ^ ],
http://www.w3.org/TR/CSS2/box.html [ ^ ].

—SA
Don''t even play with the idea to do it not using CSS sheets. By the way, you display style does nothing because div is already block by default. Use the property "text-align: center".

See:
http://www.w3.org/TR/CSS2/text.html[^],
http://www.w3.org/TR/CSS2/box.html[^].

—SA


这篇关于如何在文本框正下方和中心显示文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆