Forums

Stray </style> Tag (5 posts)

  1. andymelton
    Member
    Posted 3 years ago #

    I am trying to validate one of my blogs and W3C keeps reporting a stray </style> tag. I am having trouble finding this so I can remove it. I've disabled my plugins and it still comes back so I'm fairly certain it's not the plugins. W3C Validator states the following:

    Line 50, Column 8: end tag for element "style" which is not open .

    </style>

    The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

    Below is the W3C's output of my front page up to line 50 where the stray </style> tag is.

    `# <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    # <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
    #
    # <head profile="http://gmpg.org/xfn/11">
    # <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    #
    # <title>Tech Butter </title><meta name="verify-v1" content="qJp5Z/WmzMfxGnxrx+1ftzuXEbKRKINpbPLry4n7wn0=" />
    #
    # <meta name="generator" content="WordPress 2.5.1" /> <!-- leave this for stats -->
    #
    # <link rel="stylesheet" href="http://techbutter.com/wp-content/themes/techbutter2/style.css" type="text/css" media="screen" />
    # <link rel="alternate" type="application/rss+xml" title="Tech Butter RSS Feed" href="http://techbutter.com/feed/" />
    # <link rel="pingback" href="http://techbutter.com/xmlrpc.php" />
    #
    # <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://techbutter.com/xmlrpc.php?rsd" />
    # <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://techbutter.com/wp-includes/wlwmanifest.xml" />
    # <meta name="generator" content="WordPress 2.5.1" />
    #
    # <link rel="stylesheet" href="http://techbutter.com/wp-content/plugins/deans_code_highlighter/geshi.css" type="text/css" />
    # <!-- Lightbox Plugin 0.7/2.03.3 -->
    # <link rel="stylesheet" href="http://techbutter.com/wp-content/plugins/lightbox/css/lightbox.css" type="text/css" media="screen" />
    # <script type="text/javascript"><!--
    # var fileLoadingImage = 'http://techbutter.com/wp-content/plugins/lightbox/images/loading.gif';
    # var fileBottomNavCloseImage = 'http://techbutter.com/wp-content/plugins/lightbox/images/closelabel.gif';
    # var resizeSpeed = 7;
    # var borderSize = 10;
    # var animate = true;
    # var overlayOpacity = 0.8;
    # //--></script>
    # <script type="text/javascript" src="http://techbutter.com/wp-content/plugins/lightbox/js/prototype.js"></script>
    # <script type="text/javascript" src="http://techbutter.com/wp-content/plugins/lightbox/js/effects.js"></script>
    # <script type="text/javascript" src="http://techbutter.com/wp-content/plugins/lightbox/js/lightbox.js"></script>
    # <!-- /Lightbox Plugin -->
    # <!-- WordPress StatCounter Plugin by Luke Stevenson [http://blog.lucanos.com] -->
    # <!-- Start of StatCounter Code -->
    # <script type="text/javascript">
    # <!--
    # var sc_project=2790125;
    # var sc_invisible=1;
    # var sc_partition=28;
    # var sc_security="e1fa4880";
    # var sc_remove_link=1;
    # //-->
    # </script>
    # <script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
    # <!-- End of StatCounter Code -->
    #
    # <link rel="stylesheet" type="text/css" href="http://techbutter.com/wp-content/themes/techbutter2/style.css" />
    #
    # </style>`

    Any help or suggestions will be greatly appreciated.

  2. Michael Fields
    Theme Wrangler
    Posted 3 years ago #

    I would look in your active theme in the following files:
    header.php & functions.php

  3. ClaytonJames
    Member
    Posted 3 years ago #

    I believe you can see it quite clearly in the source. I may be mistaken, but I think I see it sitting all by itself directly below this stylesheet link;

    <link rel="stylesheet" type="text/css" href="http://techbutter.com/wp-content/themes/techbutter2/style.css" />

    ...around line 53 or so in my view.

    I would, as mfields suggests, probably start by taking a peek in header.php in the techbutter2 theme.

  4. andymelton
    Member
    Posted 3 years ago #

    Thank you both for your responses. I had already looked in the header.php file before making this post as well as all other included files. I did not think to look in the functions.php file. I removed the contents of that file and uploaded it to the server and I am still receiving the stray </style> closing tag.

    I know where it is in the W3C ouput but I cannot find it anywhere in the source code. I've looked through all the files and plugins.

    I apologize for not responding sooner. I thought I was suppose to get an email notification of new responses.

  5. andymelton
    Member
    Posted 3 years ago #

    I got that error taken care of. Disabling the plugin wasn't enough to realize that one of them was causing a problem. It was Contact Form ][. The extra </style> was lurking in there. I don't know how it got there. It seems as though I had to add something to the plugin once upon a time so it would style correctly. I just can't remember if that's what it was or not. I guess that is what you get for recycling themes from other websites and re-styling them!

    I downloaded the plugin and re-installed it. The error in the validation output went away.

    At least I've got this one figured out. From 10 validation errors down to 8 now! Thanks for your help everyone!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.