Archived topic
Help with CSS Classes
5 replies · Started by Math on February 25, 2022
Hi,
On this page I'm using a CODE block and I added an Additional CSS Class called copy-me.
Using copy-me CSS class, I'm able to adjust the font size, background colour, etc.
I would like to also adjust the "Copy" button as well (font-size, spacing, etc). How can I adjust the button using the same CSS class?
Thank you.
Hi there,
Not sure if I fully understand but looks like the CSS for the button is in your child theme already:
https://www.screencast.com/t/ywgBN0mlig
Hi Leo,
Yes, the CSS is already there for the Copy button. However, I would like to adjust the font size and background colour of the button using the Custom CSS Class copy-me.
As of now, no changes are taking place because the Custom Class is only targeting the Code block (i.e. pre[class*=language-]).
I would like to adjust the CSS for the button as well, but I'm not sure how to go about it. Would you be able to assist?
However, I would like to adjust the font size and background colour of the button using the Custom CSS Class copy-me.
I'm not sure what you are trying to achieve there but this CSS should work for adjusting that button.
div.code-toolbar>.toolbar>.toolbar-item>button.copy-to-clipboard-button {
background: #000;
font-size: 20px;
}
If you want to learn more about HTML and CSS then this free course might be helpful:
https://www.codecademy.com/catalog/language/html-css
Thank you.
No problem :)