• Resolved nish4x

    (@nish4x)


    I am having some issues trying to center a custom html block with a generated script. This script allows users to search my inventory for available properties. It is left aligned within my section and I cannot figure out how to center this.

    <div id="search-widget_IO312PWQ"><center><script>!function(e,t,a,n,c,r){function s(t){e.console.log("[Guesty Embedded Widget]:",t)}var i,d,l,o,y,m,g,h,p,u;n&&(i=n,d=t.getElementsByTagName("head")[0],(l=t.createElement("link")).rel="stylesheet",l.type="text/css",l.href=i,l.media="all",d.appendChild(l)),o=function(){try{e[a].create(r).catch(function(e){s(e.message)})}catch(e){s(e.message)}},h=!1,y=c,m=function(){h||this.readyState&&"complete"!=this.readyState||(h=!0,o())},(g=t.createElement("script")).type="text/javascript",g.src=y,g.async="true",g.onload=g.onreadystatechange=m,p=g,(u=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,u)}(window,document,"GuestySearchBarWidget","https://s3.amazonaws.com/guesty-frontend-production/search-bar-production.css","https://s3.amazonaws.com/guesty-frontend-production/search-bar-production.js",{"siteUrl":"titanbr.guestybookings.com"});</script></center></div>

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator threadi

    (@threadi)

    You should refrain from using <center> . Apart from the fact that this is wrong at this point, it also does not correspond to the current state of web development.

    The following CSS code is sufficient to achieve your goal:

    .guesty-root-element.guesty-widget__container {
     align-items: center;
     justify-content: center;
    }

    You can store this under Appearance > Customiser > Additional CSS.

    Thread Starter nish4x

    (@nish4x)

    threadi, thank you!

    • This reply was modified 2 years, 2 months ago by nish4x.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Centering Custom HTML Script’ is closed to new replies.