You can use two wrapper elements for that text, where the outer one (.inner-text-wrap-1 in my snippet) has display: flex; and justify-content: center for the centering, and the inner one has a max-width (set value as desired).
Note that I also changed some other details, like display: table; and width: 100% for the container etc.
<div id='container2' style="text-align:center;background: #00a99d;border-radius: 55px;">
<div class='fs1' id='a3' style="-webkit-box-shadow: 42px 2px 21px -3px rgba(0,0,0,0.69);-moz-box-shadow: 42px 2px 21px -3px rgba(0,0,0,0.69);box-shadow: 10px 4px 16px 4px rgba(0,0,0,0.69);">
<div class='fs1 cl'>1</div>
</div>
<div class='fs1 text-center py-2' style="color:white;font-size:23px;max-width:756px;line-height: 32px;"> Η ισχυρή ιατρική σύσταση αποτελεί τον κυριότερο άξονα προαγωγής του εμβολιασμού και εξάλειψης των χαμένων ευκαιριών. <sup>45</sup></div>
</div>
Comments
Comment posted by SuzieKay
What I want isto make it responsive and give the div with the text a max-width like 756 px and then center that div with comething like margin-auto in the div with id=’container2′ but that does not seem to work for some reason :/ Adding a padding is not so good I think because I will have to change the padding in every viewport that it seems wrong.I want it to be responsive on its own
Comment posted by Johannes
You can use percentage values for the padding, which I did/changed now in my snippet abobe. Those are relative, so they will change according to the width on smaller/larger viewports. (I also erased the
Comment posted by SuzieKay
The max-width was there becasue I wanted the text to llok exactly like the image(in the image it is 2 lines of text and it changes line after the word “παραγωγής”. Is there a better way to achieve this?
Comment posted by Johannes
I rewrote my answer completely – please have a look at it.
Comment posted by SuzieKay
Hello, first of all thank you very much for your effort, it works fine but the problem is that the text is centered inside the div with class=”inner-text-wrap-2″. What I actually am trying is to center the text inside the div with id=”container2″