ALL
Ways to make elements in HTML center aligned horizontally
In our daily HTML design, it is an easy job to horizontally center align an element with known width.<div class="element">I am<a href="http://www.aiubug.com" target="_blank" rel="external" title=""> bug </a>ï¼</div> .element{width:960px;margin:0 auto;} The above codes set the width of the div block and horizontally center align it. It's very easy to implement. However, if we have some elements we don;t know their width and we still want to center align them. What should we do? The above code is not useful if we don't know the width before we center...
5,426 0 HTML CSS CENTER ALIGN UNKNOWN WIDTH