WordPress.org

Ready to get started?Download WordPress

Forums

WordPress editor changing my CSS (12 posts)

  1. Lou Sparx
    Member
    Posted 1 year ago #

    Hi all,

    I've just coded (CSS and HTML) some simple lists but when I paste these into WordPress text editor and save, it turns my code into a complete mess.

    Is there a way to enter code and have it be output how it should?

    Thanks,
    Lou

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    it turns my code into a complete mess

    Can you elaborate?

  3. Lou Sparx
    Member
    Posted 1 year ago #

    If I have:

    <div>
    <p>

    it will turn it to:

    <div></ br>
    <p></ br>
  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Which editor are you using?.

  5. Lou Sparx
    Member
    Posted 1 year ago #

    Both

  6. esmi
    Forum Moderator
    Posted 1 year ago #

    No. Never switch editing tabs. Pick a tab and stick to it for the life of that Post or Page.

  7. Lou Sparx
    Member
    Posted 1 year ago #

    I've tried both. Both mess up the code. Can you offer any help to the problem?

  8. Lou Sparx
    Member
    Posted 1 year ago #

    Surely it can't just be me that WordPress adds </ br> tags to.

  9. Andrew
    Forum Moderator
    Posted 1 year ago #

    One of the tabs is meant for plain text and formatting that, so when you press enter, it adds a <br /> element (behind the scenes).

    The other tab is for the behind the scenes code, so that's where you should be putting your HTML.

  10. Lou Sparx
    Member
    Posted 1 year ago #

    Guys I understand the difference between editors. I'm using the text editor, not visual. Although I've tried visual.

  11. esmi
    Forum Moderator
    Posted 1 year ago #

    Are you, at any point, switching between editing tabs? Are you pasting content in the the Text tab from elsewhere? Can you replicate the problem using the default theme with all plugins deactivated?

  12. Lou Sparx
    Member
    Posted 1 year ago #

    No. I wouldn't dare switch between editors as we all know WordPress hates that. Before I try to replicate.. should/will WordPress output html/css exactly how it is written in the text editor or will it always add it's own code?

Topic Closed

This topic has been closed to new replies.

About this Topic