【发布时间】:2015-11-22 10:01:51
【问题描述】:
有一个离子框架,用左右两个按钮制作标题标题太容易了,而且它是响应式的。换句话说,标题标题总是在页面中间。
这是他们如何实现的代码..这是我的 plunker http://plnkr.co/edit/BqtvCYYfhhbokzbbOXU4?p=preview
<ion-header-bar align-title="center" class="bar-positive">
<div class="buttons">
<button class="button" ng-click="doSomething()">Left Button</button>
</div>
<h1 class="title">Title!</h1>
<div class="buttons">
<button class="button">Right Button</button>
</div>
</ion-header-bar>
但是我只需要使用 HTML5 和 css3 或 css 来实现同样的事情,但我无法左右设置按钮位置。如何设置左右按钮位置。
这是我的代码 http://plnkr.co/edit/OGr7px9jueIfDTsHhePA?p=preview
<body>
<div style="" class="header">
<button style="position:absolute;left:5px">left</button>
<h2 style="margin:0px;padding-top:10px;color:white">Title !</h2>
<button style="position:absolute;right:5px">right</button>
</div>
</body>
css
.header{
background:blue;
height:44px;
text-align:center;
position:relative;
}
【问题讨论】:
标签: javascript jquery html css