好吧,我正在關注一個關於製作簡單投資組合網站的樹屋教程。他們有照片應該排列在網格中。我正在使用視頻,但我試圖切換圖片,這沒有什麼區別。我的照片全部仍然位於左側的一列,然後右側的照片應該位於右側。我會想象我錯過了某種結束標記或某種東西,但我找不到它。你介意看看它嗎?謝謝。爲什麼照片排列而不是網格(HTML + CSS)?
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Carter Goff | Portfolio</title>
<link rel="stylesheet" href="css/normalize.css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700|Oswald:300,400,700' rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<a href="index.html" id = "logo">
<h1>Carter Goff</h1>
<h2>Choreographer</h2>
</a>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="portfolio.html" class="selected">Portfolio</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
<div id="wrapper">
<section>
<ul id = "gallery">
<li>
<a href="vid/vid1.mp4">
<video controls>
<source src="vid/vid1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</a>
<a href="vid/vid1.mp4">
<video controls>
<source src="vid/vid1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</a>
</li>
</ul>
</section>
<footer>
<a href="http://instagram.com/cartergoffofficial"><img src="img/instagram.png" alt="Instagram Logo"></a>
<a href="https://www.facebook.com/carter.goff.52"><img src="img/facebook.png" alt ="Facebook Logo"></a>
<p>© 2016 Carter Goff</p>
</footer>
</div>
</body>
</html>
和CSS:
/************************
GENERAL
*************************/
body {
font-family: 'Open Sans Condensed', sans-serif;
}
#wrapper {
max-width: 940px;
margin: 0 auto;
padding: 0 5%;
}
a {
text-decoration: none;
}
video{
max-width: 100%;
}
/************************
HEADING
************************/
#logo {
text-align: center;
margin: 0;
}
h1 {
font-family: 'Oswald', sans-serif;
margin: 15px 0;
font-size: 2em;
font-weight: normal;
line-height: 0.8em;
}
h2 {
font-size: 0.75em;
margin: -5px 0 0;
font-weight: normal;
}
/************************
NAVIGATION
************************/
nav {
text-align: center;
padding: 10px 0;
margin: 20px 0 0;
}
/************************
FOOTER
************************/
footer {
font-size: 0.75em;
text-align: center;
clear: both;
padding-top: 50px;
color: #ccc;
}
/************************
PAGE: PORTFOLIO
************************/
#gallery {
margin: 0;
padding: 0;
list-style: none;
}
#gallery li {
float: left;
width: 45%;
margin: 2.5%;
background-color: #f5f5f5;
color: #bdc3c7;
}
#gallery li a p {
margin: 0;
padding: 5%;
font-size: 0.75em;
color: #bdc3c7
}
/************************
COLORS
************************/
/* site body */
body{
background-color: #fff;
color: #b3b3b3;
}
/* pink header */
header{
border-color: #ffb3ff;
background: #000000;
}
/* nav background on mobile */
nav{
background: #ffb3ff;
}
/* logo text */
h1, h2 {
color: #fff;
}
/* links */
a {
color: #00ffb3;
}
/* nav links */
nav a, nav a:visited {
color: #000;
}
/* selected nav link */
nav a.selected, nav a:hover {
color: #b300b3
}
需要跟蹤您的問題的演示 – kollein