如何让我的按钮保持在我的图像滑块下面?

时间:2018-05-13 14:50:19

标签: html css

我有两个按钮,无论屏幕有多大,我都想留在我的滑块中间。我怎么能这样做,现在他们只是在我改变屏幕大小时跳来跳去。当我有最大和最小的尺寸时,它看起来还可以,但不是在它之间......



.buttonright {
  border-radius: 4px;
  background-color: black;
  border: none;
  color: #FFFFFF;
  text-align: center;
  font-size: 17px;
  width: 90px;
  transition: all 0.5s;
  cursor: pointer;
}

.buttonleft {
  border-radius: 4px;
  background-color: black;
  border: none;
  color: #FFFFFF;
  text-align: center;
  font-size: 17px;
  width: 90px;
  cursor: pointer;
}

.slide {
  margin-left: 300px;
  margin-top: 20px;
  min-width: 500px;
}

@media screen and (max-width:800px) {
  .slide {
    margin-left: 14%;
  }
}

#buttons {
  margin-left: 27%;
  width: 50%;
}

@media screen and (max-width:767px) {
  #buttons {
    margin-left: 18%;
  }
}

<div class="slide">
  <img class="mySlides" src="http://via.placeholder.com/50x50">
  <img class="mySlides" src="http://via.placeholder.com/50x50">
  <img class="mySlides" src="http://via.placeholder.com/50x50">

  <div id="buttons">
    <button class="buttonleft" onclick="plusDivs(-1)">&#10094;</button>
    <button class="buttonright" onclick="plusDivs(1)">&#10095;</button>
  </div>
</div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

这是另一个解决方案

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Qn.settings")

import django

print("django.setup()")
django.setup()

from socketio import Middleware
from qn_admin_website_chat.views import sio

django_app = get_wsgi_application()
application = Middleware(sio, django_app)

if __name__ == '__main__':
    import eventlet
    import eventlet.wsgi
    eventlet.wsgi.server(eventlet.listen(('', 8000)), application)  
SendEmail()