html盒子水平和垂直居中
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <! DOCTYPE html> < html > < head > < meta charset="utf-8"> < title >菜鸟教程(runoob.com)</ title > < style > #main { width: 400px; height: 150px; border: 1px solid #c3c3c3; display: flex; justify-content: center; align-items: center; } #main div { width: 70px; height: 70px; } </ style > </ head > < body > < div id="main"> < div style="background-color:coral;"></ div > </ div > < p >< b >注意:</ b > Internet Explorer 10 及更早版本浏览器不支持 justify-content 属性。</ p > < p >< b >注意:</ b > Safari 6.1 及更新版本通过 -webkit-justify-content 属性支持该属性。</ p > </ body > </ html > |
原文地址:http://www.runoob.com/try/try.php?filename=trycss3_justify-content
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术