The title is positioned at a different level compared to the ion-buttons in the toolbar

I am facing a challenge with the positioning of the logo in IOS compared to Android. On Android, the logo and buttons are aligned at the same height, but on IOS the logo appears higher than the buttons.

Here is my code snippet:

<ion-header>
  <ion-toolbar>
    <ion-buttons left>
      <button ion-button icon-only (click)="navCtrl.pop()" class="backbutton">
        <ion-icon name="arrow-back"></ion-icon>
      </button>
    </ion-buttons>
    <ion-title>
      <img alt="logo" height="20" src='assets/img/logo.png'>
    </ion-title>
    <ion-buttons end>
      <custom-buttons></custom-buttons>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

https://i.sstatic.net/LiEkz.png

--EDIT

CSS:

ion-title img {
  height: 20px;
}

ion-title {
  background-color: #121d27;
  color: #fff;
}

ion-buttons button[icon-only].backbutton {
  color: white;
}

.toolbar-background{
  background-color: #121d27;
}

Answer №1

To ensure vertical alignment of all three elements within the <ion-toolbar>, you simply need to apply the vertical align property to each item.

Include the following CSS:


ion-title, ion-buttons {
  vertical-align: middle;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

extracting an empty value from this variable

When I click on an anchor tag using this operator, the value appears blank. I have multiple divs with the same class, so I used the .each() function, but I can't figure out where I'm going wrong. The desired output is that when I click on one of ...

I attempted to utilize the <map> tag in creating a circular image that functions as a hyperlink, but unfortunately, it is not functioning correctly

I've been trying to create a round button using the code below, but something seems to be wrong with it. The issue I'm facing is that the area around the image is also clickable, even though I have used border-radius. Can someone please take a lo ...

Finding the closest button using Selenium in Python

I am attempting to click on the "Delete Comment" button once I have identified a comment that contains the specific hashtag, husky, which is a clickable link. Since there are multiple "Delete Comment" buttons on the page, my approach is to locate the comm ...

Retrieve the data-filter attribute from every div element

I am struggling with the following HTML code: <div class="" data-filter="01"> ... </div> <div class="" data-filter="02356"> .... </div> <div class="" data-filter="02356"> ... </div> I am looking for a way t ...

Disabling DEBUG mode in Django 1.8 for static files

I need assistance with setting the debug mode to false for my production branch. urls.py urlpatterns = patterns('', url(r'^', include('app.urls', namespace = 'app')), )+ static(settings.STATIC_URL, document_roo ...

Identify line counts and hyphenated lines in a text box with the help of regular expressions

I have been struggling to find a solution to the problem of excluding lines starting with double hyphens when using regular expressions. I need to count single lines separately and double hyphenated lines separately, and display them outside the text area. ...

Guidelines for refreshing owl carousel on ng-click using AngularJS

I am encountering a significant issue with the use of an owl carousel in angular.js. It functions properly the first time, but when I have buttons on the same page and need to rebuild the owl carousel upon clicking a particular button with new data, that&a ...

Content is not centered and remains at a consistent size

My struggle is with changing the font size and alignment on my website. Despite numerous attempts, I can't seem to get it right. The text is currently left-aligned when I want it centered, and I also need it to be larger in size. Take a look at my cod ...

Having trouble using Jquery Selector to locate a div element in my Polymer project. Seems like it should be simple, but I can

Purpose: My objective is to add a new class to the div that contains a form when a specific icon is clicked. Challenge: The Jquery selector in pullupClose function is not able to identify the element. Check out the console.log result for a visual represent ...

Fixed Sidebar and Dynamic main content with top and bottom sections

Hello, I've been encountering an issue with coding the layout of my website. I want the sidebar to remain fixed regardless of screen size, while also making sure that the content area adjusts fluidly. The header is staying at the top as desired, but I ...

Can you have two onclick events triggered by a single Div? (ASP.NET / HTML)

I am currently working with Div's and facing a challenge of handling 2 events with just one Div-Click.. I wanted to use both onclick="" and OnClientClick, but it seems that when using a Div, I cannot make use of OnClientClick. Can anyone provide me ...

Interactive HTML Slides Creator

I am considering developing an online "Slides viewer/Editor" using HTML5 slides with Html5 and Jquery. I want to ensure that this is feasible and will be compatible on mobile devices. While there are many Slides Viewers available, none of them have editi ...

Having trouble loading background color or image in three.js

I've been struggling to load a background image or color on my webpage. Despite trying various methods, including commenting out javascript files and checking the stylesheet link, nothing seems to work. Even when I load the three.js scene with javascr ...

Issues with HTML5 video playback and jQuery script functionality on mobile devices are causing problems

Why Won't the Video Play on Mobile? The video in my slider plays perfectly on my PC, but when I tried to view it on my Galaxy Note 3 smartphone, it didn't work. The video should play automatically when the page loads or when the document is rea ...

"Learn the steps to seamlessly add text at the current cursor position with the angular-editor tool

How can I display the selected value from a dropdown in a text box at the current cursor position? I am currently using the following code: enter code selectChangeHandler(event: any) { this.selectedID = event.target.value; // console.log("this.selecte ...

Adding an HTML select box to a Laravel Eloquent form: A step-by-step guide

I currently have a form structured like this: {{ Form::open(array('url' => 'addjob')) }} <div class="form-group"> <label for="">SubCategories</label> <select class="form-control input-sm ...

How can I identify the specific iframe that is invoking a JavaScript function within its parent?

Let's consider this scenario sample.html <script> function identifyCaller() { console.log(???); // what should be placed here to determine the caller? } <iframe src="frame1.html"></iframe> <iframe src="frame2.html"></if ...

Leveraging the power of Bootstrap 4 to place the footer beneath all remaining content on the

I am currently working on a React application that consists of a header, container, and footer. To add animation to the route loading process, I had to apply position: absolute to the container section of the page. Within the container, there is a row wit ...

Trigger a JQuery popup by toggling a class with a button

Hey there! I have a modal popup that utilizes an active class. When this class is present, the modal appears, and when it is removed, the modal disappears. I am trying to create a button that, when pressed, will show the modal, and a close button inside th ...

Issues with encoding charset in Vite server (ISO-8859-15)

While utilizing a Vite server with vanilla JS for development or build purposes, I encountered an issue where charset encoding changes within the index.html file. Despite the widespread usage of utf-8 encoding, I have specific requirements that necessitate ...