CSS Ride SideBar 需要保持在顶部
我的右侧栏没有保持在顶部。
例如,这是两个页面。 www.cafecartel.com
和 www.cafecartel.com.index2.php
目前网站的编写方式,右侧栏必须这样放置:
body id="Support" div id =“容器1” div id =“容器2”
div id="header"
?php include("inc/header.inc"); ?
h1 Point of Sale for Restaurants, POS Retail and Inventory by Cafe Cartel/h1
/div
div id =“包装” div id="content"
div id="sidebar"
?php include("inc/sidebar_justafew.inc"); ?
?php include("inc/sidebar_whouses.inc"); ?
/div
div id="maincontent"
我想要的是能够将侧边栏放置在主要内容下方。 对于搜索引擎优化。
这是侧边栏的 CSS:
sidebar {
float: right;
position: relative;
left: 178px;
width: 166px;
padding-top: 5px;
margin-left: -165px;
margin-bottom: 50px;
line-height: 1.4em;
voice-family: "\"}\"";
voice-family: inherit;
width: 165px;
}
感谢所有帮助。 谢谢
My right side bar isn't staying on top.
These are the two pages for example. www.cafecartel.com
and www.cafecartel.com.index2.php
Currently the way the site is written, the right side bar must be placed like this:
body id="Support"
div id="container1"
div id="container2"
div id="header"
?php include("inc/header.inc"); ?
h1 Point of Sale for Restaurants, POS Retail and Inventory by Cafe Cartel/h1
/div
div id="wrapper"
div id="content"
div id="sidebar"
?php include("inc/sidebar_justafew.inc"); ?
?php include("inc/sidebar_whouses.inc"); ?
/div
div id="maincontent"
What i want is to be able place the Sidebar Beneath the Main Content. For SEO.
This is the CSS for the side bar:
sidebar {
float: right;
position: relative;
left: 178px;
width: 166px;
padding-top: 5px;
margin-left: -165px;
margin-bottom: 50px;
line-height: 1.4em;
voice-family: "\"}\"";
voice-family: inherit;
width: 165px;
}
All help is appreciated. Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
cc_layout.css line: 63
@Carl,两个页面(新旧)之间的区别在于,与上面(旧)相比,他将侧边栏 HTML 放置在主内容(新)下方。
cc_layout.css line: 63
@Carl, the difference between the two pages (old and new) is that he has placed the sidebar HTML below the maincontent (new) compared to above (old).
我无法完全理解这个问题,所以如果我误解了,我提前道歉,但是要让侧边栏出现在内容旁边并让内容显示在 HTML 中的侧边栏上方,您可以将 #maincontent div 向左浮动,然后将#sidebar div 右侧。
#content { 明确:两者; }
#maincontent { float: left; }
#sidebar { float: right; 。
之后您还需要清除浮动,因此我在内容 div 上添加了clear:both
希望有帮助!
I'm having trouble fully understanding the question, so my apologies in advance if I misunderstood, but to have the sidebar appear next to the content and have content appear above the sidebar in HTML, you could float the #maincontent div left, and the #sidebar div right.
#content { clear: both; }
#maincontent { float: left; }
#sidebar { float: right; }
You'll need to clear the floats after, too, so I added the clear: both on the content div.
Hope that helps!