【发布时间】:2016-12-12 22:23:54
【问题描述】:
我正在使用 wordpress 作为 CMS 完成一个网页。我的客户要求我在页面的最顶部放置一个图像/按钮。与主导航菜单对齐。
没关系,我做到了,但发生的事情是这样的: 当我使用不同的屏幕分辨率时,按钮不会与页面的最顶部保持对齐
我尝试使用“Position:fixed”,但是这样,按钮会随着页面移动,我希望它们保持在页面顶部并且不要滚动与页面。
我该怎么做?有人能帮我吗?谢谢!!!
.buttons {
position: absolute;
left: 85%;
z-index:905;
margin-top:0
}
.buttonLang {
position: relative;
z-index: 910;
}
.buttonZone {
position: relative;
z-index: 915;
top: -107px;
left: 100px;
}
.selectLang {
display: none;
position: absolute;
left: 0;
bottom: 5px;
right: 0;
background-color: rgba(0,0,0,1);
}
#buttonLang:hover img {
opacity: 1;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: /*#2893CC;
*/#FFFFFF;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,1);
padding: 12px 16px;
z-index: 1;
font-family: Calibri;
}
.dropdown:hover .dropdown-content {
display: block;
line-height: 200%;
}
</head>
<body>
<body bgcolor="#E1E1E1">
<div class="buttons">
<div class="buttonLang">
<div class="dropdown">
<img src="http://www.jourdan.org.br/wp-content/uploads/button-lang.png" alt="" title=""/>
<div class="dropdown-content">
<a href="http://localhost/"><img src="http://localhost/wp-content/uploads/2016/10/flag-bra.png" width="30"alt="" title=""/> Português</br></a>
<a href="http://localhost/empresa-esp/"><img src="http://localhost/wp-content/uploads/2016/10/flag-esp.png" width="30"alt="" title=""/> Español</br></a>
<a href="http://localhost/company/"><img src="http://localhost/wp-content/uploads/2016/10/flag-usa.png" width="30"alt="" title=""/> English</a>
</div>
</div>
</div>
<div class="buttonZone">
<a href="http://localhost/sgv-zone/"><img src="http://www.jourdan.org.br/wp-content/uploads/button-sgvzone.png" alt="" title=""/></a>
</div>
<!-- begin snippet: js hide: false console: true babel: false -->
【问题讨论】:
-
您可以发布指向您网站的链接吗?
-
它只是在“本地主机” ....=/
-
大家好!我刚刚将网站上传到网络服务器。它在这里:www.gncshop.com.ar/portal/ 因为我使用的是全高清显示器,所以按钮出现在正确的位置。但是如果我使用分辨率较低(1366x768)的显示器,一半的图像会隐藏在上边缘谢谢!