热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

使用CSS的横幅顶部的响应按钮-ResponsivebuttonontopofbannerusingCSS

IhaveasiteImworkingoninwordpressredesigningtobemoreresponsive.AndrightnowIhaveth

I have a site I'm working on in wordpress/redesigning to be more responsive. And right now I have this button that sits on top of my banner, and it looks really nice, but when I shrink down the window it gets pushed down and eventually dissapears. I want it to look like the illustration below, where the button slowly moves downwards, and perhaps resizes a bit so it becomes smaller, where it finally sits on the bottom edge of the banner when its all the way shrunk. see picture:

我有一个我正在进行wordpress /重新设计的网站,以提高响应速度。现在,我有一个位于我的横幅顶部的按钮,看起来非常好,但是当我缩小窗口时,它会被推下并最终消失。我希望它看起来像下面的插图,按钮慢慢向下移动,并且可能调整大小以使其变小,当它一直缩小时它最终位于横幅的底部边缘。看图:

responsive site

Here is my code for this, I want the class "get-order" (the button) to be responsive and move down. I'm a bit new to responsive design so what are some suggestions? I noticed the site I'm working on had some media queries, so I assume that is what I should use, I just don't really know the correct and most efficient CSS way to do it.

这是我的代码,我希望类“get-order”(按钮)能够响应并向下移动。我对响应式设计有点新意,有什么建议吗?我注意到我正在处理的网站有一些媒体查询,所以我认为这是我应该使用的,我只是不知道正确和最有效的CSS方式来做到这一点。










#header{ 
width:100%;
height:560px;
overflow:hidden;
z-index:99;
position:relative;
margin:0px;
padding:0px;
}

.wrap {
height: auto;
margin: 0 auto;
padding: 0;
position: relative;
width: 955px;
z-index: 999;
}

.menu {
background: url("../../../images/nav-bg.jpg") repeat-x scroll left center rgba(0, 0, 0, 0);
min-height: 60px;
position: absolute;
top: 0;
width: 100%;
z-index: 999;
}

.nav {
margin: 0;
padding: 20px 0 0 67px;
}

.nav li {
display: inline-block;
float: left;
}

* {
margin: 0;
padding: 0;
}


.get-order {
 background-image: url("/images/b.png");
 height: 98px;
 left: 330px;
 position: absolute;
 top: 230px;
 width: 400px;
 z-index: 9;
}


.banner {
background-color: #060a0b;
display: inline-flex;
height: auto;
left: 0;
position: absolute;
text-align: center;
top: 0;
width: 100%;
z-index: 9;
}


@media screen and (max-width: 768px){

.wrap,.wrap-2,.wrap-3,.wrap-4{ width:750px;}
.nav li a{padding:0 18px 0 0;}
#header{ height:310px;}
.nav{ padding: 20px 0 0 33px;}
.nav li a{padding: 0 16px 0 0;}
.banner{display:inherit;}
}


@media screen and (max-width: 767px){

.wrap,.wrap-2,.wrap-3,.wrap-4{width:96%;}

.top-wrapper{ width:100%;}
.top-content{margin-top:20px;}

#menu-icon {
    color: #fff;        
    height: 30px;
    padding: 10px 20px 10px 10px;
    cursor: pointer;
    display: block;
    background:url(../../../images/arrow3.png) no-repeat  95% 40% #161677;
    line-height:28px;
    font-family:'Roboto Slab',serif;
}


#navigation {
    clear: both;
    /*position: absolute;*/
    top: 49px;
    /*width: 230px;*/
    width:100%;
    z-index: 9999;
    padding: 0px;
    display: none;
    position:absolute;
}

