Wednesday, 27 April 2022

HTML + CSS #24 | Media Queries | Media Query for different Devices | HTML & CSS | Web Development

 <!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .box{
     font-size: 100px;
        background-color: aqua;
        text-align: center;
        display: none;

    }
    @media (max-width:500px){
        #box1{
            display: block;
        }
    }
    @media (min-width:501px) and (max-width:800px){
        #box2{
            display: block;
        }
    }
    @media  (min-width:801px) and (max-width:1200px){
        #box3{
            display: block;
        }
    }
    @media (min-width:1201px){
        #box4{
            display: block;
        }
    }
   


</style>
<body>
    <div class="box" id="box1">Phone</div>
    <div class="box" id="box2">Tablet</div>
    <div class="box" id="box3">Computer</div>
    <div class="box" id="box4">LED</div>
</body>
</html>



No comments:

Post a Comment

JAVASCRIPT + CSS + HTML #42 | Event & Event Listener |How to Target using JS | Web Development

  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < met...