Я пытаюсь создать раздел из четырех столбцов, который увеличивается и уменьшается без оборачивания блоков содержимого. Статьи в разделах, кажется, не отвечают, когда я настраиваю ширину, и я не уверен почему. Я пробовал несколько разных решений (без переноса, минимальной ширины и т. Д.), Но я не могу получить ширину статьи меньше ширины: 5%, что, когда вы смотрите на статью, визуально этоопределенно не 5%. Что тут происходит? В приведенном ниже примере я прокомментировал различные аспекты CSS, которые я пробовал.
<button onclick="openSection()">LEARN MORE</button>
<div id="section1">
<h1>Four Wonderful Things About My Item</h1>
<section>
<article>
<h2>1</h2>
<p class="fade-in">All about item 1.</p>
</article>
<article class="fade-in">
<h2>2</h2>
<p>What a great thing that item 2 is.</p>
</article>
<article class="fade-in">
<h2>3</h2>
<p>But let's not forget about item 3.</p>
</article>
<article class="fade-in">
<h2>4</h2>
<p>Item 4 is something else.</p>
</article>
</section>
</div>
#section1 {
font-family: "Nunito", sans-serif;
font-weight: 100;
/* width: 85%;
margin: 6rem auto; */
}
#section1 section {
background-color: peru;
color: black;
/* display: none; */
/* padding: 0;
margin: 0; */
align-items: stretch;
/* display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex; */
display: flex;
/* -webkit-flex-flow: nowrap; */
/* -webkit-flex-flow: wrap; */
flex-wrap: no-wrap;
justify-content: space-between;
}
#section1 article {
/* background: white; */
/* padding: .5rem; */
/* margin: .5rem; */
/* min-height: 300px; */
/* min-width: 0; */
/* padding: 0; */
/* justify-content: space-between; */
min-width: 0;
/*the flex feature*/
/* max-width: 5%; */
background: tomato;
color: white;
/* font-weight: bold; */
/* font-size: 3rem; */
/* text-align: center; */
margin: .5rem;
/* flex: 1 1 auto; */
/* flex: 1 1 1 1; */
/* outline: 1px solid blue; */
}