最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Floating toolbar on bottom, centered, 80% of current screen width - Stack Overflow

programmeradmin1浏览0评论

I'm trying to implement a Facebook like toolbar on the bottom of the screen for a website I'm currently working on.

Currently, I have it 100% of the width of the screen but I'd like to have it look almost exactly like Facebook's toolbar, centered, bottom justified on top, around 80% of the current screen's width.

Here is the current CSS for the toolbar I have that is 100% of the screen's width.

Thanks in advance.

CSS:

<style type="text/css">
#toolbar
{
background:url('/_assets/img/toolbar.gif') repeat-x;
height:25px;
position:fixed;
bottom:0px;
width:100%;
left:0px;
border-left:1px solid #000000;
border-right:1px solid #000000;
z-index:100;
font-size:0.8em;
}   
</style>

I'm trying to implement a Facebook like toolbar on the bottom of the screen for a website I'm currently working on.

Currently, I have it 100% of the width of the screen but I'd like to have it look almost exactly like Facebook's toolbar, centered, bottom justified on top, around 80% of the current screen's width.

Here is the current CSS for the toolbar I have that is 100% of the screen's width.

Thanks in advance.

CSS:

<style type="text/css">
#toolbar
{
background:url('/_assets/img/toolbar.gif') repeat-x;
height:25px;
position:fixed;
bottom:0px;
width:100%;
left:0px;
border-left:1px solid #000000;
border-right:1px solid #000000;
z-index:100;
font-size:0.8em;
}   
</style>
Share Improve this question asked Mar 10, 2009 at 12:55 TomTom 4,57717 gold badges63 silver badges93 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

use:

left:10%;
right:10%;
width: 80%;
left: 10%;
right: 10%;

How's that?

css:

#container {
    width: 100%;
}
#toolbar {
    width: 80%;
    height: 40px;
    margin-right: auto;
    margin-left: auto;
}

Html:

<div id="container">
  <div id="toolbar"></div>
</div>

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论