0

For all the images by default the below style class is being set.

.figure {
    display: inline-block;
    vertical-align: top;
    position: relative;
    max-width: 100%;
}

I am trying to change display: inline-block to display:inherit only on a particular page. I added the image via visual composer in WP,and tried adding a new class for the image div by adding the style needed, but still the display:inline-block remained the same.Any solutions will be appreciated.Thanks.

7
  • Did you try to use !important at the end of the value of the display in the new class? Commented Oct 19, 2015 at 7:03
  • try adding display:inherit!important Commented Oct 19, 2015 at 7:04
  • yes i added,but still it didn't work. Commented Oct 19, 2015 at 7:04
  • Could you send the link? Commented Oct 19, 2015 at 7:06
  • pax is the new class i have given. Commented Oct 19, 2015 at 7:08

2 Answers 2

1

please add inline css and check its working or not?

If its working then add new class and add that class end of the css and try it will work

Like add inline-img this is the new class then add following css to end of your css file

.figure.inline-img{
 display:inherit;
} 
Sign up to request clarification or add additional context in comments.

5 Comments

When i add the style on inspect element it's working,but when i write in style sheet and add the class it's not working,will that be a problem with my stylesheet?
Yes the problem is with the stylesheet loading order when you want to overwrite the existing css class then you need to include at last.
In which CSS you have .figure class and in which Css you have added new .figure.inline-img class?
ohh... the .figure is in theme.css,and i added the new class in style.css via the editor.
Please add the in theme.css at end of the file.
0

If you've added a custom style to the figure (you mentioned a .pax class), then you simply need to specify the following in the CSS:

.figure.pax{
  display:inherit;
}

If that doesnt work, you can either add specificity to the selector (my preference) or add !important as follows:

.figure.pax{
  display:inherit !important;
}

(Alternatively, if you'd like the image to be display:block which is what it looks like you'd like, use display:block instead of display:inherit)

1 Comment

@sa-7 - Excellent, glad it helped!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.