Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1132582

    I am trying to follow the directions in previous posts about using custom CSS to use an image instead of an icon in an icon box. Clearly, I am missing something obvious because it does not work for me. Can you help?

    I added this to my CSS block: (I am subsituting myurl in the string for the actual URL)

    .custom-iconbox .iconbox_icon1:before { display: none; }
    .custom-iconbox .iconbox_icon1 { background-image: url(https://bp.myurl.com/wp-content/uploads/2019/08/1-Start.png); background-repeat: no-repeat; background-position: 50% 50%; background-size: contain; }

    In the Custom CSS box of the icon box, I added the following:
    iconbox_icon1

    What did I do wrong here? I am sure it is a simple CSS mistake.

    The other thing is that I would really like to use four images to replace four icons in an icon grid. Is there any way to do that?

    Thank you

    #1132856

    Hey rmatus,

    Could you post a link to where you want to apply this to please?

    Best regards,
    Rikard

    #1132962

    Yes – best would be to see the site you are talking about.

    then – i would not set the background on the .iconbox_icon but substitute the before content.
    where does the number come from? .iconbox_icon1 ???

    you can replace before content by declaring it to “” empty:
    and place then the background-image. You can play with height and width of that:

    .custom-iconbox .iconbox_icon:before {
      content: "";
      background-image: url(https://path-to-your-image.jpg);
      background-repeat: no-repeat;
      background-size: contain;     /*** or cover is better if your image has 1:1 aspect ratio ***/
      background-position: center;
      width: 50px;
      height: 50px;
      display: inline-block;
      position: relative;
      transform: translate(-50% , -50%);
      left: 50%;
      top: 50%;
      border-radius: 50%;
    }

    Advantage is in additon that you can have with png files the background-color of your theme.

    #1132967

    for the icon-grid is the same thing here:
    you replace the before content.
    Give a custom class to your icon-grid. ( here on my example code it is: your-custom-class )
    to address the different icons you can do that by nth-child option ( here it is the first icon of the icon-grid ):

    .avia-icongrid.your-custom-class li:nth-child(1) .icongrid-char:before {
      content: "";
      background-image: url(path-to-your-image);
      background-repeat: no-repeat;
      background-size: contain;
      background-position: center;
      width: 50px;
      height: 50px;
      display: inline-block;
      position: relative;
      border-radius: 50%;
    }
    #1133167
    This reply has been marked as private.
    #1133168

    Thank you. I got the iconbox to work, but not the icon grid.

    I put the following CSS into CSS box:

    .avia-icongrid.custom-icongrid li:nth-child(1) .icongrid-char:before {
    content: “”;
    background-image: url(https://bp.domain.com/wp-content/uploads/2019/08/1-Start.png);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    width: 50px;
    height: 50px;
    display: inline-block;
    position: relative;
    border-radius: 50%;
    }

    Then, I put custom-icongrid into the custom CSS class field.

    Thank you again for your help.

    #1133506

    Sorry my mistake that the custom class goes to the container I missed:

     .avia-icon-grid-container.custom-icongrid li:nth-child(1) .icongrid-char:before {
      content: "";
      background-image: url(https://bp.domain.com/wp-content/uploads/2019/08/1-Start.png);
      background-repeat: no-repeat;
      background-size: contain;
      background-position: center;
      width: 50px;
      height: 50px;
      display: inline-block;
      position: relative;
      border-radius: 50%;
    }
    #1133961

    Hi rmatus,

    Did you get it working for you or do you need more help?

    Best regards,
    Victoria

    #1134021

    Sadly, it is not working yet. I created an account for you to look at what I have done so far. It is on the HOME page.

    Thank you in advance for any help that you can give.

    #1134106

    YES! That was it. Thank you so much!

    #1134691

    Hi,

    Great, I’m glad that you got it working and thanks for the update. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1149695

    Close it. Thank you.

    #1149876

    Hi rmatus,

    Ok, closing the thread :)

    Best regards,
    Victoria

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Images for iconbox and maybe even an icongrid’ is closed to new replies.