Tagged: CSS, custom.css, enfold, iconbox, icons
-
AuthorPosts
-
August 31, 2019 at 11:50 pm #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_icon1What 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
September 2, 2019 at 8:09 am #1132856Hey rmatus,
Could you post a link to where you want to apply this to please?
Best regards,
RikardSeptember 2, 2019 at 1:07 pm #1132962Yes – 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.
September 2, 2019 at 1:29 pm #1132967for 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%; }
September 3, 2019 at 3:50 am #1133167This reply has been marked as private.September 3, 2019 at 3:50 am #1133168Thank 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.
September 3, 2019 at 6:28 pm #1133506Sorry 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%; }
September 4, 2019 at 5:26 pm #1133961Hi rmatus,
Did you get it working for you or do you need more help?
Best regards,
VictoriaSeptember 4, 2019 at 6:29 pm #1134021Sadly, 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.
September 4, 2019 at 9:47 pm #1134106YES! That was it. Thank you so much!
September 6, 2019 at 3:08 am #1134691Hi,
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,
RikardOctober 21, 2019 at 4:40 am #1149695Close it. Thank you.
October 21, 2019 at 2:39 pm #1149876Hi rmatus,
Ok, closing the thread :)
Best regards,
Victoria -
AuthorPosts
- The topic ‘Images for iconbox and maybe even an icongrid’ is closed to new replies.