我试图让我的文字与图像保持在同一水平面上
我有类似的东西
<div>
<img src='test.png'/>
<a href='#'>This is the test here</a>
</div>
显示
-----
| | This is the test
| |
-----
here
-----
| | This is the test
| | here
-----
我该如何解决这个问题?谢谢!
最佳答案
div {
clear:both;
float:left;
}
div img{
float:left;
}
div a{
float:left;
}
关于html - 在我的案例中如何水平对齐文本和图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22997274/