css nth-child多种布局使用方式示例代码
代码语言:html
所属分类:布局界面
代码描述:css nth-child多种布局使用方式示例代码
代码标签: css nth-child 布局 使用 方式 示例 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> main { display: flex; flex-direction: column; gap: 4vmin; /* border: 1px solid blue; */ } ul { display: grid; grid-template-columns: repeat(8, 1fr); place-items: center; list-style-type: none; width: 100%; max-height: 8vmin; padding: 0.5em; background: white; border: 1px solid blue; border-radius: 0.25em; } li { display: grid; place-items: center; width: 5vmin; aspect-ratio: 1; background: lightblue; border-radius: 50%; color: indigo; } .one li:nth-child(2n+4) { background: indigo; color: ivory; } .t.........完整代码请登录后点击上方下载按钮下载查看
网友评论0