响应式Topbar

时间:2018-05-09 04:23:51

标签: html css templates slider

我有2个导航栏,顶栏和菜单,菜单响应但顶栏不。我如何制作响应式顶栏(图标和图像)?

<div class="header widget-style1 clearfix">
            <div class="container">
                <div class="header-wrap clearfix">
                    <div class="row">
                        <div class="col-lg-4" style="float: right;">
                            <div id="" class="">
                                <a href="/" rel="home">

                                    <img src="{{asset('images/logojipp34.jpg')}}" alt="image">
                                </a>
                            </div>
                            <!-- /. -->
                        </div>

                        <div class="col-lg-8">
                            <div class="page" style="margin-top: 50px"> 
                                <div class="row">
                                    <div class="col-md-4 text-right">
                                        <a href="" class="social-media"><i class="fa fa-instagram fa-2x" style="color: #9D2629"></i></a>
                                    </div>
                                    <div class="col-md-4 text-right">
                                        <a href="" class="social-media"><i class="fa fa-facebook-f fa-2x" style="color: #9D2629"></i></a>
                                    </div>
                                    <div class="col-md-4 text-right">
                                        <a href="" class="social-media"><i class="fa fa-twitter fa-2x" style="color: #9D2629"></i></a>
                                    </div>                                
                                </div>                                    
                            </div>

                        </div>
                    </div>
                </div>
                <!-- /.row -->
            </div>
            <!-- /.header-wrap -->
        </div>

我如何使用它进行响应式设计?

1 个答案:

答案 0 :(得分:0)

为什么不添加像

这样的东西

body {margin:0;}

.topbar {
  overflow: hidden;
  background-color: #333;
  position: fixed;
  top: 0;
  width: 100%;
}

.topbar a {
  float: left;
  display: block;
  color: #f2f2f2;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
}

.topbar a:hover {
  background: #ddd;
  color: black;
}

.main {
  padding: 16px;
  margin-top: 30px;
  height: 1500px; /* Used in this example to enable scrolling */
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>

</style>
</head>
<body>

<div class="topbar">
  <a href="#home">Home</a>
  <a href="#news">News</a>
  <a href="#contact">FAQ</a>

</body>
</html>