我希望我<div id="container">
位于导航菜单的右侧,但我遇到了问题。
任何人都可以帮我解决这个问题。
索引.php
<!-- This is the page identifier. Change on each of your pages! -->
<?php $page ='page_index'; ?>
<!doctype html>
<head>
<meta charset="UTF-8">
<title>Index</title>
<meta name="description" content="Example of PHP include active navigation">
<link rel="stylesheet" href="style.css">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="container">
<header>
<h1>Index page</h1>
</header>
<!-- This is where we want to include the nav.php file! -->
<?php include("nav.php"); ?>
<div id="main" role="main">
<p>This is the index page</p>
</div>
<footer>
<p>This is the footer</p>
</footer>
</div>
</body>
</html>
导航.php
<nav role="navigation" id="<?php echo $page ?>">
<ul>
<li><a class="index" href="index.php">Home</a></li>
<li><a class="about" href="about.php">About</a></li>
<li><a class="contact" href="contact.php">Contact</a></li>
</ul>
</nav>
样式.css
nav ul {
list-style: none;
display:inline-block;
float:left;
}
ul a {
color:green;
}
nav#page_index ul li a.index,
nav#page_about ul li a.about,
nav#page_contact ul li a.contact {
color:red;
}
这是我添加到style.css
div.container
{
float:left;
}
请让我知道如何使用一些好看的格式制作左侧导航菜单。
提前致谢..!