求教栅格中图片垂直居中问题
想让下图中的图片垂直居中,大牛们指导指导
源代码如下
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! --> <title>Bootstrap 101 Template</title> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <a name="aboutlessons"></a> <div class="content-section-a"> <div class="container"> <div class="row"> <div class="col-lg-5 col-sm-6"> <hr class="section-heading-spacer"> <div class="clearfix"></div> <h2 class="section-heading">标题1</h2> <h3>标题2</h3> <h4><span class="glyphicon glyphicon-hand-right"></span> 标题3</h4> <p class="lead">像 CSS 栅格系统原理这类东西本应该藏在帘子后面,你直接用就可以了,没必要去了解其背后的工作原理,除非你有了比较烂的设计或者一些比较复杂的东西。</p> <h4><span class="glyphicon glyphicon-hand-right"></span> 标题3</h4> <p class="lead">像 CSS 栅格系统原理这类东西本应该藏在帘子后面,你直接用就可以了,没必要去了解其背后的工作原理,除非你有了比较烂的设计或者一些比较复杂的东西</p> <h4><span class="glyphicon glyphicon-hand-right"></span> 标题3</h4> <p class="lead">像 CSS 栅格系统原理这类东西本应该藏在帘子后面,你直接用就可以了,没必要去了解其背后的工作原理,除非你有了比较烂的设计或者一些比较复杂的东西</p> </div> <div class="col-lg-5 col-lg-offset-1 col-sm-6"> <img class="img-responsive center-block" src="./pics/7.jpg" alt=""> </div> </div> </div> <!-- /.container --> </div> <!-- /.content-section-a --> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="js/bootstrap.min.js"></script> </body> </html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
右侧div没写高度 不能垂直居中吧