gpt4 book ai didi

html - CSS 指的是每个奇怪的嵌套子项?

转载 作者:太空宇宙 更新时间:2023-11-04 13:29:57 24 4
gpt4 key购买 nike

我正在尝试制作一个评论系统,其中嵌套的评论具有斑马背景色。 (蓝色bg回复白色bg回复蓝色bg...)

与其将它们称为 .comment, .comment .comment .comment, .comment .comment .comment, .comment, .comment ......,有没有办法引用这些嵌套子项?

***我只能访问样式表,所以 html、php 和 javascript 是不可能的。

最佳答案

您可以添加一个交替类来伴随 .comment,它在页面上布置评论时按程序应用(例如:.row1. row2 等),然后使用 CSS 相应地设置这些类的样式。

关于html - CSS 指的是每个奇怪的嵌套子项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8499496/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com