ul#nav-wrap{ display:none;}
.menu{ min-height:inherit;}
.nav{background:#f1f1f4;}
.nav li{ display:block; padding:5px 10px; float:none; background:none; border-top:1px solid #555559;  }
.nav li a{ color:#161677; font-size:14px;}
.nav li a.active, .nav li a:hover{ color:#303031;}
#header{ height:auto;}
.menu{position:inherit;}
.banner{ position:inherit;}
.wrap h1{padding-bottom:10px;}
.nav{ padding:0;}
}

@media screen and (min-width:320px){
.wrapper{ width:86%;}
}

1 个解决方案

#1


0  

use css bottom function in your media queryi.e.

在媒体查询中使用css bottom函数。

@media screen and (min-width:320px){
    .get-order {
      bottom: 0;
      height: x;
      left: x;
      width: x;
   }
}

推荐阅读
  • 欢乐的票圈重构之旅——RecyclerView的头尾布局增加
    项目重构的Git地址:https:github.comrazerdpFriendCircletreemain-dev项目同步更新的文集:http:www.jianshu.comno ... [详细]
  • ZSI.generate.Wsdl2PythonError: unsupported local simpleType restriction ... [详细]
  • 本文介绍了NetCore WebAPI开发的探索过程,包括新建项目、运行接口获取数据、跨平台部署等。同时还提供了客户端访问代码示例,包括Post函数、服务器post地址、api参数等。详细讲解了部署模式选择、框架依赖和独立部署的区别,以及在Windows和Linux平台上的部署方法。 ... [详细]
  • SoIhavealoopthatrunsperfectforeventsandonlyshowsfutureposts.TheissueisthatIwould ... [详细]
  • 这是原文链接:sendingformdata许多情况下,我们使用表单发送数据到服务器。服务器处理数据并返回响应给用户。这看起来很简单,但是 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • 目录实现效果:实现环境实现方法一:基本思路主要代码JavaScript代码总结方法二主要代码总结方法三基本思路主要代码JavaScriptHTML总结实 ... [详细]
  • Go GUIlxn/walk 学习3.菜单栏和工具栏的具体实现
    本文介绍了使用Go语言的GUI库lxn/walk实现菜单栏和工具栏的具体方法,包括消息窗口的产生、文件放置动作响应和提示框的应用。部分代码来自上一篇博客和lxn/walk官方示例。文章提供了学习GUI开发的实际案例和代码示例。 ... [详细]
  • phpcomposer 那个中文镜像是不是凉了 ... [详细]
  • 导出功能protectedvoidbtnExport(objectsender,EventArgse){用来打开下载窗口stringfileName中 ... [详细]
  • ScrollView嵌套Collectionview无痕衔接四向滚动,支持自定义TitleView
    本文介绍了如何实现ScrollView嵌套Collectionview无痕衔接四向滚动,并支持自定义TitleView。通过使用MainScrollView作为最底层,headView作为上部分,TitleView作为中间部分,Collectionview作为下面部分,实现了滚动效果。同时还介绍了使用runtime拦截_notifyDidScroll方法来实现滚动代理的方法。具体实现代码可以在github地址中找到。 ... [详细]
  • 本文介绍了pack布局管理器在Perl/Tk中的使用方法及注意事项。通过调用pack()方法,可以控制部件在显示窗口中的位置和大小。同时,本文还提到了在使用pack布局管理器时,应注意将部件分组以便在水平和垂直方向上进行堆放。此外,还介绍了使用Frame部件或Toplevel部件来组织部件在窗口内的方法。最后,本文强调了在使用pack布局管理器时,应避免在中间切换到grid布局管理器,以免造成混乱。 ... [详细]
  • 用Vue实现的Demo商品管理效果图及实现代码
    本文介绍了一个使用Vue实现的Demo商品管理的效果图及实现代码。 ... [详细]
  • 本文详细介绍了Android中的坐标系以及与View相关的方法。首先介绍了Android坐标系和视图坐标系的概念,并通过图示进行了解释。接着提到了View的大小可以超过手机屏幕,并且只有在手机屏幕内才能看到。最后,作者表示将在后续文章中继续探讨与View相关的内容。 ... [详细]
  • ejava,刘聪dejava
    本文目录一览:1、什么是Java?2、java ... [详细]
author-avatar
mobiledu2502917953
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有