Problem
Every time I attempt to implement the following code (outlined below), the div only appears centered when using width: 100px;
.
<div style="border: solid 1px black; width: 100px; height: 100px; background-color: blue; margin-left: auto; margin-right: auto;">
However, when I set a wider width of 500px
, the alignment is no longer centered as desired.
<div style="border: solid 1px black; width: 500px; height: 100px; background-color: blue; margin-left: auto; margin-right: auto;">
Issue #2
https://i.sstatic.net/lGZiT.png
The svg image fails to remain centered.
<div class="col-xl-3 col-lg-3 col-sm-6">
<div class="ud-single-feature wow fadeInUp" data-wow-delay=".25s" >
<div class="ud-feature-icon" >
<i class="lni lni-layers"></i>
</div>
<div class="ud-feature-content" style="position:absolute; width: 100%; text-align: center;">
<h3 class="ud-feature-title" style="text-align: center;">test</h3>
<p class="ud-feature-desc" style="text-align: center;">
test
</p>
<!-- <a href="javascript:void(0)" class="ud-feature-link">
Learn More
</a>-->
</div>
</div>
</div>