How to center the message text in Cookie Consent

4 January 2019

Cookie Consent from Insights is a simple and free way to alert users about the use of cookies on your website. We use it here on Technically Product - hopefully you saw that unobtrusive black banner at the bottom of the page when you first visited the site.

Cookie Consent even has a Wizard to enable you to configure the banner (or overlay or popup, if you want to call it that) as you see fit - choosing a colour palette, layout, text and so on. The Wizard generates a snippet of JavaScript which can easily be added to your site using Google Tag Manager. Here's the default:

However the message text in the banner is left-justified, and this can't be changed in the Wizard. The left-justified text can look rather strange on a larger monitor, especially if the banner is set to run full width and the text itself is on the short side. It would be much better centered - but how?

Fortunately it is possible to center the text with one line of CSS, added via an internal stylesheet. The amended code block with added CSS (highlighted) looks like this:

 

I hope this is useful to someone out there!

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © James Clark
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram