1. lembasts
  2. Commercial Templates
  3. Wednesday, 15 January 2014
  4.  Subscribe via email
I have just started a blog which will contain programming code. I saw a site called "hilite.me" which allows me to paste in my code and it generates lovely looking html. However, when I paste this into a blog article, it looks nothing like the preview. Specifically, the "span" tag needs to start on a new line, and the inline colour style generated needs to override the template. Turning all "span" tags into block level items sounds tricky - I could maybe put in some <br> tags as a workaround, but the colours should be do-able? Am I right in guessing that templates typically use the !important option often to prevent these sort of oveerrides? If not, what could be overriding my inline style colours? Im using the Nocturne template with the Easyblog component and the JCE editor btw...
Thanks
David
Accepted Answer Pending Moderation
0
Votes
Undo
Hi David

The only CSS that could be overruling your inline styling is most likely using the !important option in one of the template/component style sheets. All developers would try and avoid using !important however there can be times when it is simply unavoidable. Would you have a URL to an example of your code with the hilite.me applied?

Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
Thanks - The span colours are working OK. Its the background colour that is ignored - instead of being dark it is light so something is reversing it. The inline CSS on my Div element is as follows:
style="background: #111111; overflow:auto;width:auto;border:solid grey;border-width:.1em .1em .1em .8em;padding:.2em .6em;"

I dont think I can post the sample code as its full of <> and things that would upset this post maybe?

Maybe some code behind the JCE or Easyblog editor is changing the colour of my background?
  1. more than a month ago
  2. Commercial Templates
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
Found it! The program code was wrapped in a pre element which was wrapped in a div element. the background inline css colour was on the div element. I add the background to the pre element and it worked!
  1. more than a month ago
  2. Commercial Templates
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
Great... thank you for the update!

Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!

Join Our Newsletter

* indicates required
We respect your privacy and do not tolerate spam and will never sell, rent, lease or give away your information (name, email, number, etc.) to any third party. Nor will we send you unsolicited email.
Joomla51 - Mullaghmore, Co. Sligo, Ireland
Joomla51.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by
Open Source Matters
the trademark holder in the United States and other countries.