[CSS] Re-order the appearance of grid items using the order property
CSS The of Using order Property Grid re
2023-09-14 08:59:18 时间
As with flex items, we can set an order
value on grid items. Let’s see how this affects the DOM and the appearance of our grid.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Order</title> <style> .container > * { background-color: aqua; } .container { display: grid; height: 100vh; grid-gap: 10px; } .grid-item:nth-of-type(3) { color: antiquewhite; font-size: 2em; order: -1; /*default is 0*/ } .grid-item:nth-of-type(1) { color: antiquewhite; font-size: 2em; order: 1; /*default is 0*/ } </style> </head> <body> <div class="container"> <div class="grid-item">1</div> <div class="grid-item">2</div> <div class="grid-item">3</div> <div class="grid-item">4</div> <div class="grid-item">5</div> </div> </body> </html>
相关文章
- 安卓 android studio 报错 The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle
- 【异常】[ERROR] The cloud assistant is not installed on the ECS, or the cloud assistant is unavailable. cloudassistant is uninstall
- 当当网首页——CSS代码
- CSS魔法堂:Position定位详解
- [CSS] Change the off-axis Alignment of a Flexed Container with `align-items`
- [CSS] Purgecss to remove unused css
- [CSS] Change the Alignment of a Single Flexed Item with 'align-self'
- [CSS3] Target HTML Elements not Explicitly set in the DOM with CSS Pseudo Elements (Blockquotes)
- 解决The type or namespace name 'XXXX' does not exist in the namespace 'XXXXXXXXX' 的错误
- SAP UI5 使用 CSS 的一些注意事项
- The resource could not be loaded because the App Transport Security policy requires the use of a sec
- Paper:LSTM之父眼中的深度学习十年简史《The 2010s: Our Decade of Deep Learning / Outlook on the 2020s》的解读
- 已解决The conversion of the nvarchar value ‘10033121171441‘ overflowed an int column
- 已解决The above exception was the direct cause of the following exception:
- EnvironmentNotWritableError: The current user does not have write permissions to the targe...
- The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0
- 魔戒 (The Lord of the Rings,又译《指环王》)
- CSS_使用css布局
- 【2023年4月美赛加赛】Z题:The Future of the Olympics 思路、建模方案、数据来源、相关资料
- HTML+CSS+jquery代码实例:水波纹效果与纯HTML CSS和jquery(拿来就能用)