No internet connection

Center the Talkyard Commentbox

By @Happyfeet012020-08-21 12:42:05.275Z

Hello,

is it possible to center the Commentbox on Ghost CMS. on Mobileview it looks good, but on Desktop is it on the left Site at the Page.

https://dasnetzundich.de/iptables-mit-ipset-futtern/
Solved in post #2, click to view
  • 2 replies
  1. KajMagnus @KajMagnus2020-08-21 14:55:23.862Z

    This works for me:

    .talkyard-comments {
        max-width: 750px;   /* you can change this */
        width: calc(100% - 40px);  /* 20 px whitespace on each side, on small screeens */
        margin-left: auto;
        margin-right: auto;
    }
    

    The reason this works is that now when the layout engine has to give the element a restricted width,
    then, with margin-left and right = auto,
    it'll add equally much whitespace to the left as to the right.

    Even more details & ideas — one can use Flexbox too:

    How to horizontally center a <div>?
    https://stackoverflow.com/questions/114543/how-to-horizontally-center-a-div

    ReplySolution
    1. H@Happyfeet012020-08-22 11:16:35.057Z

      Thanks! It Works