css图片文字竖向横向居中


<style type="text/css">
    .box1{
             background-color: #ccc;
             width: 300px;
             height: 300px;
        line-height: 300px;
        text-align: center;
         }
     .box2{
         display: inline-block;
         line-height: 20px;
         vertical-align: middle;
           }
</style>
<div class="box1">
    <div class="box2">
        <span>caadadfafas</span><br/>
        <img src="https://yxcx.oss-cn-beijing.aliyuncs.com/yxcximg/demo/game.png" style="width: 50%">    </div>

</div>

css图片文字竖向横向居中