我試圖限制每個標題和段落只能分開一列而不是自動格式化,以便在空間不足時轉到下一列。如何將特定內容限制爲只有一列而不是跨多列?
.columns {
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3;
}
.div1 {
width: 100%;
padding: 10px;
border-right: 2px solid;
border-left: 2px solid;
margin: 0;
background-color: white;
}
<div class="div1">
<div class="columns">
<h4>Landscaping</h4>
<p>As Northeast Ohio Landscapers, Hemlock Landscapes has been caring for customers and their properties throughout the Chagrin Valley since 1981.
Our core values:
Bring a positive attitude with you each and every day
Work hard, pitch in, be helpful and productive
Be fair and respectful with all people in all encounters</p>
<h4>Services</h4>
<p>When it comes to Residential Landscape Maintenance in Northeast Ohio, we have a pretty simple mission.
Our mission is to unite people in positive relationships to improve lives.
This includes not only our great customers but also our fantastic employees and vendors that we work with each and every day. If we are not improving your life then we are not living up to our mission.
Experienced in every facet of the landscape industry, we fulfill our one company… total care philosophy by meeting your every need in the following areas:
Residential Landscape Maintenance
Landscape Design/Installation
Plant Health Care</p>
<h4>Mission</h4>
<p>Whether you are new to the Chagrin Valley, switching landscape service providers, or need to add a service to your existing account, Hemlock Landscapes makes it easy for you.</p>
</div>
</div>
謝謝你的工作完美。 – ChaCol
因此,當我在Google Chrome上使用我的網站時,此格式不再適用。我怎樣才能解決這個問題? – ChaCol
你是什麼意思,它不再適用?是否有任何財產未被瀏覽器識別?如果是這樣,哪些?還是說CSS不再起作用?這些屬性的測試是在Chrome上完成的,所以你的問題讓我困惑了一下。你使用了'break-inside:avoid',如果是這樣,切換到'display:inline-block;'解決了你的問題? –