css - 如何为 elementor 的图像轮播添加更多颜色
问题描述
我想请你帮忙。我正在用 elementor 构建 wp 网站(我不知道如何编码),我想为图像边框或图像标题的文本添加不同的颜色。支持不会帮助我使用css ...
我可以更改轮播中所有图像的边框颜色
selector img { border: 5px solid red; }
但我想添加 6 张带有 6 种不同颜色边框或不同颜色标题颜色的图像。(不知道用什么css)
在自定义 css 选项卡下有这样写:
使用“选择器”来定位包装元素。例子:
selector {color: red;} // For main element
selector .child-element {margin: 10px;} // For child element
.my-class {text-align: center;} // Or use any custom selector
谢谢
加里克
解决方案
There are a few different ways this can be done, but selector isn't a real element so it may be hard to pinpoint exactly what is needed. For instance, the selector would have to be an HTML element like div.
You can: 1: look for the IDs for those images (#my-id) or 2: look for specific class names (.my-class, the . signifies that it's a class) for those images (if they are there) 3: use the pseudo-selector like first-child, last-child, nth-child
Let's look at the second option since that's closer to best practice:
- you'll want a general CSS rule like the selector image one, but we won't have the color on it.
div img { border: 5px solid; }
// Below would be better because the above looks at ALL images in a div tag ... So that can turn into ... all images on a page.
.container-class-name img { border: 5px solid; }
All images in a div will have a solid border of 5px. It'll default to black without the next part.
- Now the individual images. Let's say each has a class with image-{number}, so those classes would be like image-one, image-two, etc.
.image-one { border-color: red; }
.image-two { border-color: blue; }
.image-three { border-color: yellow; }
Hex color codes are better than using browser ones like red, blue, yellow and etc. If you don't know what those are I would highly suggest reading up on them.
You have to be both very general and specific when it comes to CSS and learn where each idea needs to be used.
推荐阅读
- algorithm - 算法具有相同名称的新变量
- reactjs - 如何仅为特定的 div(组件)呈现 useState 值?
- azure - 字符串值中的 Azure 数据工厂转义字符
- javascript - chrome devtools调试反应,点击“刷新”导致调试卡住
- excel - 从yahoo Finance 的html 表格中提取数字| Excel VBA 网页抓取
- ansible - 当任何一项任务发生更改时,包含循环的任务中的 changed_when 应该为真
- javascript - 使用另一个字符串数组过滤数组的内容
- inno-setup - Inno Setup - 在消息框打开和关闭时为消息框设置动画
- django - 为什么我的 Python Django url 不起作用?
- c++ - 使用函数 decimal 仅将输入的小数返回为 double C++