clip



значения свойства:


  • auto
  • rectangle
  • inherit



css/style.css
  • * {
  •  margin: 0;
  •  padding: 0;
  • }
  •  
  • .text {
  •  text-align: justify;
  • }
  •  
  • .a, .b, #div1, .c {
  •  height: 100px;
  •  width: 300px;
  •  background-color: #E3E3E3;
  •  margin: 10px;
  • }
  •  
  • .a {
  •  position: absolute;
  •  clip: auto;
  • }
  •  
  • .b {
  •  position: absolute;
  •  top: 150px;
  •  clip: rect(0, 275px, 75px, 0);
  • }
  •  
  • #div1 {
  •  position: absolute;
  •  top: 300px;
  • }
* {
 margin: 0;
 padding: 0;
}

.text {
 text-align: justify;
}

.a, .b, #div1, .c {
 height: 100px;
 width: 300px;
 background-color: #E3E3E3;
 margin: 10px;
}

.a {
 position: absolute;
 clip: auto;
}

.b {
 position: absolute;
 top: 150px;
 clip: rect(0, 275px, 75px, 0);
}

#div1 {
 position: absolute;
 top: 300px;
}


index.html
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <link href="css/style.css" rel="stylesheet" />
  •  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  • </head>
  • <body>
  •  <div class="a text">
  •   I was dreaming about Hawaii. I was dreaming about my holiday. In
  •   my dream, I was on the beach in Hawaii. The hot sun was shining on
  •   my face. The sound of the sea was all around me.
  •  </div>
  •  <div class="b text">
  •   I was dreaming about Hawaii. I was dreaming about my holiday. In
  •   my dream, I was on the beach in Hawaii. The hot sun was shining on
  •   my face. The sound of the sea was all around me.
  •  </div>
  •  <div id="div1" class="text">
  •   I was dreaming about Hawaii. I was dreaming about my holiday. In
  •   my dream, I was on the beach in Hawaii. The hot sun was shining on
  •   my face. The sound of the sea was all around me.
  •  </div>
  •  <div class="c text" >
  •   I was dreaming about Hawaii. I was dreaming about my holiday. In
  •   my dream, I was on the beach in Hawaii. The hot sun was shining on
  •   my face. The sound of the sea was all around me.
  •  </div>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("div1").style.clip = "rect(0, 250px, 50px, 0)";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".c").css({ "clip": "rect(0, 225px, 25px, 0)", "position": "absolute", "top": "450px" });
  •  });
  • </script>
  • </body>
  • </html>
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <link href="css/style.css" rel="stylesheet" />
  •  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  • </head>
  • <body>
  •  <div class="a text">
  •   I was dreaming about Hawaii. I was dreaming about my holiday. In
  •   my dream, I was on the beach in Hawaii. The hot sun was shining on
  •   my face. The sound of the sea was all around me.
  •  </div>
  •  <div class="b text">
  •   I was dreaming about Hawaii. I was dreaming about my holiday. In
  •   my dream, I was on the beach in Hawaii. The hot sun was shining on
  •   my face. The sound of the sea was all around me.
  •  </div>
  •  <div id="div1" class="text">
  •   I was dreaming about Hawaii. I was dreaming about my holiday. In
  •   my dream, I was on the beach in Hawaii. The hot sun was shining on
  •   my face. The sound of the sea was all around me.
  •  </div>
  •  <div class="c text" >
  •   I was dreaming about Hawaii. I was dreaming about my holiday. In
  •   my dream, I was on the beach in Hawaii. The hot sun was shining on
  •   my face. The sound of the sea was all around me.
  •  </div>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("div1").style.clip = "rect(0, 250px, 50px, 0)";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".c").css({ "clip": "rect(0, 225px, 25px, 0)", "position": "absolute", "top": "450px" });
  •  });
  • </script>
  • </body>
  • </html>