我的 css 代码有问题。
如您所见,我对 li 元素进行了过滤,但它覆盖了其他元素。我需要使其他两个元素没有过滤器:
有没有可能这样做。
.main {
width:300px;
height:300px;
background-color:blue;
list-style:none;
}
.button {
position: absolute;
top: 35% ;
height: 30px;
width: 120px;
display: none;
z-index: 99;
background-color:black;
color:white;
}
.icon {
width: 30px;
position: absolute;
z-index: 99;
display: none;
width:100px;
}
.main:hover > .button {
display: block;
filter: none;
}
.main:hover > .icon {
display: block;
filter: none;
}
.main:hover {
filter: brightness(50%);
transition: 0.5s;
}
Run Code Online (Sandbox Code Playgroud)
<li class="main">
<img src="https://help.seesaw.me/hc/en-us/article_attachments/204081043/bear.png" class="icon" />
<a class="button" href="#">Button</a>
</li>
Run Code Online (Sandbox Code Playgroud)
我在下面有HTML代码,并且有一些文本没有任何HTML环绕.有没有方法可以隐藏"p"标签后面的文字"Enter" ?
<div class="entry">
<p class="page-header" style="text-align: center;"><strong>Enter</strong></p>
<p> </p>
Enter <-- i want to hide this text
<div class="subhead"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
它不可能用div或任何其他标签包装它,所以我需要一些不同的决定,如JavaScript或一些CSS?
我有下面的代码来从 woocommerce 购物车获取元素,但我也不知道如何删除该项目的链接。你可以帮帮我吗?
<div class="carters">
<?php
$subtotal = WC()->cart->get_cart_subtotal(); echo $subtotal;
foreach( WC()->cart->get_cart() as $cart_item ){
$product_id = $cart_item['data']->get_id();
$qty = $cart_item['quantity'];
$price = $cart_item['data']->get_price();
$thumbnail = get_the_post_thumbnail_url( $product_id );
echo '<img width="50px" src="' . $thumbnail . '" />';
$title = get_the_title( $product_id );
echo $title . $qty . $price;
}
?>
</div>
Run Code Online (Sandbox Code Playgroud) 我有一个数字和数组变量。例如:
var arr = [10, 13, 17];
var number = 8;
Run Code Online (Sandbox Code Playgroud)
我想检查number是否小于arr中的每个值,如果为true,请执行以下操作:
var arr = [10, 13, 17];
var number = 8;
if (number < arr[]) {
// do something
} else {
// do something
}
Run Code Online (Sandbox Code Playgroud)
您能帮我解决这个问题吗?