1

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?

1
  • 2
    Style sheet links in the body tag are not valid in HTML - you need to put the element into the head section Commented May 17, 2011 at 18:09

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

but isn't validating. what can I do?
@greenbandit: Ignore the warning? It's not a fatal flaw.
1

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>

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.