由于某种原因,媒体质疑不适用,它适用于任何其他类,我只有这一个问题
我试过了,只删除,屏幕等,都不起作用
const showImageButton = document.getElementById("show-image-button");
const myImage = document.getElementById("my-image");
showImageButton.addEventListener("click", () => {
myImage.hidden = !myImage.hidden;
});
button2,
input[type=submit] {
cursor: pointer;
}
button2,
input,
textarea {
-webkit-appearance: none;
-moz-appearance: none;
}
button2 {
color: currentColor;
overflow: visible;
margin: 0
}
button2 {
border-style: outset;
line-height: 1.6;
margin: 0 0 0px;
text-align: center;
line-height: 60px;
max-width: 300px;
border-radius: 10px;
display: inline-block;
text-align: center;
text-decoration: none;
position: relative;
font-weight: 300;
font-size: .85em;
width: 100%;
}
So i want to make it to be width 100% on mobile @media only screen {
.button2 {
width: 100%;
}
}
<button2 id="show-image-button">Méret Táblázat</button2>
<img id="my-image" src="https://cdn.shopify.com/s/files/1/2999/5106/files/True-to-Sole-nike-sneaker-sizechart_760x760.jpg?v=1611582903" hidden>
2条答案
按热度按时间368yc8dk1#
.button2
-有一个点意味着你正在寻找一个有类button 2的元素,但是在你的HTML结构中我没有看到这个名字的类。尝试下面的代码,这将查找id为 show-image-button 的元素
hs1ihplo2#
您需要添加屏幕大小。请尝试: