Tuesday, March 24, 2015

how working on @media queries using modernizr , respond

in css file.

@media (min-width: 768px) and (max-width: 1024px) {
    #boroo >section> article {
        padding: 10px;
        background: red;
    }
}
@media only screen and (max-width: 768px) {
    #boroo section {
        display: block;
        padding: 10px;
        background: green;
    }
}

in html file.

<!DOCTYPE html>
<html lang="en">
    <head>
       
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link type="text/css" rel="stylesheet" href="style.css" />
    <script src="modernizr.custom.70750.js"></script>
    <!--[if lt IE 9]>
        <script src="respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div id="boroo">
        <section>
            <article>
                hello, world!
            </article>
        </section>
    </div>
</body>
</html>

No comments: