draw ‘til you’re soreWelcome to the bog of Jessica Amber. Herein you’ll find my life, whatever Irandom stuff ’m getting up to. It’s usually creative.
Unmaintained since 2019. Please go to www.jessicaamber.com.au This site contains affiliate links.
|
I thought I was being very clever about making coloured text, but today I've learned the importance of checking your work. My code wasn't working right. Today, I fixed it, and I will teach you how to make embedded code be the right colour for you.
When I wanted text in my Weebly blog's 'Embed Code' element to be a certain colour, I simply specified it with HTML code, like so:
<p style=" font-family: monospace; color:hotpink;">Sample Text</p>
In the Weebly Editor, this code seemed to work perfectly.
But when it came to publishing the website, something was amiss. The pink text had turned black!
I 'inspected' the element in Google Chrome, and found that my colour was being overwritten by various Weebly code.
The easiest way I thought of to fix this was to add the !important flag to my colour code in the Embed Code element.
<p style=" font-family: monospace!important; color:hotpink!important;">Sample Text</p>
The !important lets the browser know this instruction should overwrite all other instructions acting on this text. Because my !important is declared as an in-line style, it overwrites any styles, even !important ones, in external .css files. With that change, the pink text now displays pink when published. Hooray!
I hope this little bit of code helps you out. If you know any other little fixes for Weebly you'd like to share, or areas you'd like me to tackle, leave a comment and let me know! Until next time, XX Jess
0 Comments
Leave a Reply. |
AuthorI'm just some Aussie 20-something year old with a lot of time and a lot of interests. Archives
July 2019
CategoriesAll Art Art Freelancing Business Cosplay Food Law Of Attraction Makeup Organizing Sewing Shopping TAFE Technology Web |