我想创建一个带有侧边菜单和导航标题中标题的应用程序。在导航标题的右侧,我会放置一个图标。
这是我当前的代码:
<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/