我正在构建我的第一个网站来学习HTML / CSS / jQuery(它在我的Raspberry Pi上托管)。我现在有两个问题:在jumbotron / news容器右边有一条HTML条带(为了让它可以看到,我将所有HTML设为蓝色)。此外,我正试图获得"你好世界" h3要紧贴在h2下方。我正在使用占位符文本,而我想出了一切。我应该编辑哪些CSS属性来执行此操作?您可以访问Ericscode.com网站。
HTML:
<!doctype html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Orbitron:400,700|Droid+Sans:400,700|Pacifico' rel='stylesheet' type='text/css'>
<!-- CSS from Bootstrap's website -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- End Bootstrap head -->
<!-- My personal CSS -->
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="nav">
<div class="container">
<div class="logo">
<div class="pull-left">
<a href="index.html">Erics Code</a>
</div>
</div>
<div class="pull-right">
<ul padding-top: 50px;>
<li><a href="#">About Me</a></li>
<li>|</li>
<li><a href="#">My Projects</a></li>
<li>|<li>
<li><a href="#">Contact Me</a> </li>
</ul>
</div>
</div>
</div>
<div class="jumbotron">
<div class="container">
<h1>My Projects and Portfolio</h1>
<p>I do internet things</p>
</div>
</div>
<div class="news">
<div class="container">
<h1>News & Updates</h1>
<h2>New Personal Website</h2>
<h3>Hello World</h3>
<p>This is the first iteration of the website. Expect constant changes and unfinished scripts.</p>
</div>
</div>
<div class="footer">
<div class="row">
<div class="col-md-12 text-center">
<div class="container">
<p>Erics Code, personal Internet workspace</p>
<p>Hosted on Raspberry Pi</p>
<p>~ <a href="contact_me.html">Contact Me</a> ~</P>
</div>
</div>
</div>
</div>
</body>
CSS:
html {
background-color: blue;
}
.nav {
background-color: #5a5a5a;
height: 70px;
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;
}
.nav li{
display: inline-block;
padding: 14px 10px;
text-transform: lowercase;
font-weight: normal;
font-size: 18px;
padding-top: 40px;
padding-left: 0px;
font-family: 'Droid Sans';
color: white;
}
.nav a {
color: white;
-o-transition:.5s;
-ms-transition:.5s;
-moz-transition:.5s;
-webkit-transition:.5s;
/* ...and now for the proper property */
transition:.5s;
}
.nav a:hover {
color: #ed8200;
text-decoration: none;
}
.jumbotron {
background-image: url('http://ericscode.com/images/banner1.png');
height: 500px;
background-size: cover;
background-repeat: no-repeat;
padding-top: 75px;
font-family: 'Droid Sans';
text-align: center;
}
.jumbotron .container {
position: relative;
top: 100px;
}
.jumbotron h1 {
color: #ed8200;
font-weight: bold;
}
.jumbotron p {
color: white;
padding-top: 15px;
font-family: 'Droid Sans'
}
.maincontent {
background-color: purple;
font-family: 'Droid Sans';
}
.logo {
font-family: 'Pacifico', sans-serif;
font-size: 50px;
color: white;
padding-top: 0px;
}
.logo a {
color: white;
}
.news {
height: 500px;
}
.news h1{
font-family: 'Droid Sans';
color: #5a5a5a;
font-weight: bold;
font-size: 50px;
}
.news h2{
color: #5a5a5a;
}
.news h3{
font-family: 'Orbitron';
color: black;
padding-top: 0px;
color: #ed8200;
font-size: 18px;
}
.news p{
font-family: 'Droid Sans';
}
.footer {
background-color: #5a5a5a;
height: 140px;
color: white;
}
.footer a {
color: white;
}
.footer a:hover {
color: #ed8200;
text-decoration: none;
}
.footer .container {
padding-top: 40px;
}
如果你看到我应该改变/改进的其他事情,请告诉我!一旦我有一个正确的网站骨骼设置,我将学习更多的Javascript并使用jQuery实现一些平滑的过渡。