Reputation: 2275
I have a script which dynamically creates CSS. Currently, the CSS is not loaded in the head section, but is loaded in the middle of the document.
I receive this error at validation service:
Element link is missing required attribute itemprop.
This is the line error:
<link rel='stylesheet' href='stylemaker.php?loadstyle=65456465' type='text/css' media='all' />
What are the potential causes of this problem?
Upvotes: 1
Views: 2628
Reputation: 20590
And if you can't move it into the head (for whatever reason), you can always load it dynamically using jQuery like so...
<script type="text/javascript">
$('head').append('<link rel="stylesheet" href="stylemaker.php?loadstyle=65456465" type="text/css" media="all" />');
</script>
Upvotes: 1
Reputation: 182
It's not going to validate if the css is within the body tag move
<link rel='stylesheet' href='stylemaker.php?loadstyle=65456465' type='text/css' media='all' />
to the head section
Upvotes: 0