Problem
When I try to use the code (see below), the div is only centered when I use width: 100px;
.
<div style="border: solid 1px black; width: 100px; height: 100px; background-color: blue; margin-left: auto; margin-right: auto;">
Since I want to assign a much longer width to the text and set the width to 500px, the div is no longer centered.