Title: Disabling css styles
Last modified: July 28, 2024

---

# Disabling css styles

 *  Resolved [Sanya Kuzovlev](https://wordpress.org/support/users/sanya1917/)
 * (@sanya1917)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/disabling-css-styles/)
 * I created a simple table with one row. In this row, I highlighted the first cell
   in yellow and saved the table. Later I removed the selection, but now I have 
   styles appearing in the page code all the time.
 *     ```wp-block-code
       <style id="wpdt-custom-style-17"></style><style>/* th background color */.wpdt-c.wpDataTablesWrapper table.wpdtSimpleTable.bt[data-has-header='1'] td.wpdt-header-classes,.wpdt-c.wpDataTablesWrapper table.wpdtSimpleTable thead th,.wpdt-c .wpDataTablesWrapper table.wpDataTable thead th,.wpdt-c .wpDataTablesWrapper table.wpDataTable thead th.sorting {	background-color: #FEEA33 !important;    background-image: none !important;}</style>
       ```
   
 * How can I remove and completely disable styles in this and necessarily on other
   tables so that they are not shown on the pages at all?
 * By the way, this style insertion does not pass code validation [https://validator.w3.org/](https://validator.w3.org/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/disabling-css-styles/#post-17929106)
 * Hi there.
 * Thank you for reaching out to us. We tried replicating this issue locally, but
   we couldn’t. This is a result of a 1-row simple table with the background color
   set to yellow:
 *     ```wp-block-code
       <style id="wpdt-custom-style-3">        .wpdt-bc-FFEB3B { background-color: #FFEB3B !important; } </style>
       ```
   
 * When the color is removed, it’s just an empty style:
 *     ```wp-block-code
       <style id="wpdt-custom-style-3"></style>
       ```
   
 * Since you have “thead”, td, and th, it appears you’re not using Simple Tables,
   but instead a different table type. Which table type was that? Did you manually
   define the background color, or did you define a rule for the background color?
   We tried replicating the issue in a CSV-based table, and we couldn’t. Can you
   please explain in more detail and we’ll gladly explore this issue further?
 * The issues reported by validator.w3.org are related to the HTML structure, not
   the CSS code itself. The CSS code you provided is valid, but when validating 
   through an HTML validator, it’s important to ensure the HTML document is properly
   structured.
 * If you were to enclose this CSS in HTML (as it’s enclosed on an actual page),
   it wouldn’t return any errors. You can try this:
 *     ```wp-block-code
       <!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <meta name="viewport" content="width=device-width, initial-scale=1.0">    <title>Document Title</title>    <style id="wpdt-custom-style-17"></style>    <style>    /* th background color */    .wpdt-c.wpDataTablesWrapper table.wpdtSimpleTable.bt[data-has-header='1'] td.wpdt-header-classes,    .wpdt-c.wpDataTablesWrapper table.wpdtSimpleTable thead th,    .wpdt-c .wpDataTablesWrapper table.wpDataTable thead th,    .wpdt-c .wpDataTablesWrapper table.wpDataTable thead th.sorting {        background-color: #FEEA33 !important;        background-image: none !important;    }    </style></head><body>    <!-- Your content here --></body></html>
       ```
   
    -  This reply was modified 1 year, 8 months ago by [wpDataTables](https://wordpress.org/support/users/wpdatatables/).
 *  Thread Starter [Sanya Kuzovlev](https://wordpress.org/support/users/sanya1917/)
 * (@sanya1917)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/disabling-css-styles/#post-17946733)
 * Thanks a lot for the detailed answer. The main question was precisely that [https://validator.w3.org](https://validator.w3.org)
   writes an error on the HTML structure: style inside the div. I tried the suggested
   method, added the code to the head, but nothing happened.
 *     ```wp-block-code
       function add_custom_style_to_head() {    echo '    <style id="wpdt-custom-style-17"></style>    <style>    /* th background color */    .wpdt-c.wpDataTablesWrapper table.wpdtSimpleTable.bt[data-has-header="1"] td.wpdt-header-classes,    .wpdt-c.wpDataTablesWrapper table.wpdtSimpleTable thead th,    .wpdt-c .wpDataTablesWrapper table.wpDataTable thead th,    .wpdt-c .wpDataTablesWrapper table.wpDataTable thead th.sorting {        background-color: #FEEA33 !important;        background-image: none !important;    }    </style>    ';}add_action('wp_head', 'add_custom_style_to_head');
       ```
   
 * The error remains the same.
    1. **Error**: Element [`style`](https://html.spec.whatwg.org/multipage/#the-style-element)
       not allowed as child of element [`div`](https://html.spec.whatwg.org/multipage/#the-div-element)
       in this context. (Suppressing further errors from this subtree.)From line 681,
       column 7; to line 681, column 40`le>↩</div>**<style id='wpdt-custom-style-132'
       >**↩.wpdt`Contexts in which element [`style`](https://html.spec.whatwg.org/multipage/#the-style-element)
       may be used:Where [metadata content](https://html.spec.whatwg.org/multipage/#metadata-content-2)
       is expected.In a `[noscript](https://html.spec.whatwg.org/multipage/#the-noscript-element)`
       element that is a child of a `[head](https://html.spec.whatwg.org/multipage/#the-head-element)`
       element.Content model for element [`div`](https://html.spec.whatwg.org/multipage/#the-div-element):
       If the element is a child of a `[dl](https://html.spec.whatwg.org/multipage/#the-dl-element)`
       element: one or more `[dt](https://html.spec.whatwg.org/multipage/#the-dt-element)`
       elements followed by one or more `[dd](https://html.spec.whatwg.org/multipage/#the-dd-element)`
       elements, optionally intermixed with [script-supporting elements](https://html.spec.whatwg.org/multipage/#script-supporting-elements-2).
       If the element is not a child of a `[dl](https://html.spec.whatwg.org/multipage/#the-dl-element)`
       element: [flow content](https://html.spec.whatwg.org/multipage/#flow-content-2).
 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/disabling-css-styles/#post-17950278)
 * Hello,
   We spoke with our developers for advice, they went through all the details
   you sent.They notice one line you used :
 *     ```wp-block-code
        <style id="wpdt-custom-style-17"></style>
       ```
   
 * Can you please try removing that part, then check, does that resolve the said
   error?
   Thank you.
 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/disabling-css-styles/#post-17950302)
 * Hello again,
   Apologies, we forgot to add one more detail our developers mentioned.
   If the said suggestion from above does not help, can you please try to elaborate/
   clarify a bit more, if you can send us more details as to where are you implementing
   this element exactly, perhaps the issue could be with the method/way how you 
   are trying to achieve/add it.You can add screenshots or even better record a 
   Video of your screen to show us these details/steps etc.If the screenshots/ Video
   contains any sensitive data, then it is best to open a private new ticket on 
   our [main Support platform here](https://tmsplugins.ticksy.com/), and one of 
   our Agents will respond as quickly as possible to proceed there in further details,
   you can just refer to our correspondence.
 * If you don’t have a licence (or if it expired), please open a [pre-purchase ticket](https://tmsplugins.ticksy.com/submit/#100010481)
   which doesn’t require a purchase code.
 * Premium products are not supported in these forums, as per [this comment](https://wordpress.org/support/topic/error-when-not-logged-into-wordpress-backend/#post-15050671)
   by WordPress.org moderators.
 * Thank you for understanding. 
 * Kind regards.
 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/disabling-css-styles/#post-17950398)
 * Hello,
   Apologies for going back and forth like this today.Our developers went
   through everything again and we found useful details for you.Basically, the first
   part of the code <style id=”wpdt-custom-style-17″></style> is from the Simple
   table creation.
 * ​
 * ![](https://i0.wp.com/ticksy_attachments.s3.amazonaws.com/3081246795.png?ssl=
   1)
 * 
   Our Plugin is automatically generating this, so you should remove it if there
   is no custom style included with it.The second part is coming from your Global
   Plugin settings ( Main Plugin settings/Color and Font settings), where you most
   probably still have the style you added there.
 * ![](https://i0.wp.com/ticksy_attachments.s3.amazonaws.com/7770658931.png?ssl=
   1)
 * 
   Can you please check and reset those settings, then the issue should be resolved?
   Let us know how it goes.Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Disabling css styles’ is closed to new replies.

 * ![](https://ps.w.org/wpdatatables/assets/icon-128x128.gif?rev=3010404)
 * [wpDataTables - WordPress Data Table, Dynamic Tables & Table Charts Plugin](https://wordpress.org/plugins/wpdatatables/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdatatables/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdatatables/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdatatables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdatatables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdatatables/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [style](https://wordpress.org/support/topic-tag/style/)

 * 7 replies
 * 2 participants
 * Last reply from: [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/disabling-css-styles/#post-17950398)
 * Status: resolved