Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 对象不响应位置:相对_Html_Css - Fatal编程技术网

Html 对象不响应位置:相对

Html 对象不响应位置:相对,html,css,Html,Css,我想要一个方形按钮在浏览器收缩但不移动时响应。有什么问题吗?谢谢你的帮助 <div class="firstSection"> <div class="menuBox"></div> .firstSection { background-image: url(/Users/omaramin/Documents/Competition/project/mainBanner.png); background-repeat: no-

我想要一个方形按钮在浏览器收缩但不移动时响应。有什么问题吗?谢谢你的帮助

<div class="firstSection">
        <div class="menuBox"></div>

.firstSection {
    background-image: url(/Users/omaramin/Documents/Competition/project/mainBanner.png);
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    top:-144px;
    width: 100%;
    height: 100%;
    font-family: Bariol;
    color: #ffffff;
}

.menuBox {
    position: relative;
    margin-left: 200px;
    margin-top: 200px;  
    width: 35px;
    height: 35px;
    border-style: solid;
    border-width: 1px;
    border-radius: 2px;
}

.第一节{
背景图片:url(/Users/omaramin/Documents/Competition/project/mainBanner.png);
背景重复:无重复;
背景位置:中心;
位置:绝对位置;
顶部:-144px;
宽度:100%;
身高:100%;
字体系列:Bariol;
颜色:#ffffff;
}
menuBox先生{
位置:相对位置;
左边距:200px;
利润上限:200px;
宽度:35px;
高度:35px;
边框样式:实心;
边框宽度:1px;
边界半径:2px;
}

如果使用基于像素的定位,请使用百分比

.menuBox {
    position: relative;
    margin-left: 20%;
    margin-top: 200px;  
    width: 35px;
    height: 35px;
    border-style: solid;
    border-width: 1px;
    border-radius: 2px;
}

希望这有帮助

哪个是按钮?一个JSFIDLE怎么样?有同样的问题,请看它有没有!非常感谢你!如果允许的话,我会在7分钟内给你绿色箭头to@user2605157很高兴我能帮忙!我喜欢绿色箭头!!:)