这是我的代码。我试图将class= Timeline
设置为Image中显示的位置。但是当我尝试这样做时,网页会在页面上添加额外的填充。填充量减少并随着此CSS代码的左边距增加:
.Timeline{
background-color: #EDEFF0;
border: 1px solid #D5D5D5;
height: auto;
margin-top: -130px;
margin-left: 360px;
margin-right: 14px;
}
有人有任何建议以不同的方式做这项工作吗?
或者有人知道如何解决这个问题?
overflow:hidden
HTML
<!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"><!-- Set the page width to the size of device and set the zoom level to 1-->
<!--<link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">-->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="styles.css">
<title></title>
</head>
<body>
<nav class="navbar navbar-default" role="navigation" style="border-radius:0px; margin-bottom: 0px;">
<div class="container-flued">
<a href="#" class="navbar-brand">SUH</a>
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search" style="background-image: url('12-3-2016 5-51-30 PM.jpg');">
</div>
</form>
<div class="collegeLogo">
<img src="https://sites.google.com/a/su.edu.krd/ahmed-alemdar/_/rsrc/1466038685850/home/unnamed.png" width="50px" height="50px"
style="position: absolute; margin-left: auto; margin-right: auto; left: 0; right: 0;">
</div>
<div class="navbar-header navbar-right" style="margin-right: 5px; margin-top: 6px;">
<ul class="nav navbar-nav" id="listDesign">
<li>
<div class="dropdown" >
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="glyphicon glyphicon-menu-down"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="#">Join class</a></li>
<li><a href="#">Create class</a></li>
</ul>
</div>
</li>
<li> <img src="https://scontent-fra3-1.xx.fbcdn.net/v/t1.0-9/11012973_971156699562295_5438409568173214004_n.jpg?oh=a165d22821b9a46f59fb95fa4f65d21f&oe=58AE701F" width="34px" height="34px" style="border: 2px; border-radius: 5px 0px 0px 5px; border: 1px solid #D5D5D5;">
</li>
<li style="margin-left: 0px;">
<div class="dropdown" >
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="border-radius: 0px 5px 5px 0px;">
Siver Louis
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li style="text-align: center;"> Member name </li>
<li role="separator" class="divider"></li>
<li><a href="#">Profile</a></li>
<li><a href="#">Messages</a></li>
<li><a href="#">Settings</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Classes</a></li>
<li><a href="#">Work</a></li>
<li><a href="#">Calendar</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Log Out</a></li>
</ul>
</div>
</li>
<li>
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="glyphicon glyphicon-bell"></span>
</button>
</li>
</ul>
</div>
</div>
</nav>
<div class="row">
<div class="col-lg-3" style="">
<div class="profile">
<div class="image">
<img src="https://lh6.googleusercontent.com/-K_p8F3QRyQ8/AAAAAAAAAAI/AAAAAAAAADo/w90iWVvnEPw/photo.jpg" class="img-thumbnail img-profile">
</div>
<div class="member-name">
<h2>Shareef Maulod Shareef</h2>
</div>
<hr/>
<div class="info">
<h3>Scientific Title: <span style="font-size: 14px; font-weight: normal">Senior Lecturer </span></h3>
<h3>Email: <span style="font-size: 14px; font-weight: normal">shareef.shareef@su.edu.krd </span></h3>
</div>
</div>
</div>
<div class="col-lg-9" style="">
<div class="cover">
<img src="http://files.wallpapersfine.com/cool/ko_tapu_james_bond_island.jpg" class="img-cover">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-2 col-lg-offset-1" style="background-color: white; height: auto; margin-top: 10px;">
<div class="postOptions">
<div class="list-group"><!--active mazdla batr list-group-item active -->
<li><a href="#" class="list-group-item"><span class="glyphicon glyphicon-bullhorn"></span>Announcement</a></li>
<li><a href="#" class="list-group-item"><span class="glyphicon glyphicon-list-alt"></span>Assignment</a></li>
<li><a href="#" class="list-group-item"><span class="glyphicon glyphicon-question-sign"></span>Question</a></li>
<li><a href="#" class="list-group-item"><span class="glyphicon glyphicon-share"><!-- glyphicon glyphicon-repeat --></span>Reuse post</a></li>
</div>
</div>
</div>
<div class="col-lg-9">
<div class="streamHead" >
<div class="panel-heading">
<ul class="nav nav-tabs faq-cat-tabs">
<li class="active"><a href="#faq-cat-1" data-toggle="tab"><i class="glyphicon glyphicon-user"></i>Stream</a></li>
<li><a href="#faq-cat-2" data-toggle="tab"><i class="glyphicon glyphicon-plus"></i>Class members</a></li>
<li><a href="#faq-cat-2" data-toggle="tab"><i class="glyphicon glyphicon-delete"></i>About</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="Timeline">
<div class="container">
<div class="welcome" >
<h2>Welcome to your class stream</h2>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
CSS
#listDesign li{
margin-left: 10px;
}
body{
/*font-family: 'Roboto', sans-serif;
background-color: #EDEFF0;*/
}
.profile, .cover{
max-width: 100%;
width: 100%;
max-height: 300px;
height: 300px;
background: #FFF;
border: 1px solid #D5D5D5;
border-radius: 5px;
}
.img-profile:hover, .img-cover:hover{
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
cursor: pointer;
}
.image, .member-name{
text-align: center;
}
.img-profile{
border-radius: 50%;
height:150px;
width:150px;
margin-top: 5px;
}
hr{
border-radius:3px;
margin-right: 15px;
margin-left: 15px;
}
.member-name h2{
font-size: 16px;
text-align: center;
font-weight: bold;
margin-top: 12px;
}
.info h3{
font-weight: bold;
margin-left: 15px;
margin-top: 0px;
width: auto;
max-width: 286px;
font-size: 14px;
line-height: 1.42857143;
color: #333;
}
.img-cover{
width: 100%;
height: 300px;
border-radius: 5px 0px 0px 5px;
}
.postOptions li{
list-style: none;
}
.postOptions .list-group-item{
text-align: center;
}
.postOptions span{
float: left;
}
/*Timeline*/
.Timeline{
background-color: #EDEFF0;
border: 1px solid #D5D5D5;
height: auto;
margin-top: -130px;
margin-left: 360px;
margin-right: 14px;
}
.welcome h2{
font-weight: bold;
}