How to set @media (min-width) and (max-width) for both chrome and firefox

24,535

Working all browser

.mm {
    background: cyan;
    width: 200px;
    line-height: 200px;
    font-weight: 700;
    text-align: center;
    font-size: 50px;
}


@media only screen and (min-width:768px) and (max-width:990px){
	.mm{
		background:red;	
	}
	
}
   

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<div class="mm">12</div>
</body>
</html>

Share:
24,535
Yunan
Author by

Yunan

Updated on July 09, 2022

Comments

  • Yunan
    Yunan almost 2 years

    I want to set some CSS rules for tablet devices, to do so i tried so set these rules for screen between 769px and 991px. When i do :

    @media (min-width: 769px) and (max-width: 991px) {
        .img-circle {
            width: 50%;
        }
    }

    It work with chrome but firefox don't and when i tried adding brackets :

    @media ((min-width: 769px) and (max-width: 991px)) {
        .img-circle {
            width: 50%;
        }
    }

    It work with forefox but no more with chrome ! If you have an idea :) i can't figure it out

    Regards