Search code examples
javacssfreemarker

margin:auto not working in FTL file


I am preparing html body by using FTL template (in Java). I have written css as follows:

width: 620px;
margin-left: auto;
margin-right: auto;

also tried margin: auto;

FTL not considering auto keyword from css.

Could you please help anyone on this.


Solution

  • width: 620px
    margin-left: auto
    margin-right: auto
    

    You have to close the code at the end.

    width: 620px;
    margin-left: auto;
    margin-right: auto;
    

    and maybe you can use margin:100%; to solve it