• I’ve switched off the WYSIWYG editor – and am trying to put in some style for a post. eg:

    <style type="text/javascript>
    .matt { color: #FFFFFF; }
    </style>
    <p class="matt">Hello

    it appears in the editor ok – but when it is viewed as a post on the website, the code has been put with <br /> tags around it! It looks like this:

    <style type="text/javascript">
    .matt { color: #FFFFFF; }
    </style>
    <p class="matt">Hello

    that then means the stlye is not working!!
    where can I change the code to stop it doing this – or is there some function I can use to ignore ANY html in a post (ie: It isnt altered)…?

Viewing 3 replies - 1 through 3 (of 3 total)
  • For starters, you have the wrong “type” for CSS markup. It needs to be ‘type=”text/css”>’.

    You may want to go to your admin panel, Options->Writing and uncheck “WordPress should correct invalidly nested XHTML automatically” if it is set.

    Try again and see what happens.

    Short of that, you may want to add any POST specific styles that you normally use in your “style.css” file for your theme..

    Regards

    Thread Starter mattfacer.com

    (@mfacer)

    hi cypher…

    thanks for the reply.. the XHTML box was not ticked, so that’s not made any difference.

    It’s not essential, its just that I use my blog as examples, and I wanted to show certain mouse over techniques using CSS and i cannot do it !! It’s a pitty you cant maybe build a tag to tell wordpress to take the text literally, and not to be clever and replace \n with <br />.

    I’ve made a small plugin that ‘fixes’ this behavior. More info.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘adding HTML & CSS style to a post’ is closed to new replies.