skip to Main Content

I’m working on a Shopify store currently and tweaking the code to make the multiple paragraphs of a <div> justified while the last line is aligned to the center.

However, the second paragraph in the div is following the first property, but not the one for the last line. So I have a single paragraph with the text aligning to the left.

Here’s what my css code looks like:

.rte-setting.mega-subtitle p {
  text-align: justify; 
  text-align-last: center;
  /*width: 70%;*/
  position: relative;
}

It might just be a Shopify thing, but can anyone help?

2

Answers


  1. try

    text-align: justify !important;
    
    Login or Signup to reply.
  2. If you want the last paragraph in a block behave differently you want to use the last-of-type pseudo class.

    .rte-setting.mega-subtitle p {
      text-align: justify; 
    }
    .rte-setting.mega-subtitle p:last-of-type {
      text-align: center; 
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search