我的目標:除了.firstCharacter之後的所有段落都縮進。插入div後的CSS縮進段落?
我在頁面的某些部分的第一段有一個下拉帽。我已經第一個使用縮進後設置所有的段落標記...
.storyContainer p + p {
text-indent: 1.5em;
margin-top: 0
}
我使用我的設置下沉......
.firstcharacter {
float: left;
font-size: 80px;
line-height: 60px;
padding-top: 4px;
padding-right: 8px;
padding-left: 3px;
font-family: 'Droid Serif', serif;
}
我的HTML是這樣的...
<div class="headline">This is a headline!</div>
<p><span class="firstcharacter">T</span>his text NOT indented because it's first</p>
<p>This text will be indented because it's second.</p>
<p>This text will be indented because it's third.</p>
<div class="someBox">This is some extra box</div>
<p>I want this to be indented but it won't be because it is first after the box!</p>
<p>This text will be indented because it's second.</p>
<div class="headline">This is a headline!</div>
<p><span class="firstcharacter">T</span>his text NOT indented because it's first</p>
<p>This text will be indented because it's second.</p>
<p>This text will be indented because it's third.</p>
<div class="someBox">This is some extra box</div>
<p>I want this to be indented but it won't be because it is first after the box!</p>
<p>This text will be indented because it's second.</p>
任何幫助如何擺脫這個擺脫?
謝謝!
堅持下去,認爲你的「目標」是不合時宜的。這聽起來像你真正的意思是'除了第一個兄弟以外的所有段落.firstCharacter' – crush 2013-02-15 19:54:18
老實說,我認爲最可靠的方法是將一個類添加到你想要縮進的'p'中。 – steveax 2013-02-15 20:02:32