【发布时间】:2015-09-22 15:41:05
【问题描述】:
我必须使用 css 来改变位置;唯一似乎起作用的是正确的位置导航栏和液体布局,但“内容”和“右导航栏”的位置不正确。 我希望内容位于中间,左侧导航位于左侧,右侧导航位于右侧。
<title>CSS liquid layout</title>
<style type="text/css">
.due {
color: #ff0000;
font-weight: bold;
}
#leftnavigation{
position:absolute;
left:10px;
top:10px;
width:250px;
}
#rightnavigation {
float:right;
width:250px;
height:800px;
}
#content {
float:center;
}
</style>
</head>
<body leftmargin="0" topmargin="0" bgcolor="#ccff99">
<div id="app">
<div id="rightnavigation">
<h1>Right Navigation</h1>
<a href="http://www,google.com">link</a> <a href="http://www,google.com">Instructor</a>
<a href="http://www,google.com">Course</a> <a href="http://www,google.com">
Resume
project
</a>
</div>
<div id="content">
<h1>Sample Content</h1>
<p>
This is the content section of the page. Use structural markup
like <p></p>
to keep the page valid in XHTML.
</p>
<h2>Lorem Ipsum</h2>
</div>
<div id="leftnavigation">
<h1>Left Navigation</h1>
<p>
<a href="http://www,google.com">Page 1</a> <a href="http://www,google.com">Page 2</a> <a href="http://www,google.com">
Page
3
</a> <a href="http://www,google.com">Page 4</a> <a href="http://www,google.com">Page 5</a> <br />
Lorem ipsum sit dolor amum. Lorem ipsum sit dolor amum. Lorem ipsum sit dolor
amum.
</p>
<h2>Lorem Ipsum</h2>
</div>
</div>
【问题讨论】:
-
你需要先清理你的 HTML - 那里有很多未关闭(甚至未打开)的标签。我可以猜测您的意图,但是对于代码的当前状态来说这有点困难。请清理 HTML 并重新发布
-
同意 - 我已为您将其放入堆栈 sn-p。请确保您在此处发布的代码是一个最小的示例,可以清楚地展示您遇到的问题。这将使我们更容易提供帮助。你不需要包含
<html>或<head>标签,或者任何进入头部的东西。所以我删除了这些东西。但我会提到头部内的元标记无效(缺少大于符号的结束符)。 -
好的,我会清理代码
标签: html css panel navigationbar