As I was creating sections for a mini "about me" page, I encountered an issue with setting margins in all divs (this one is the most important). Despite specifying widths and heights, I couldn't get margin: 0 auto; to work.
body {
background: #aaa;
}
#about {
font-family: arial;
width: 300px;
height: 20px;
text-align: center;
padding-left: 10px;
opacity: 0.5;
padding-top: 4px;
border-radius: 10px;
background-color: #000;
position: fixed;
margin: 0 auto;
overflow: hidden;
font-size: 11px;
-webkit-transition: all 0.8s ease-out;
-moz-transition: all 0.8s ease-out;
-o-transition: all 0.8s ease-out;
transition: all 0.8s ease-out;
}
#about:hover {
height: 250px;
}
.about-text {
width: 300px;
height: 220px;
overflow-y: auto;
margin-top: 5px;
}
<div id="about">
<font face="arial" color="#fff">𝓐𝓫𝓸𝓾𝓽 𝓜𝒆</font>
<div class="about-text">
<font face="arial" color="#fff"><br>
Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. ... (repeated text) ... </font>
</div>
</div>