html - 无法在标题左侧对齐我的菜单按钮

标签 html css sass ionic2

我提到了我的 button按照上面的链接对齐左右 startend 键。但是我无法按照链接中的 View 设置我的按钮,这里是我的输出图像

enter image description here

这是我的代码

<ion-header class="home">
  <ion-navbar primary padding>
    <ion-row> 
      <ion-buttons start>
      <button menuToggle >
        <ion-icon name="menu"></ion-icon>
        
      </button>
      </ion-buttons>
        
      <ion-title>Auto Parts</ion-title>
        
      <ion-buttons end>
            <button> <ion-icon name="document"></ion-icon></button>&nbsp;&nbsp;&nbsp;
            <button><ion-icon name="heart"></ion-icon></button>&nbsp;&nbsp;&nbsp;
            <button><ion-icon name="cart"></ion-icon></button>
      </ion-buttons>
    </ion-row>
    
    <ion-row>
      <ion-searchbar (ionInput)="getItems($event)"></ion-searchbar>
    </ion-row>

  </ion-navbar>

</ion-header>

到目前为止我尝试过的是:

float: right; and float: left;

algin: right

但无法让我的按钮向左

最佳答案

您可以使用 <ion-toolbar> 实现该布局像在 this plunker 中看到的那样放置搜索栏

<ion-header class="home">
  <ion-navbar primary padding>
      <button menuToggle>
        <ion-icon name="menu"></ion-icon>
      </button>
      <ion-title>Auto Parts</ion-title>
      <ion-buttons end>
            <button> <ion-icon name="document"></ion-icon></button>&nbsp;&nbsp;&nbsp;
            <button><ion-icon name="heart"></ion-icon></button>&nbsp;&nbsp;&nbsp;
            <button><ion-icon name="cart"></ion-icon></button>
      </ion-buttons>
  </ion-navbar>
  <ion-toolbar primary>
      <ion-searchbar (ionInput)="getItems($event)"></ion-searchbar>
  </ion-toolbar>
</ion-header>

编辑:

To hide both borders, the no-border attribute should be used on the ion-toolbar. To hide the top or bottom border, the no-border-top and no-border-bottom attribute should be used.

关于html - 无法在标题左侧对齐我的菜单按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38962774/

相关文章:

html - 使用 vuejs 根据各自的主页显示隐藏标题

javascript - 如何仅在浏览器中禁用 cookie 时显示消息?

css - 如何在 Eclipse 中集成 CSS 预处理?

css - Angular 组件的 Sass 结构

sass - 我可以在 SASS 中使用&符号来引用父类的特定标签吗?

javascript - 使用 JavaScript 将按钮按下情况传达给另一个页面?

javascript - 选择日历日期并更新链接标签

javascript - 禁用和启用带有计数器和过渡效果的点击事件

html - html 元素后的黑色背景颜色

css - 允许使用 ui-icon 背景