- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试创建一个白色边框圆圈,在黄色背景框中有一个白色感叹号。黄色背景框的HTML和CSS代码为:
HTML:
<p class="my-paragraph-style">List your dependents and enter their personal information. Pay close attention to information regarding your spouse’s smoking habits.</p>
CSS:
.dependents .my-paragraph-style
{
background: #EABB27;
padding: 20px;
line-height: 1.4;
position: relative;
top: -25px;
}
我从上面的代码(HTML 和 CSS)中得到的黄色背景框的图形表示是:
我的任务是在黄色框内制作一个带有白色感叹号的白色边框圆圈。下面是我在黄色背景框中想要的图像:
为了实现这一点,我从黄色背景框的部分裁剪了圆圈。裁剪后,我使用以下 CSS 代码来获取框内的圆圈。
@media screen and (max-width: 767px) and (min-width: 320px)
{
.info-mobile-header-sections
{ /* Info icon for header parts of sections */
background: url(img/147811205179656.png) no-repeat;
margin-top: -3px;
position: absolute;
z-index: 200;
left: 15px;
}
}
147811205179656.png 是裁剪后的图像 从黄色框的部分。
通过使用上面的 CSS 代码,我只能得到黄色框内的圆圈的一部分,而且也没有正确对齐。如果我遵循正确的方法,请告诉我。
最佳答案
这里不需要使用图像,在这里使用像 ::before
这样的伪元素会更容易、更快、更具可扩展性和灵 active :
.my-paragraph-style {
background: #EABB27;
padding: 20px 20px 20px 50px;
line-height: 1.4;
position: relative;
font-family: arial, helvetica, sans-serif;
color: white;
font-weight: bold;
font-size: 14px;
max-width: 300px;
}
.my-paragraph-style::before {
display: block;
position: absolute;
left: 20px;
top: 23px;
content: "!";
border-radius: 50%;
border: 1px solid yellow;
width: 20px;
height: 20px;
line-height: 22px;
text-align: center;
color: yellow;
font-weight: normal;
}
<p class="my-paragraph-style">List your dependents and enter their personal information. Pay close attention to information regarding your spouse’s smoking habits.</p>
关于html - 如何在html/css中具有黄色背景的框中创建具有白色感叹号的白色边框圆圈?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40406026/
北京时间今天下午,realme 5i手机正式登陆印度市场,5000mAh+骁龙665处理器,售价约合人民币870元。在发布会上,realme的印度CEO马达夫·希思(Madhav Sh
这个问题在这里已经有了答案: What does a space mean in a CSS selector? i.e. What is the difference between .clas
我配置了 Jenkins 构建(项目使用 Java、Maven、JUnit)。根据单元测试失败的 Maven 阶段,我想将构建标记为红色、黄色或绿色: 编译错误:红色 Maven 阶段“测试”失败:红
我想知道是否可以在“solidGauge”图表的右侧设置一个从左侧绿色(0 值)开始、中间渐变为黄色然后渐变为红色的渐变。 我在 yAxis 中尝试了一些配置,但它们没有按照我的要求进行:
我正在使用 cocos2d 库制作 iOS 游戏。 假设您有两个具有两种不同颜色的对象 - 在 RGB 中定义为 Blue: 0,0,255 Yellow: 255,255,0 我想添加蓝色和
有没有办法轻松地将给定的十六进制颜色代码分配给更一般的类别(红色、绿色、蓝色、黄色、橙色、粉色、黑色、白色、灰色……)? 比如 #ffcc55 -> 橙色,#f0f0f0 -> 白色,... 编辑:甚
我必须区分5种类型的图像,这些图像可能主要是红色,绿色,蓝色,橙色或黄色,而白色或黑色。我必须找到图像中突出的颜色。 图像来源是网络摄像头,因此实际颜色还取决于图像的照明度和距网络摄像头的距离。我的图
我一直在寻找如何在 qtableview 的特定单元格上设置颜色。目前,我正在使用 qt 示例卡住列来查看如何在特定单元格上设置颜色。 我在论坛上搜索有关如何告诉使用 qitemdelegate 或
我是一名优秀的程序员,十分优秀!