# Ion-header-bar class not applied

**URL:** <https://forum.ionicframework.com/t/ion-header-bar-class-not-applied/10083>\
**Category:** ionic-v1\
**Created:** [September 23, 2014, 3:46pm UTC](https://forum.ionicframework.com/t/ion-header-bar-class-not-applied/10083 "2014-09-23T15:46:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![caupetit](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@caupetit](https://forum.ionicframework.com/u/caupetit)\
**Post date:** [September 23, 2014, 3:46pm UTC](https://forum.ionicframework.com/t/ion-header-bar-class-not-applied/10083/1 "2014-09-23T15:46:05Z")

</div>

Hi, I’m trying to make some tests to learn creating mobile apps.

I can’t a make simple header with too test input.

here is my code:

```
<body>
  <div class="modal">
     <ion-header-bar class="bar-positive">
       <div class="buttons">
              <button class="button" ng-click="doSomething()">Left Button</button>
          </div>
          <h1 class="title">Name</h1>
          <div class="buttons">
              <button class="button">Right Button</button>
          </div>
        </ion-header-bar>
        <ion-content>
            <div class="list">
                <label class="item item-input">
                    <input type="text" placeholder="First Name">
                </label>
                <label class="item item-input">
                    <input type="text" placeholder="Last Name">
                </label>
            </div>
        </ion-content>
    </div>
  </body>

```

bar-positive is only applied on buttons in header, but not on the whole header.

if i use `<ion-header-bar class="bar bar-positive">`, header looks normal but ion-content goes under him.

Is there something I don’t understant ?

Thanks for help.

---

<div class="post-metadata">

**Author:** ![peterrobot](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/peterrobot/32/6991_2.png) [@peterrobot](https://forum.ionicframework.com/u/peterrobot)\
**Post date:** [September 23, 2014, 3:53pm UTC](https://forum.ionicframework.com/t/ion-header-bar-class-not-applied/10083/2 "2014-09-23T15:53:25Z")

</div>

Those buttons should be defined as nav-buttons. Your header should look like this:

```
<ion-header-bar class="bar-positive">
<ion-nav-buttons side="left">
    <button class="button" ng-click="doSomething()">Left Button</button>
</ion-nav-buttons>
          <h1 class="title">Name</h1>
          <ion-nav-buttons side="right">
    <button class="button">right Button</button>
</ion-nav-buttons>
        </ion-header-bar>

```

Then for the content not to go under the header, add a class “has-header” to the :

```
<ion-content class="has-header">
```

---

<div class="post-metadata">

**Author:** ![caupetit](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@caupetit](https://forum.ionicframework.com/u/caupetit)\
**Post date:** [September 23, 2014, 4:05pm UTC](https://forum.ionicframework.com/t/ion-header-bar-class-not-applied/10083/3 "2014-09-23T16:05:21Z")

</div>

Thanks for answer, but still not work. I give yout new code.

```
        <ion-header-bar class="bar-positive">
            <ion-nav-buttons side="left">
                <button class="button" ng-click="doSomething()">Left Button</button>
            </ion-nav-buttons>
            <h1 class="title">Name</h1>
            <ion-nav-buttons side="right">
                <button class="button">right Button</button>
            </ion-nav-buttons>
        </ion-header-bar>
        <ion-content class="has-header">
            <div class="list">
                <label class="item item-input">
                    <input type="text" placeholder="First Name">
                </label>
                <label class="item item-input">
                    <input type="text" placeholder="Last Name">
                </label>
            </div>
        </ion-content>

```

here is what i get, ![](https://sea1.discourse-cdn.com/ionicframework/uploads/default/3862/e07e82d6c645013c.png)

Do you see why ?

---

<div class="post-metadata">

**Author:** ![peterrobot](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/peterrobot/32/6991_2.png) [@peterrobot](https://forum.ionicframework.com/u/peterrobot)\
**Post date:** [September 23, 2014, 4:35pm UTC](https://forum.ionicframework.com/t/ion-header-bar-class-not-applied/10083/4 "2014-09-23T16:35:07Z")

</div>

Try access it via your browser. Or a little modification here:

```
<ion-view title="Name">
    <ion-header-bar class="bar-positive">
        <ion-nav-buttons side="left">
            <button class="button" ng-click="doSomething()">Left Button</button>
        </ion-nav-buttons>
        <ion-nav-buttons side="right">
            <button class="button">right Button</button>
        </ion-nav-buttons>
    </ion-header-bar>
    <ion-content class="has-header">
        <div class="list">
            <label class="item item-input">
                <input type="text" placeholder="First Name">
            </label>
            <label class="item item-input">
                <input type="text" placeholder="Last Name">
            </label>
        </div>
    </ion-content>
</ion-view>
```

---

<div class="post-metadata">

**Author:** ![caupetit](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@caupetit](https://forum.ionicframework.com/u/caupetit)\
**Post date:** [September 24, 2014, 8:05am UTC](https://forum.ionicframework.com/t/ion-header-bar-class-not-applied/10083/5 "2014-09-24T08:05:08Z")

</div>

Thanks again, but still not ok, ion-view is not bar-positive, and don’t display title (name), even on my nexus 5.

My ionic version is 1.2.5, maybe i should take earlier version ?

Or coul’d i have miss some trick in installation ?

---

<div class="post-metadata">

**Author:** ![caupetit](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@caupetit](https://forum.ionicframework.com/u/caupetit)\
**Post date:** [September 24, 2014, 8:30am UTC](https://forum.ionicframework.com/t/ion-header-bar-class-not-applied/10083/6 "2014-09-24T08:30:58Z")

</div>

My bad, continuing project and adding ionic as a module dependency solved it.

---

<div class="post-metadata">

**Author:** ![peterrobot](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/peterrobot/32/6991_2.png) [@peterrobot](https://forum.ionicframework.com/u/peterrobot)\
**Post date:** [September 24, 2014, 8:58am UTC](https://forum.ionicframework.com/t/ion-header-bar-class-not-applied/10083/7 "2014-09-24T08:58:33Z")

</div>

Actually title is set in the : `<ion-view title="whatever">...`
