1
votes

I'm working on a project where I have a nav bar with fixed position. However I'd like to add a back button to this nav bar that should be placed at the left side of the navbar in center vertically.

This is how I've added the nav bar: http://jsfiddle.net/wryv1wfv/

Text is no problem adding to the nav bar as I just do it like this:

<div id="navbar">Text Here</div>

But I'm not sure about adding a button.

2

2 Answers

1
votes

So to add you elem into your html you could do the following :

<div id="navbar">
    <button>Back</button>
</div>

then modify a bit the style of your button :

#navbar > button{
margin-top:2%;
float:left;
}

and here you go !

0
votes

I strongly suggest to use external CSS library, such as Bootstrap. It comes with tons of pre-build tools, and they have very good documentation.

https://getbootstrap.com/examples/navbar/

Here you have example of navbar with bootstrap.