2017-05-29 54 views
1

禁用文字環繞這是目前問題: enter image description hereWordPress的下圖像

我想讓它這樣的文字從來沒有像下進入。但這是wordpress,我想要一個適用於每個帖子的解決方案。所以一個CSS解決方案最好還是PHP解決方案?我不會選擇WordPress的div和段落。

下面是代碼:

<p> 
    <a href="http://amazon.com"> 
    <img class="alignleft wp-image-281" src="http://dock.com//Be_here_now_ram_dass.jpg" alt="Be Here Now Ram Dass" width="137" height="138" /> 
    </a> 
    This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. 
</p> 

相關CSS:

.entry-content p { 
    font-size: 16px!important; 
    overflow: hidden; 
} 
a img.alignleft { 
    float: left; 
} 

我該如何解決這個問題?如果是PHP解決方案,請詳細說明放置位置等。謝謝!

+0

的解決方案確實是一個CSS之一。因此,請發佈您的相關CSS - 如果沒有它,我們不能回答這個問題。 –

+0

@ObsidianAge補充,但實際上並不多。 –

回答

0

可以將段落文本包裝在塊元素中,並將其設置爲overflow: auto,以便內聯內容不會流出並環繞浮動元素。

.alignleft { 
 
    float: left; 
 
} 
 

 
.content { 
 
    font-size: 3rem; 
 
    overflow: auto; 
 
    display: block; 
 
}
<p> 
 
    <a href="http://amazon.com"> 
 
    <img class="alignleft wp-image-281" src="http://dock.com//Be_here_now_ram_dass.jpg" alt="Be Here Now Ram Dass" width="137" height="138" /> 
 
    </a> 
 
    <span class="content"> 
 
    This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. 
 
    </span> 
 
</p>

+0

但是因爲這是wordpress,我不得不每次添加標籤與我想要以這種方式工作的每個元素。我希望wordpress能夠自動地在文本中包裝文本。 –