html - CSS如何将图像定位在右下角

标签 html css

当我尝试将按钮放在左下角时,它起作用了,但是当我转到其中一个按钮并返回时,它除了一个按钮之外还有所有按钮?另一个我需要向下滚动才能看到请帮忙

HTML

<!Doctype html>
<html>
  <head>
  <title>Forsaken </title>
  <link href="main.css" rel="stlesheet" type="text/css">
  </head>

   <body>


  <a href="teams.html"><button><img class="#topleft" src="icon1.jpg  " width="100%" alt="Teams" ></button></a>
  <a href="store.html"><button><img class="#topright" src="icon2.jpg  " width="100%" alt="store" ></button></a>
  <a href="sponsors.html"><button><img class="#bottomleft" src="icon4.jpg  " width="100%" alt="sponsors" ></button></a>
  <a href="aboutus.html"><button><img class="#bottomright" src="icon3.jpg  " width="100%" alt="aboutus" ></button></a>


</body>


</html>

CSS

#topleft {
    position: fixed;
    top: 0px; 
    left: 0px;
}

#topright {
    position: fixed;
    top: 0px;
    right: 0px;
}

#left {
    position: fixed;
    left: 0px;
}

#right {
    position: fixed;
    right: 0px;
}


div {
    border-style:solid;
    border-width:0px;   
    border-color:#000000;
}

#yes {
  border: none;
    padding: 0;
    background: none;
}

.flat {
    border: none;
    background: #222;
    color: #FFF;
    padding: 0px 0px;
    font-size: 22px;
    font-family: Palatino;
    font-weight: bold;
}

.lighter {
    background: #666;
}

#no {
  border: none;
    padding: 0;
    background: none;
}

.flat {
    border: none;
    background: #222;
    color: #FFF;
    padding: 0px 0px;
    font-size: 22px;
    font-family: Palatino;
    font-weight: bold;
}

.lighter {
    background: #666;
}

p.s 所有其他按钮都可以使用,但“关于我们”按钮除外。

最佳答案

更改您的代码:

#left {
position: fixed;
left: 0px;
}

#right {
position: fixed;
right: 0px;
}

.bottomleft{
position: fixed;
left: 0px;
}

.bottomright{
position: fixed;
right: 0px;
}

希望对你有帮助

关于html - CSS如何将图像定位在右下角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35757150/

相关文章:

html - 如何使用 html/css 将容器 div 从页眉拉伸(stretch)到页脚?

PHP 搜索 MySQL 表

html - 进度条(电子邮件)

javascript - 使用缩小的 js 时出现 DOM 异常

jquery 保持 div 在悬停时可见

html - 仅当选中复选框时才提交表单

JavaScript 获取变量的背景颜色

css - JqueryUi 自动完成组合框按钮

html - Flexbox 调整大小和可滚动溢出

css - 2个div高度合并在一起