图片轮播(bootstrap)与 圆角搜索框(纯css)
2015-12-03 11:31
489 查看
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>图片轮播+底部居中搜索框</title> <link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"> <link href="//cdn.bootcss.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet"> <script src="//cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script> <script src="/mobile/addon/jquery.mmenu.min.all.js"></script> <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <style type="text/css"> *{ margin:0px; padding:0px; } #carousel-example-generic{ width:680px; height:480px; } #search{ position:relative; width:680px; <!--可以设置为100%,以适应窗口变化,始终居中对齐--> height:24px; } #search-wrap{ position:absolute; margin-top:-10px; <!--达到覆盖图片轮播底部的作用--> left:50%; <!--这部分是搜索框居中显示的关键。--> margin-left:-130px; width:260px; height:36px; border-radius:18px; box-shadow: 0 0 3px rgba(0,0,0,.14); background-color:#FFF; } #search-wrap .search-content{ box-shadow: none; border:0 none; font-family: "Hiragino Sans GB","Microsoft YaHei","WenQuanYi Micro Hei",Arial,Helvetica,sans-serif; margin-top:3px; margin-left:18px; width:190px; height:30px; } #search-wrap .search-btn{ border:0px; float:right; margin:4px 4px 4px 0; width:46px; height:28px; border-radius:14px; background-color:#2980b9; color:#FFF; text-align:center; line-height:28px; } } </style> </head> <body> <div class="content"> <!-- bootstrap 轮播--> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> <!-- Wrapper for slides --> <div class="carousel-inner" role="listbox"> <div class="item active"> <img src="/mobile/img/jordan1.png" alt="first"> <!--自行添加图片 --> <div class="carousel-caption"> <h1> Micheal Jordan</h1> </div> </div> <div class="item"> <img src="/mobile/img/jordan2.png" alt="second"> <!--自行添加图片 --> <div class="carousel-caption"> <h1> Micheal Jordan</h1> </div> </div> <div class="item"> <img src="/mobile/img/jordan3.png" alt="third"> <!--自行添加图片 --> <div class="carousel-caption"> <h1>Micheal Jordan</h1> </div> </div> </div> <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> <!-- 搜索框 --> <div id="search"> <div id="search-wrap"> <input class="search-content" type="text" placeholder="输入搜索内容" name="word"> <button class="search-btn" type="submit">搜索</button> </div> </div> </div> <!-- content end --> </body> </html>
相关文章推荐
- bootstrap基础
- 10款免费Bootstrap后台模板演示及下载
- BOOTSTRAP ---- 重要部分
- HTML与BootStrap基本结构示例
- 页面遮罩层,并且阻止页面body滚动。bootstrap模态框原理
- Bootstrap导航条
- 全面解析Bootstrap图片轮播效果
- bootstrap提供了六种列表效果
- bootstrap提供了六种列表效果
- 全面解析Bootstrap图片轮播效果
- Bootstrap历练实例:响应式导航
- Bootstrap Carousel
- Bootstrap3 - Using glyphicon as background image in CSS
- bootstrap快速链接
- 解决bootstrap中轮播插件支持手机上的手势滑动的问题
- Bootstrap_排版
- debootstrap 配置
- Bootstrap的Modal源码学习
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- Bootstrap导航条navbar