我试图将整个 DIV 向右浮动,其中包含元素 P 和 A 的元素保持在同一行上(现在 A 元素移动到 P 下方)。如何让他们在同一条线上? fiddle Fiddle
我的 HTML:
<div class="go-here"><p>Go here: </p><a href="www.placehold.it" target=
"_blank">Placehold</a></div>
和CSS
.go-here a:link {
font-size:18px;
color:#ED152F
}
.go-here p {
font-size:12px;
color:#000000
}
.go-here {
float: right
}
最佳答案
很简单<a>
里面<p>
:
.go-here a:link {
font-size:18px;
color:#ED152F
}
.go-here p {
font-size:12px;
color:#000000
}
.go-here {
float: right
}
Simple as putting <a> inside <p>:
<div class="go-here"><p>Go here: <a href="www.placehold.it" target=
"_blank">Placehold</a></p></div>
关于css - 有一个完整的 <div> float 权利,其中包含一个 <p> 元素和一个 <a> 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30108488/