how to align an area of html code in the site tracking header to the right.

  • 1
  • Question
  • Updated 6 years ago
  • Answered
i have a html search bar in the header (tracking code) so how would i align this to the right as i have tried < RIGHT ..> which works in the footer but i only have one line in the footer and there are multiple lines in the header
Photo of Justin

Justin

  • 117 Posts
  • 18 Reply Likes

Posted 6 years ago

  • 1
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Hi Justin,

Wrap the code in a DIV which you can set the attribute for right alignment.

<div align="right">
Your HTML code in here
</div>


As with all header and footer custom coding please test this on a test site first.
Photo of Justin

Justin

  • 117 Posts
  • 18 Reply Likes
hi gop it didnt work it just stays aligned on the left
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Wondering if it has some alignment attributes already? or the deprecation has finally caught up?

I'll give you some CSS which should work. I'll try it out before posting.
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
This seemed to work on a tool justin.

Add the style to an HTML widget on your page body probably as the first HTML widget

<style type="text/css">
.right-header
{
position:absolute;
right:0px;
width:300px; (define this yourself)
background-color:#b0e0e6; (if you want a background colour that is not part of the code. Any colour code is OK)
}
</style>


Then add the HTML into your header section. (Don't forget to try it on a test site!)

<div class="right-header">
your html code here
</div>
Photo of Justin

Justin

  • 117 Posts
  • 18 Reply Likes
Thanks Gop
it worked brilliantly and i changed the width to bring the widget in line with the navigation bar :)
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Wow. Good to hear Justin. You're doing very well on the learning curve!
Photo of Justin

Justin

  • 117 Posts
  • 18 Reply Likes
haha i know. i'll be a pro like you soon :)