[英]How to vertical align my images and texts
I am trying to do a vertical align for my texts and images. 我正在尝试对我的文本和图像进行垂直对齐。
It seems the texts are aligned to top in my jsfiddle 看来文字在我的jsfiddle中居高不下
text here --
| |
--
I want to have my text to be like 我想让我的文字像
--
text here | |
--
http://jsfiddle.net/wjPxS/ http://jsfiddle.net/wjPxS/
I can't really change my image float right in css. 我真的不能真正更改我的图像浮动在CSS中。 Can anyone help me about it? 有人可以帮我吗? Thanks so much! 非常感谢!
You need to apply 你需要申请
display: inline-block;
vertical-align: middle;
to both img
and span
. 到img
和span
。 In jsfiddle I replaced span
with `div'. 在jsfiddle中,我将span
替换为`div'。
Though, this doesn't let you float the img
to the right. 但是,这不能让img
向右浮动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.