My problem is I want create code in html/CSS which adjust automatically the website (blocks+content) whenever I minimize the browser window. e.g. I've got the problem of text overflow in the block which I created, when I minimize the browser window.
I want the block element to adjust to the length of my content.
Problem There is a text overflow in the block element, which I marked as a green block with a solid border style.
I tried Sure I can solve it with overflow: auto; but it's an ugly solution.
I want The block to adjust itself to the length of the text and vice versa
.p1 {
background-color: green;
border-style: solid;
float: left;
width: auto;
height: 100px;
}
.block {
display: block;
width: 180px;
}
<header>
<h1>Title</h1>
<nav></nav>
</header>
<main>
<article class="p1">
<div class="block">
<h4>Paragraph I</h4>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis,
sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.
</p>
</div>
</article>
</main>
<footer></footer>