我尝试从左右两侧浮动代码并同时从左侧和右侧对齐它,但它不会像文本一样停留在同一条线上,或者悬停图像位于另一条线之上。我对自己做错了什么感到困惑,你们可以帮助我吗?
JsFiddle:http://jsfiddle.net/W3Pxv/344/
<span class="right"><a href="http://discord.me/animalcrossingchat"><img src="http://i.imgur.com/1HcjGUB.png?1" onmouseover="this.src='http://i.imgur.com/Y3qUfNt.png?1'" onmouseout="this.src='http://i.imgur.com/1HcjGUB.png?1'" /></a></span><span class="left">Animal Crossing Community gives you an unlimited amount of possibilities. Do you want to share some unforgettable moments of your own animal crossing experience or just talk about anything noteworthy that comes to your mind on our plaza? Why don't you grab a cup of coffee and talk about more serious matters in the roost? Become a premium member and enjoy a variety of new features and much more.
Be part of our community by earning bells, answering the question of the day or winning valuable prices on our server's contests. You are what you make yourself to be on Animal Crossing Community. Join today and become the newest member.</span>
的CSS:
.right {
float:right;
}
.left {
float:left;
}
答案 0 :(得分:2)
给.left
显示内联块和固定宽度。
像这样:
.left{
width: 420px; // size is interchangable
display: inline-block;
float:left;
}