Je fais mes tests sous FF 13. Ta page de test ne fonctionne pas pour la règle
@media (max-width: 480px), la DIV ne devient pas rouge.
Voici mon code (j'utilise CodeIgniter) :
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>
Accueil
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<meta name="keywords" content="">
<link href="<?php echo base_url(); ?>bootstrap_2_0_4/css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body { padding-top: 60px; padding-bottom: 40px; }
.sidebar-nav { padding: 9px 0; }
</style>
<link href="<?php echo base_url(); ?>bootstrap_2_0_4/css/bootstrap-responsive.css" rel="stylesheet">
<link href="<?php echo base_url(); ?>css/defaut/style.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="shortcut icon" href="<?php echo base_url(); ?>ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo base_url(); ?>ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo base_url(); ?>ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php echo base_url(); ?>ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php echo base_url(); ?>ico/apple-touch-icon-57-precomposed.png">
</head>
<body>
<div class="container">
<div id="test">
aaaaaaaa
<br />
bbbbbbbb
</div>
</div>
<script src="<?php echo base_url(); ?>jq/jquery_1_7_2/jquery.min.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-transition.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-alert.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-modal.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-dropdown.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-scrollspy.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-tab.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-tooltip.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-popover.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-button.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-collapse.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-carousel.js"></script>
<script src="<?php echo base_url(); ?>bootstrap_2_0_4/assets/js/bootstrap-typeahead.js"></script>
</body>
</html>
Et voici mon css (je l'ai modifié, mais la règle
@media (max-width: 480px) ne marche toutjours pas) :
/* ************* */
/* MEDIA QUERIES */
/* ************* */
@media (max-width: 979px)
{
div#principal{ background-color: blue; !important; }
}
@media (min-width: 1200px)
{
div#principal{ background-color: red; !important; }
}
@media (max-width: 480px)
{
div#principal{ background-color: #4335b0 !important; }
}
@media (min-width: 481px) and (max-width: 767px)
{
div#principal{ background-color: #e7a198 !important; }
}
@media (min-width: 768px) and (max-width: 979px)
{
div#principal{ background-color: yellow !important; }
}
@media (min-width: 980px) and (max-width: 1199px)
{
div#principal{ background-color: green !important; }
}