您好我正在尝试修改此bootstrap snippet,以便它看起来像我的图片,其中B,C,D,E的大小都相同,A稍大一点。我试图将此用于我网站上的个人资料部分(这解释了图片的内部框)。
但是,我对网格系统有很多麻烦。插入图像时文本不对齐或者框不会并排。这是我的傻瓜:
https://jsfiddle.net/nv7rsgpg/8/
任何人都可以帮帮我!?或者可能将我引导到另一个比手工操作更容易的框架?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Stylish Portfolio - Start Bootstrap Theme</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Custom CSS -->
<link href="http://ironsummitmedia.github.io/startbootstrap-stylish-portfolio/css/stylish-portfolio.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="http://ironsummitmedia.github.io/startbootstrap-stylish-portfolio/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js 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="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
body{padding-top:30px;}
.glyphicon { margin-bottom: 10px;margin-right: 10px;}
small {
display: block;
line-height: 1.428571429;
color: #999;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-8">
<div class="well well-sm">
<div class="row">
<div class="col-sm-6 col-md-4">
<img src="" alt="" class="img-rounded img-responsive" />
</div>
<div class="col-sm-6 col-md-8">
<h4>
Person</h4>
<small><cite title="San Francisco, USA">USA <i class="glyphicon glyphicon-map-marker">
</i></cite></small>
<p>
<i class="glyphicon glyphicon-envelope"></i>email@example.com
<br />
<i class="glyphicon glyphicon-globe"></i><a href="http://www.jquery2dotnet.com">www.jquery2dotnet.com</a>
<br />
<i class="glyphicon glyphicon-gift"></i>June 02, 1988</p>
<!-- Split button -->
<div class="btn-group">
<button type="button" class="btn btn-primary">
Social</button>
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span><span class="sr-only">Social</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Twitter</a></li>
<li><a href="https://plus.google.com/+Jquery2dotnet/posts">Google +</a></li>
<li><a href="https://www.facebook.com/jquery2dotnet">Facebook</a></li>
<li class="divider"></li>
<li><a href="#">Github</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="well well-sm">
<div class="row">
<div class="col-sm-6 col-md-4">
<img src="http://placehold.it/380x500" alt="" class="img-rounded img-responsive" />
</div>
<div class="col-sm-6 col-md-8">
<h4>
Bhaumik Patel</h4>
<small><cite title="San Francisco, USA">San Francisco, USA <i class="glyphicon glyphicon-map-marker">
</i></cite></small>
<p>
<i class="glyphicon glyphicon-envelope"></i>email@example.com
<br />
<i class="glyphicon glyphicon-globe"></i><a href="http://www.jquery2dotnet.com">www.jquery2dotnet.com</a>
<br />
<i class="glyphicon glyphicon-gift"></i>June 02, 1988</p>
<!-- Split button -->
<div class="btn-group">
<button type="button" class="btn btn-primary">
Social</button>
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span><span class="sr-only">Social</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Twitter</a></li>
<li><a href="https://plus.google.com/+Jquery2dotnet/posts">Google +</a></li>
<li><a href="https://www.facebook.com/jquery2dotnet">Facebook</a></li>
<li class="divider"></li>
<li><a href="#">Github</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- jQuery -->
<!-- Bootstrap Core JavaScript -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- Custom Theme JavaScript -->
<script>
// Closes the sidebar menu
$("#menu-close").click(function(e) {
e.preventDefault();
$("#sidebar-wrapper").toggleClass("active");
});
// Opens the sidebar menu
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#sidebar-wrapper").toggleClass("active");
});
// Scrolls to the selected menu item on the page
$(function() {
$('a[href*=#]:not([href=#]):not([href=#myCarousel])').click(function() {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>
</body>
</html>
答案 0 :(得分:0)
您好,我已根据您的图片设置了网格布局的 Fiddle 。
看看你是否可以在这里使用此代码并将其作为一个很好的起点。
如果使用下面的摘录视图或查看小提琴,则需要在完整视图中查看此内容。
它将堆叠在小屏幕尺寸。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Starter Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<style>
body {
padding-top: 50px;
background-color: darkcyan;
}
.block {
height: 300px;
margin-top: 2%;
}
.inner-block {
height: 280px;
margin-top: 10px;
}
.bg-orange {
background-color: orangered;
}
.space{
margin-top: 2%;
margin-bottom: 2%;
}
</style>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top ">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand " href="#">Project name</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container col-lg-12"><br><br></div>
<div class="container col-lg-12">
<div class="col-xs-12 col-sm-7 bg-orange block">
<div class="row-fluid col-xs-4 col-sm-3 bg-primary inner-block">
</div>
</div>
<div class="col-xs-12 col-sm-4 col-sm-offset-1 bg-orange block">
<div class="row-fluid col-xs-4 col-sm-3 bg-primary inner-block">
</div>
</div>
<div class="container col-lg-12 space"></div>
<div class="col-xs-12 col-sm-3 bg-orange block">
<div class="row-fluid col-xs-4 col-sm-3 bg-primary inner-block">
</div>
</div>
<div class="col-xs-12 col-sm-4 col-sm-offset-1 bg-orange block">
<div class="row-fluid col-xs-4 col-sm-3 bg-primary inner-block">
</div>
</div>
<div class="col-xs-12 col-sm-3 col-sm-offset-1 bg-orange block">
<div class="row-fluid col-xs-4 col-sm-3 bg-primary inner-block">
</div>
</div>
</div><!-- /.container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
</html>
&#13;