单选按钮旁边的文本垂直对齐 [英] Vertically aligning text next to a radio button

查看:90
本文介绍了单选按钮旁边的文本垂直对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个基本的CSS问题,我后面有一个带有小文本标签的单选按钮。我希望文本在垂直方向上居中显示,但在我的情况下,文本始终与单选按钮的按钮对齐。

This is a basic CSS question, I have a radio button with a small text label after it. I want the text to appear centered vertically but the text is always aligned with the button of the radio button in my case.

<p><input type="radio" id="opt1" name="opt1" value="1" />A label</p>

这里是一个Jsfiddle:

Here is a Jsfiddle:

< a href = http://jsfiddle.net/UnA6j/ rel = noreferrer> http://jsfiddle.net/UnA6j/

有建议吗?

谢谢

艾伦。

推荐答案

标签内使用它。使用垂直对齐将其设置为各种值-底部基线中间

Use it inside a label. Use vertical-align to set it to various values -- bottom, baseline, middle etc.

http://jsfiddle.net/UnA6j/5/

这篇关于单选按钮旁边的文本垂直对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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