Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@media queries : getting an error in W3C CSS Validation Service

I tried to fix the width of wrapper div using @media queries according to different screen size

where i wrote these lines of code

@media screen and (min-width:768px) and (max-width:1023px) {
 #wrapper {
 width:625px;
 padding-left: 50px;
 margin:0 auto;
}
}
 @media screen and (min-width:1024px) and (max-width:2047px) {
 #wrapper {
 width:865px;
 margin:0 auto;
 padding-left: 50px;
 width: 927px;
}
}

when i checked my file in W3C CSS Validation Service i got these lines of error

Value Error : min-width Property min-width doesn't exist for media screen : 768px 768px
Value Error : max-width Property max-width doesn't exist for media screen : 1023px 1023px
Value Error : min-width Property min-width doesn't exist for media screen : 1024px 1024px
Value Error : max-width Property max-width doesn't exist for media screen : 2047px 2047px 

what is the reason behind this types of error?

like image 244
Jamna Avatar asked Jan 18 '23 15:01

Jamna


2 Answers

You did't set the options to use the CSS 3 profile instead of the default (CSS 2).

like image 84
Quentin Avatar answered Jan 29 '23 08:01

Quentin


Did you let the validator know you're using CSS3? I don't think media queries are part of the CSS2.* specification. This is the URL I use with my link: http://jigsaw.w3.org/css-validator/check/referer?profile=css3

like image 34
Tieson T. Avatar answered Jan 29 '23 06:01

Tieson T.