I'm working on a pretty simple website right now that will serve as a sort of dictionary for some of my HTML and CSS work. I have a div for CSS terms on the page. When I shrink the browser, everything else on the page shrinks but this div moves to the far right and becomes less wide. The height stays the same but the width of the div becomes thin. The words in the div flow out and this causes there to be a scrollbar.
At the moment, my HTML looks like this:
.terms {
list-style-position: inside;
background-color: powderblue;
box-shadow: 10px 10px 15px dimgray;
padding: 20px;
margin-left: 370px;
margin-right: 370px;
}
<div class="terms">
<h2> CSS PROPERTIES: </h2>
<ul>
<li> <span class="def"> text-align </span> - left, center, right </li>
</ul>
</div>
The other elements on my page are paragraphs and they all resize. I have 2 other divs on the page for side comments but those resize with the browser too. In case it helps, this is the CSS for the div that actually resizes correctly:
.notes{
text-align: center;
padding: 20px;
font-weight: bold;
border: 10px dotted navy;
display: inline-block;
}
Does anyone have any idea why this particular div might not resize with the browser?
tag wrap the li – Alfin Paul Jul 13 '18 at 05:25