greenbandit
greenbandit

Reputation: 2275

CSS Validation Problem

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

Answers (3)

Oliver Pearmain
Oliver Pearmain

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

jayaguilar
jayaguilar

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

jrn.ak
jrn.ak

Reputation: 36619

itemprop is an HTML5 attribute for adding microdata to your elements. It is not necessary.

Upvotes: 1

Related Questions