• Resolved stevewest15

    (@stevewest15)


    Hi,

    Need some assistance on how to fix new W3C validator errors relating to <style> tag inside a <div> container:

    Error: Element style not allowed as child of element div in this context.
    
    From line 946, column 132; to line 946, column 173
    
    spu-box--><style type="text/css" id="spu-css-12651">		#spu
    

    Page source shows for every pop-up, the following which all return errors when running w3c validator:

    <div class="wppopups-whole" style="display: none"><style type="text/css" id="spu-css-12650">		#spu-bg-12650 {
    			background-color: rgba(0,0,0, 0.5);
    		}
    
    		#spu-12650 .spu-close {
    			font-size: 30px;
    			color: #666;
    			text-shadow: 0 1px 0#fff;
    		}
    
    		#spu-12650 .spu-close:hover {
    			color: #000;
    		}
    
    		#spu-12650 {
    			background-color: rgba(255,255,255, 1);
    			max-width: 600px;
    			
    					height: auto;
    					box-shadow:  0px 0px 10px 1px #666;
    				}
    
    		#spu-12650 .spu-container {
    					padding: 25px;
    			height: calc(100% - 28px);
    		}
    								</style>
    		<div class="spu-bg " id="spu-bg-12650"></div>

    Thank you,

    SW

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Damian

    (@timersys)

    Hi SW,
    Please try adding the following in your functions.php and let me know if it works

    if( function_exists( ‘wppopups’ ) ) {

    remove_action( ‘wppopups_popup_output’, [ wppopups()->printer, ‘styles’ ], 5, 2 );
    add_action( ‘wp_head’, [ wppopups()->printer, ‘styles’ ], 5, 2 );

    }

    Thread Starter stevewest15

    (@stevewest15)

    Hi Damian,

    I tried adding the script above.
    This removed the styles from the body:
    remove_action( ‘wppopups_popup_output’, [ wppopups()->printer, ‘styles’ ], 5, 2 );

    This however broke the site. It seems to have failed in adding the styles in the header:
    add_action( ‘wp_head’, [ wppopups()->printer, ‘styles’ ], 5, 2 );

    Plugin Author Damian

    (@timersys)

    Hi Steve,
    yes, I just tried myself. That won’t work and I won’t be able to provide a temporary solution I’m afraid.

    It will be fixed on the next plugin update.

    Thread Starter stevewest15

    (@stevewest15)

    Hi Damian,

    Thank you, look forward to the next update.

    SW

    Plugin Author Damian

    (@timersys)

    Hi @stevewest15 , new update was released. I will mark this as closed

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

The topic ‘New W3C Validator Errors’ is closed to new replies.