qadenza
qadenza

Reputation: 9293

wrong css media syntax

What is wrong here?

<link rel="stylesheet" href='index-02.css'
      media="screen and (min-width: 481px and max-width:959px)">

Validating the code on this page I got an error:

Error: Bad value screen and (min-width: 481px and max-width:959px) for attribute media on element link: Expected whitespace or ) but saw a instead.

Upvotes: 0

Views: 38

Answers (2)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521279

Your syntax is slightly off. Each expression needs to be contained within parentheses:

<link rel="stylesheet" href='index-02.css'
      media="screen and (min-width: 481px) and (max-width:959px)">

From the documentation:

Parentheses are required around expressions; failing to use them is an error.

Upvotes: 1

rmarif
rmarif

Reputation: 548

Try this

screen and (min-width: 481px)and(max-width: 959px)

Upvotes: 1

Related Questions