html - 将图标移动到导航标题的右侧

标签 html css ionic-framework header

我想创建一个带有侧边菜单和导航标题中标题的应用程序。在导航标题的右侧,我会放置一个图标。

这是我当前的代码:

<ion-view>
    <ion-nav-title align-title="center">
        <h1 class="title">Title</h1>
        <img src="./img/MyIcon.ico" height="40px" width="auto">
    </ion-nav-title>
  <ion-content>
  ...
  </ion-content>
</ion-view>

此时标题和图标都居中。

有没有办法将图标放在右侧?

最佳答案

您可以从 </icon-nav-title> 中取出图像行(居中),或将图像向右浮动:

<img src="./img/MyIcon.ico" height="40px" width="auto" style="float:right">

您可能还想尝试为此创建一个 CSS。

关于html - 将图标移动到导航标题的右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30849370/

相关文章:

html - CSS显示水平滚动条?

html - 在固定内容中滚动列表

ios - ionic 构建 ios 错误代码 65

html - 内容居中的响应式圆圈

javascript - 使用 loadExternalHTMLPage 在每个页面加载之间随机加载不同的 JavaScript

html - Cordova 调整内容大小

javascript - 使用动态内容时调整 Div 的高度

javascript - myModal Javascript 弹出窗口未打开

CSS 宽度在 IE 中不同?

cordova - 解析 Ionic App 自动推送通知的可能性