Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1249053
    yhshin1020
    Participant

    Hey,

    I am trying to limit the width of a block of text that is aligned centrally to the section in which it is placed.

    Currently it looks like this (see first picture below).

    And I want it to look like this (see second picture below).

    I managed to achieve the look by adding the code

    word-wrap: break-word; width: 800px; margin: 0 auto; to the style section of the text element.

    However, on mobile, the text is not centrally aligned to the section (see third picture below).

    How can I make it aligned to the center normally (I believe this is due to me setting the width of the text) whilst limiting the pargraph width? Is wordwrap the best option for this?

    Thank you a lot.

    #1249057
    yhshin1020
    Participant
    This reply has been marked as private.
    #1249589
    Lely
    Moderator

    Hello There,

    Thank you for the credentials.
    Please try this instead:
    word-wrap: break-word; max-width: 80%; margin: 0 auto;
    Adjust 80% accordingly. It is not recommended to use px on width because it is not responsive.

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1249053 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>