企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# css居中 ## 实现居中的几种放方式 ![](https://img.kancloud.cn/5a/bd/5abdf86feeba37d6a44e9be90d01db92_1586x516.png) margin:0 auto; width:150px ``` <pre class="calibre13">``` 就必须给标签配上指定的宽度 ``` ``` # body里面div居中 ``` <pre class="calibre13">``` body<span class="token1">{</span> dispaly<span class="token1">:</span>grid<span class="token1">,</span> place<span class="token">-</span>items<span class="token1">:</span>center <span class="token1">}</span> dic<span class="token1">{</span> width<span class="token1">:</span><span class="token5">200</span>px height<span class="token1">:</span><span class="token5">200</span>px backgroud<span class="token1">:</span>red <span class="token1">}</span> ``` ``` # 文字超出div 超出部分隐藏 ``` <pre class="calibre13">``` overflow:auto <span class="token6">//有滚动条效果</span> overflow:hidden <span class="token6">// 超出部分隐藏</span> clip<span class="token">-</span>path:属性值 <span class="token6">// 绘制其他形状</span> ``` ``` # 设置占位原形 ``` <pre class="calibre14">``` clip<span class="token">-</span>path:circle() <span class="token6">// 圆形 但是占位还是方形</span> shape<span class="token">-</span>outside:circle()<span class="token6">//增加这个属性 占位都变成了圆形</span> ``` ```