如果是,那么检查我的代码。为什么不行? 我只是希望我的第一个容器设计工作 到我的css id #con,但它无法正常工作。 所以
请帮助我.....
#con{
background-color:#960;
}
<!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">
<title>Bootstrap 101 Template</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet" type="text/css">
<body>
<div class="jumbotron">
<div class="container" id="#con" >
hello
</div>
<div class="container">
<div class="col-sm-4"><h1> hello1</h1></div>
<div class="col-sm-8"><h1> hello2</h1></div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
答案 0 :(得分:0)
Just Remove&#34;#&#34;来自你&#34; id&#34;的符号属性..
<!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">
<title>Bootstrap 101 Template</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet" type="text/css">
<body>
<div class="jumbotron">
<div class="container" id="con" >
hello
</div>
<div class="container">
<div class="col-sm-4"><h1> hello1</h1></div>
<div class="col-sm-8"><h1> hello2</h1></div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>