css实现文字在横线上居中
生活随笔
收集整理的這篇文章主要介紹了
css实现文字在横线上居中
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
效果圖
html代碼:
<body> <p class="p1">中間</p> <div class="div"> </div> </body>
css代碼:
.p1 { display: inline-block; font-size: 20px; color: #4A4A4A; background-color: #fff; margin-left: 50%; padding: 5px 10px; position: relative; left: -30px; top: 30px; } .div { width: 1000px; margin: 0 auto; border-top: 1px solid #ccc; padding: 20px 5px; margin-bottom: 100px; }
轉載于:https://www.cnblogs.com/susu0110/p/10856999.html
《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的css实现文字在横线上居中的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 平安人寿保险的险种
- 下一篇: MySql 5.7 重置root密码