Suppose you need to attach a logo to a specific button block. You can follow these.
#1. Find Logo URL
#2. Find Button Block ID.
In my example, we will have: #block-yui_3_17_2_1_1723015693923_4061
#3. Use this code to Custom CSS box
#block-yui_3_17_2_1_1723015693923_4061 a:after { content: ""; background-image: url(https://cdn.pixabay.com/photo/2024/08/30/10/15/woman-9009013_1280.png); background-size: contain; background-repeat: no-repeat; background-position: center center; display: inline-block; width: 100px; height: 50px; }
#4. Result
#5. If you want to move logo before text, just change
:after
in the code to
:before
#6. If you want to make logo above button text, add this extra CSS
#block-yui_3_17_2_1_1723015693923_4061 a { flex-direction: column; }
Result
#7. If you want to add this to Header button, use this new CSS code
a.btn:after { content: ""; background-image: url(https://cdn.pixabay.com/photo/2024/08/30/10/15/woman-9009013_1280.png); background-size: contain; background-repeat: no-repeat; background-position: center center; display: inline-block; width: 100px; height: 50px; } a.btn { display: flex !important; align-items: center; }
Result