在我下面的代碼中,如何獲取class =「author」中的文本,以便在class =「label」中的文本正下方對齊? 「:」在‘的回答:。’謝謝CSS:你如何排列4個div,但最後一個跨越2行?
<html>
<head>
<style type="text/css">
.action {
display: inline;
}
.add-box {
margin-left: 40px;
display: inline;
}
.share-button {
margin-left: 30px;
display: inline;
}
.flag {
margin-left: 30px;
display: inline;
}
.author-area {
margin-left: 30px;
display: inline;
}
.label {
margin: 0;
display: inline;
}
.author {
margin: 0;
}
.gray-button {
background: #C0C0C0;
font-size: 14px;
margin:0;
padding: 10px;
border: 1px solid #C0C0C0;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="action">
<div class="add-box">
<a href="#" class="gray-button">Plan</a>
</div>
<div class="share-button">
<a> Share </a>
</div>
<div class="flag">
<a>flag</a>
</div>
<div class="author-area">
<p class="label">Answered by:</p>
<p class="author"><a href="#"></a>Author name </p>
</div>
</div>
</body>
演示:http://jsfiddle.net/NJzRS/ – sje397 2010-09-14 05:35:40