html5之div居中
阿新 • • 發佈:2019-01-26
效果如圖:
程式碼如下:
其中 必須包含一個父容器,和自容器,需要配合使用#navright { display: inline-block; vertical-align: middle; width:100%; height:100%; min-height:400px; border:1px solid blue; } #txnavright { position: absolute; width: 100%; height: 300px; text-align: center; left: 0px; top: 0px; border:1px solid red; }
忘了從網上哪裡找到的程式碼,這裡謝過~
撒花~~~