我在响应式菜单中遇到问题

马修·约翰

我在响应式菜单中遇到问题。如果您收缩浏览器并单击菜单图像。它没有井然有序。请选中此检查链接。http://vkacademy.in/res/我需要使用什么属性。在mobile.css文件中,我使用了common类。我想知道什么是属性,我需要在common类中使用其他属性来正确显示菜单。我知道仅使用pixel。请以像素为单位给我答案。

<script src="js/jquery-1.7.2.min.js"></script>
<script>
$(document).ready(function(e) {
    $('#mob_btn').click(function(e) {
        $('.common').slideToggle(1000);
    });
});
</script>

<body>
<div id="wrapper">
<div id="logo"><img src="image/logo.png"  border="0" width="357" height="107"/></div><!--endoflogo-->
<div id="logo1"><a href="#">join as tutor or Institutue</a></div><!--endoflogo1-->
<div class="menu_btn"><img id="mob_btn" src="image/menu.png"/></div>
<div id="menu">
<div class="common"><a href="#">About us</a></div>
<div class="common"><a href="#">Department</a></div>
<div class="common"><a href="#">Facilities</a></div>
<div class="common"><a href="#">library</a></div>
<div class="common"><a href="#">Event</a></div>
</div><!--endofmenu-->
</div><!--endofwrapper-->
    my default.css
    body
    {
    margin:auto;
    background-color:#CCCCCC;
    background-repeat:repeat;
    }
    #wrapper
    {
    width:1000px;
    height:auto;
    margin:auto;
    }

    #logo
    {
    width:500px;
    height:100px;
    float:left;
    }
    #logo1
    {
    width:400px;
    height:80px;
    float:left;
    padding-left:50px;
    padding-right:50px;
    background-color:#FF00FF;
    }

    #menu
    {
    width:1000px;
    height:45px;
    float:left;
    }

    .common
    {
    width:200px;
    height:42px;
    padding-top:8px;
    float:left;
    background-color:#FFFFFF;
    background-repeat:no-repeat;
    text-align:center;
    }

    #content
    {
    width:1000px;
    height:auto;
    float:left;
    }
    .menu_btn 
    {
        display: none;
    }

   **In mobile.css**
    @media only screen and (max-width:530px)
    {
    #wrapper
    {
    width:260px;
    background-repeat:repeat;

    }

    #logo
    {
    width:260px;
    text-align:center;
    background-color:#FFFF00;
    }

    #logo img
    {
    width:260px;
    text-align:center;
    }

    #logo1
    {
    width:160px;
    padding-left:50px;
    padding-right:50px;
    height:auto;    
    }

    .menu_btn
    {
    width:260px;
    height:48px;
    display:block;
    text-align:right;
    border-bottom:1px solid #CCCCCC;
    }

    .common
    {
    width:260px;
    display:none;

    }

    .common
    {
    width:260px;
    border-bottom:1px solid #CCCCCC;
    }
    }
Shreyo gi

如@ jorge9200所述,您首先需要了解媒体查询。这是一个易于理解的链接

基本/更快,例如:

/* Mobile first queries */

/* Larger than mobile */
@media (min-width: 400px) { your own CSS for this particular screen size }

/* Larger than phablet */
@media (min-width: 550px) {your own CSS for this particular screen size}

/* Larger than tablet */
@media (min-width: 750px) {your own CSS for this particular screen size}

/* Larger than desktop */
@media (min-width: 1000px) {your own CSS for this particular screen size}

/* Larger than Desktop HD */
@media (min-width: 1200px) {your own CSS for this particular screen size}

上面的媒体查询是针对主要屏幕尺寸预先定义的。您可以使用它们并为每个类和ID编写CSS,也可以使用响应式CSS框架(例如Twitter Bootstrap)来加快开发速度。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

尝试制作响应式菜单,但在 ::before 和 ::after 中遇到问题

来自分类Dev

我在Jquery标签菜单中遇到问题

来自分类Dev

我在响应本机中映射数据时遇到问题

来自分类Dev

我在CSS中遇到问题,无法在菜单栏中顺利移动?

来自分类Dev

我遇到问题的 sql 中的分组

来自分类Dev

在菜单选项卡中遇到问题。我正在使用 carbonKit 框架

来自分类Dev

我在使用Node JS在浏览器中显示HTML响应数据时遇到问题

来自分类Dev

我的CircularList遇到问题

来自分类Dev

响应式菜单问题

来自分类Dev

我在magento的收音机验证中遇到问题

来自分类Dev

我在图像视图的设计中遇到问题

来自分类Dev

我在视图中的Django注册中遇到问题

来自分类Dev

我在npm install express --save中遇到问题

来自分类Dev

我在OpenGL中显示图像时遇到问题

来自分类Dev

我在Laravel的Restful API中遇到问题

来自分类Dev

我在Django搜索功能中遇到问题

来自分类Dev

我在Discord.js中遇到问题

来自分类Dev

我在将引号放在引号中时遇到问题

来自分类Dev

我在与元组有关的python中遇到问题

来自分类Dev

我在Android Studio中运行抖动时遇到问题

来自分类Dev

我在magento的收音机验证中遇到问题

来自分类Dev

我在分页列表和高级搜索中遇到问题

来自分类Dev

我在 TD 中拖动 div 时遇到问题

来自分类Dev

我在 Angular 中创建模块时遇到问题

来自分类Dev

我在 Python 中循环上传文件时遇到问题?

来自分类Dev

在 Python 中浏览我的循环时遇到问题

来自分类Dev

我在使用jQuery显示和隐藏下拉菜单时遇到问题

来自分类Dev

Firestore查询在获取我需要在本机上进行响应的数据时遇到问题

来自分类Dev

路由问题,在 Laravel 中遇到问题

Related 相关文章

热门标签

归档