Tagged: , ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #991705

    Hello
    I am using text-blocks to display text.
    I would like to center the text-block and justify the text inside.
    Someting like:

    <div style="text-align: center;">
        <div style="display: inline-block;">
    		<p class="code-block-center-header-text"><strong><span>Studio & Main Shop:</span></strong></p>
    		<p class="code-block-justify-text"><span>42 Emek Refaim St (michael alley),</span></p>
    		<p class="code-block-justify-text"><span> German Colony, Jerusalem.</span></p>
    		<p class="code-block-justify-text"><span>Tel: 02-5633398</span></p>
    		<p class="code-block-center-header-text"><strong><span>Opening Hours:</span></strong></p>
    		<p class="code-block-justify-text">Sunday, Monday, Tuesday 9:30 - 17:30</p>
    		<p class="code-block-justify-text">Wednesday, Thursday 9:30 - 19:00</p>
    		<p class="code-block-justify-text">Friday & Holiday Eve 9:00 - 13:00</p>
        </div>
    </div>

    Where the Css is:

    .code-block-justify-text {
    	text-align: justify !important;
    	font-size: 18px;
    	color: #000000;
    }
    .code-block-center-header-text {
    	text-align: center;
    	font-size: 18px;
    	font-weight: bold;
    	color: #000000;
    }

    The text-align: center; for the outer div does center the code-block,
    Still the text inside in left aligned.
    Any ideas how to get this done??

    P.s. I have inspected the css for all exterior elements and there is nothing indicating that this should behave like so!

    • This topic was modified 6 years, 3 months ago by tallypeled.
    #991710

    The closest I’ve found to work is:

    <div class="center-justified">
    <p>	Sunday, Monday, Tuesday 9:30 - 17:30, Wednesday, Thursday 9:30 - 19:00,	Friday & Holiday Eve 9:00 - 13:00&nbsp;</p>
    	</div>
    

    And css:

    .center-justified {
        margin: 0 auto;
        text-align: justify;
        width: 16em;
    }

    The down-side with this sort of solution is that it is line-width dependent!

    • This reply was modified 6 years, 3 months ago by tallypeled.
    #991748

    Hi,

    Can you please link us to the site so we can inspect the element.

    Best regards,
    Jordan Shannon

    #991760
    This reply has been marked as private.
    #992283

    Hi,

    Where did you add the “code-block-justify-text” css class attribute? Have you tried define a specific width to the code block?

    .code-block-justify-text {
       width: 50%;
    }

    Best regards,
    Ismael

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.