Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

308
Views
Is there any CSS tag to justify content (like in word)?

I want National and International brands to be placed in the center under the above present text.

OutPut:

enter image description here

The CSS code-

.ans{
    padding-top: 1.2vh;
    display:flex;
    color:lightsalmon;
    font-size: 5vh;
    text-justify: auto;

}

The HTML Code-

<div id="qa">
    <p class="q">
        Why HOTPICKS?
    </p>
    <p class="ans">
        HOTPICKS provides a discount of Upto 75% on National and International Brands. 
    </p>
</div>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

NOTE: avoiding text-align-last: center; due low support. (https://caniuse.com/css-text-align-last)

The problem is how to center a specific line of a text or how to wrap exactly. If it's critical what I'd probably do while researching a solution would be wrap the line in a span tag with display: block but remove this display: block in low resolutions (using @media queries).

See the next snippet (without the @media to see a break problem in low res)

.ans{
    padding-top: 1.2vh;
    color:lightsalmon;
    font-size: 5vh;
    text-align: center;
}

.ans span {
    display: block;
}

.q {
    text-align: center;
}
<div id="qa">
    <p class="q">
        Why HOTPICKS?
    </p>
    <p class="ans">
        HOTPICKS provides a discount of Upto 75% on 
        <span>National and International Brands.</span>
    </p>
</div>

This works but the break could be weird with little width resolution, that's why I recommend disable on mobile.

This means modify html but I prefer that to superhacky css weird tricks using margins. Matter of personal preferences.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!