Html CSS按钮位置在调整大小/缩放时不断变化
我对css按钮有很大的问题。。。我的屏幕尺寸是1366x768,在我缩小浏览器或向屏幕更大的人显示之前,它们的位置很好 有人能帮我吗Html CSS按钮位置在调整大小/缩放时不断变化,html,css,Html,Css,我对css按钮有很大的问题。。。我的屏幕尺寸是1366x768,在我缩小浏览器或向屏幕更大的人显示之前,它们的位置很好 有人能帮我吗 存在问题的站点:您正在将按钮绝对定位到文档正文: 左按钮示例: position: absolute; top: 475px; width: 251px; 将所有按钮放置在纸张上方的容器中,并将位置设置为相对或绝对,然后播放按钮的位置。将按钮绝对放置到文档正文: 左按钮示例: position: absolute; top: 475px; width: 251p
存在问题的站点:您正在将按钮绝对定位到文档正文: 左按钮示例:
position: absolute;
top: 475px;
width: 251px;
将所有按钮放置在纸张上方的容器中,并将位置设置为相对或绝对,然后播放按钮的位置。将按钮绝对放置到文档正文: 左按钮示例:
position: absolute;
top: 475px;
width: 251px;
将所有按钮放置在纸张上方的容器中,将位置设置为相对或绝对,然后播放按钮的位置。使用绝对定位时,需要一个定位点。锚定点是HTML树上定义了
position:relative
的第一个元素。如果未找到元素,则主体标记将成为定位点
因为你有一个里面有东西的包装器,所以这应该是你的定位点,这样即使浏览器调整了大小,也能把所有东西都放在里面,而不是身体。当你使用绝对定位时,你需要一个定位点。锚定点是HTML树上定义了
position:relative
的第一个元素。如果未找到元素,则主体标记将成为定位点
因为你有一个里面有东西的包装器,所以这应该是你的定位点,这样即使浏览器调整了大小,也能把所有东西都放在里面,而不是身体。今天的工作很无聊,你的图形也很酷,所以 这是我的朋友:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Riot Points Codes</title>
<link rel="SHORTCUT ICON" href="http://agessy.com/favicon.png" />
<style type="text/css">
body {
background: url("http://riotpointscodes.info/images/background.jpg") no-repeat scroll center top #070b14;
margin: 0;
padding: 0;
}
#wrapper {
width: 895px;
height: 493px;
position:relative;
top:180px;
margin:0 auto;
background: url('region_files/paper.jpg') no-repeat top center;
}
.choice {
background: url("region_files/map.png") no-repeat scroll 0 0 transparent;
height: 212px;
left: 50%;
margin-left: -259px;
position: absolute;
top: 43px;
width: 517px;
}
.logo {
left: 50%;
margin-left: -205px;
position: absolute;
top: -135px;
}
#lol-custom-buttons {
position: absolute;
bottom: 107px;
left: 0px;
width: 100%;
height: 90px;
text-align:center
}
.play-free-link {
height: 90px;
width: 251px;
background-repeat: none;
color: #ECC873;
display: inline-block;
}
.play-free-link.one {
background-image: url("http://riotpointscodes.info/images/1n.png");
}
.play-free-link.one:hover {
background-image: url("http://riotpointscodes.info/images/1h.png");
}
.play-free-link.two {
background-image: url("http://riotpointscodes.info/images/3n.png");
}
.play-free-link.two:hover {
background-image: url("http://riotpointscodes.info/images/3h.png");
}
.play-free-link.three {
background-image: url("http://riotpointscodes.info/images/2n.png");
}
.play-free-link.three:hover {
background-image: url("http://riotpointscodes.info/images/2h.png");
}
</style>
</head>
<body>
<div id="wrapper">
<div class="logo"><img src="region_files/logo.png"></div>
<div class="choice"></div>
<div id="lol-custom-buttons">
<a class="play-free-link one" href="http://riotpointscodes.info/"></a>
<a class="play-free-link two " href="http://riotpointscodes.info/"></a>
<a class="play-free-link three" href="http://riotpointscodes.info/"></a>
</div>
</div>
</body>
</html>
暴动点代码
身体{
背景:url(“http://riotpointscodes.info/images/background.jpg)无重复滚动中心顶部#070b14;
保证金:0;
填充:0;
}
#包装纸{
宽度:895px;
身高:493px;
位置:相对位置;
顶部:180像素;
保证金:0自动;
背景:url('region_files/paper.jpg')没有重复的顶部中心;
}
.选择{
背景:url(“region\u files/map.png”)无重复滚动0透明;
身高:212px;
左:50%;
左边距:-259px;
位置:绝对位置;
顶部:43px;
宽度:517px;
}
.标志{
左:50%;
左边距:-205px;
位置:绝对位置;
顶部:-135px;
}
#lol自定义按钮{
位置:绝对位置;
底部:107px;
左:0px;
宽度:100%;
高度:90px;
文本对齐:居中
}
.播放免费链接{
高度:90px;
宽度:251px;
背景重复:无;
颜色:#ECC873;
显示:内联块;
}
.免费播放链接{
背景图像:url(“http://riotpointscodes.info/images/1n.png");
}
.播放免费链接。一:悬停{
背景图像:url(“http://riotpointscodes.info/images/1h.png");
}
.免费播放链接{
背景图像:url(“http://riotpointscodes.info/images/3n.png");
}
.播放自由链接。第二:悬停{
背景图像:url(“http://riotpointscodes.info/images/3h.png");
}
.免费播放链接{
背景图像:url(“http://riotpointscodes.info/images/2n.png");
}
.播放自由链接。第三:悬停{
背景图像:url(“http://riotpointscodes.info/images/2h.png");
}
今天工作很无聊,你的图形也很酷,所以
这是我的朋友:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Riot Points Codes</title>
<link rel="SHORTCUT ICON" href="http://agessy.com/favicon.png" />
<style type="text/css">
body {
background: url("http://riotpointscodes.info/images/background.jpg") no-repeat scroll center top #070b14;
margin: 0;
padding: 0;
}
#wrapper {
width: 895px;
height: 493px;
position:relative;
top:180px;
margin:0 auto;
background: url('region_files/paper.jpg') no-repeat top center;
}
.choice {
background: url("region_files/map.png") no-repeat scroll 0 0 transparent;
height: 212px;
left: 50%;
margin-left: -259px;
position: absolute;
top: 43px;
width: 517px;
}
.logo {
left: 50%;
margin-left: -205px;
position: absolute;
top: -135px;
}
#lol-custom-buttons {
position: absolute;
bottom: 107px;
left: 0px;
width: 100%;
height: 90px;
text-align:center
}
.play-free-link {
height: 90px;
width: 251px;
background-repeat: none;
color: #ECC873;
display: inline-block;
}
.play-free-link.one {
background-image: url("http://riotpointscodes.info/images/1n.png");
}
.play-free-link.one:hover {
background-image: url("http://riotpointscodes.info/images/1h.png");
}
.play-free-link.two {
background-image: url("http://riotpointscodes.info/images/3n.png");
}
.play-free-link.two:hover {
background-image: url("http://riotpointscodes.info/images/3h.png");
}
.play-free-link.three {
background-image: url("http://riotpointscodes.info/images/2n.png");
}
.play-free-link.three:hover {
background-image: url("http://riotpointscodes.info/images/2h.png");
}
</style>
</head>
<body>
<div id="wrapper">
<div class="logo"><img src="region_files/logo.png"></div>
<div class="choice"></div>
<div id="lol-custom-buttons">
<a class="play-free-link one" href="http://riotpointscodes.info/"></a>
<a class="play-free-link two " href="http://riotpointscodes.info/"></a>
<a class="play-free-link three" href="http://riotpointscodes.info/"></a>
</div>
</div>
</body>
</html>
暴动点代码
身体{
背景:url(“http://riotpointscodes.info/images/background.jpg)无重复滚动中心顶部#070b14;
保证金:0;
填充:0;
}
#包装纸{
宽度:895px;
身高:493px;
位置:相对位置;
顶部:180像素;
保证金:0自动;
背景:url('region_files/paper.jpg')没有重复的顶部中心;
}
.选择{
背景:url(“region\u files/map.png”)无重复滚动0透明;
身高:212px;
左:50%;
左边距:-259px;
位置:绝对位置;
顶部:43px;
宽度:517px;
}
.标志{
左:50%;
左边距:-205px;
位置:绝对位置;
顶部:-135px;
}
#lol自定义按钮{
位置:绝对位置;
底部:107px;
左:0px;
宽度:100%;
高度:90px;
文本对齐:居中
}
.播放免费链接{
高度:90px;
宽度:251px;
背景重复:无;
颜色:#ECC873;
显示:内联块;
}
.免费播放链接{
背景图像:url(“http://riotpointscodes.info/images/1n.png");
}
.播放免费链接。一:悬停{
背景图像:url(“http://riotpointscodes.info/images/1h.png");