I am trying to make the class "pad1" working on my Ipad (which has a width of 768px),
So I tried this code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<style>
@media (min-width: 767px) and (max-width:991px){
.pad1 {
margin-top: 150px;
}
}
</style>
<div class="container">
<div class="row pad1">
<div class="col-sm-4" style="background-color: orange;">
AAAAA
</div>
</div>
</div>
</body>
</html>
But the padding does not work, whereas if I remove the and (max-width:991px)
part it works..
I also tried some other solution from a different post, like:
@media only screen and (min-device-width: 767px) and (max-device-width: 991px) and (orientation:portrait) {
.pad1 {
margin-top: 150px;
}
But it still not working, I am stuck here, and I absolutly need to limit the max width
for this class, do you have any solution ?
Thank you