gpt4 book ai didi

仅 CSS 选项卡需要在选项卡内标准呈现单选按钮和标签

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

为了生成 CSS_only 标签,单选按钮被发送到 View 之外并且标签标签具有其特定的样式。

.tabs input[type="radio"] {
position: absolute;
top: -9999px;
left: -9999px;
}
.tabs label {
display: block;
min-height: 150px;
padding: 4px 4px;
[...]
}
.tabs label:hover {
background: #E0F8E0;
}
.tabs .tab-content {
z-index: 2;
display: none;
overflow: hidden;
width: 100%;
font-size: 1.08em;
line-height: 1.1em;
padding: 22px;
position: absolute;
top: 53px;
left: 0;
background: #ffffff;
}
.tabs [id^="tab"]:checked + label {
top: 0;
padding-top: 3px;
border-top: 3px solid #E0F8E0;
}
.tabs [id^="tab"]:checked ~ [id^="tab-content"] {
display: block;
}

但是,在生成的可见 div 单选按钮及其各自标签的内容中,需要恢复为标准模式。

<ul class='tabs'>
<li>
<input type='radio' name='tabs' id='tab_101' checked />
<label for='tab_101'>
<img id='101' name='masteroption %>' src='/masters/101.jpg' />
</label>
<div id='tab-content_101' class='tab-content'>
<input type="radio" id="432432" name="depth" value="432" checked="checked" class='tabs-inner'>
<label class='tabs-inner-label'>432mm</label>

我为内部的 radio 和 label 标签分配了不同的类,

.tabs-inner[type='radio'] + label {
display: inline-block;
margin-left: 0.5rem;
margin-right: 1rem;
margin-bottom: 0;
vertical-align: baseline;
}
.tabs-inner-label {
display: block;
margin: 0;
font-size: 0.875rem;
font-weight: normal;
line-height: 1.8;
color: #0a0a0a;
}

但是,浏览器开发者工具显示应用的类仍然是父级的,而不是直接分配的 not the directly assigned one

如何为这些嵌套元素赋予不同的样式?

最佳答案

试试这个

.tabs .tab-content .tabs-inner-label{
display: block;
margin: 0;
font-size: 0.875rem;
font-weight: normal;
line-height: 1.8;
color: #0a0a0a;
}

!important 是您最后的选择。

关于仅 CSS 选项卡需要在选项卡内标准呈现单选按钮和标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57621753/

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