Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #432436

    Hi togehter,

    I would like to style an image I added to a text-block with the css-class function. I’m using Enfold as a child theme. So first I entered the class name “ownpic” at the picture-details area on the field “css-class”. After saving it I entered the following code to my style.css:

    .ownpic img {
    border: 0px !important;
    background: transparent !important;
    }
    

    But the picture does not change styles, background stays white. I tried .gif and also .png files. At the advanced layer slider the picture is correctly shown with a transparent background. Other styles don’t work too, like e.g.

    .ownpic img {
    border: 10px !important;
    }
    

    I also tried

    .ownpic {
    border: 0px !important;
    background: transparent !important;
    }

    and

    img .ownpic {
    border: 0px !important;
    background: transparent !important;
    }

    But all these codes won’t work. What did I do wrong?

    Greetings, Andreas

    #432972

    Hi dreamworker80!

    can you please provide us a link showing the image in the text block? so we are able to give you some precise CSS code.

    Cheers!
    Andy

    #433096
    This reply has been marked as private.
    #433374

    Hey!

    You can use your custom class like this:

    .windrad {
      border: 10px solid red !important;
    }

    Regards,
    Rikard

    #433648

    Thanks, that works. But the other picture has still got a white background.
    I tried lots of codes, but they all don’t work. Is there another solution?

    #433967

    Hi!

    That is because the image itself has white background, you can’t do anything about that with CSS. Try to save it in .png format with a transparent background.

    Best regards,
    Rikard

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