Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 812
Yunan Avatar asked Dec 13 '25 09:12

Yunan


1 Answers

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>
like image 189
Deepak Kumar Avatar answered Dec 15 '25 01:12

Deepak Kumar