I have a heading and an image. I want them to both appear on the same line as each other. I want the heading to be aligned center and the image to be aligned to the right.
My attempts so far have resulted in the following:
As you can see the heading ‘Generate a URL’ is pushed slightly to the left due to the image. How can I avoid this happening and keep it centered?
My HTML mark up is the following:
<h1 class="renault-title text-center bottom-margin-med">
Generate a URL
<img class="pull-right" src="{{ asset('bundles/urlBuilder/images/renault_english_logo_desktop.png') }}" style="height:49px;" alt="Renault logo">
</h1>
I am using Twitter Bootstrap. Appreciate any help.
2
Answers
Easiest way is to place
img
withposition: absolute
.Depending on what the rest of your HTML looks like, you could use columns. CodePen.