The problem of span centering

.panel-body span{
    display: block;
    letter-spacing:1px;
    margin: 2px 0;
    width:fit-content;
}
 .innerPanel{
    float: left;
    width: 25%;
    word-wrap: break-word;
    height: 150px;
}
.panelBody{
    padding: 0px;
}
.panel-heading{
    text-align: center;
}
.panel{
    margin-bottom: 0;
}
      
<div class="panel panelWrap panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title"></h3>
    </div>
    <div class="panel-body panelBody">
        <div class="panel innerPanel panel-info" >
            <div class="panel-heading">
                <h3 class="panel-title"></h3>
            </div>
            <div class="panel-body">
                <span></span>
            </div>
        </div>
        <div class="panel innerPanel panel-info">
            <div class="panel-heading">
                <h3 class="panel-title"></h3>
            </div>
            <div class="panel-body">
                <span></span>
                <span></span>
                <span></span>
            </div>
        </div>
        <div class="panel innerPanel panel-info">
            <div class="panel-heading">
                <h3 class="panel-title"></h3>
            </div>
            <div class="panel-body">
                <span></span>
            </div>
        </div>
        <div class="panel innerPanel panel-info">
            <div class="panel-heading">
                <h3 class="panel-title"></h3>
            </div>
            <div class="panel-body">
                <span></span>
            </div>
        </div>
    </div>

    <div class="panel-heading">
        <h3 class="panel-title"></h3>
    </div>
    <div class="panel-body panelBody">
        <div class="panel innerPanel panel-info" >
            <div class="panel-heading">
                <h3 class="panel-title"></h3>
            </div>
            <div class="panel-body">
                <span></span>
            </div>
        </div>
        <div class="panel innerPanel panel-info">
            <div class="panel-heading">
                <h3 class="panel-title"></h3>
            </div>
            <div class="panel-body">
                <span></span>
                <span></span>
                <span></span>
            </div>
        </div>
        <div class="panel innerPanel panel-info">
            <div class="panel-heading">
                <h3 class="panel-title"></h3>
            </div>
            <div class="panel-body">
                <span></span>
            </div>
        </div>
        <div class="panel innerPanel panel-info">
            <div class="panel-heading">
                <h3 class="panel-title"></h3>
            </div>
            <div class="panel-body">
                <span></span>
            </div>
        </div>
    </div>
</div>

invalid text-align:center
want to know how to center accurately

Mar.14,2021

.panel-heading{
    display: flex;
    align-items: center;
    justify-content: center;
}

Center vertically and horizontally


if the block element is centered horizontally, just use margin: 0 auto;

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b325d5-40e4d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b325d5-40e4d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?