/ * applying this class to the block we make it rounded * /
  .rounded {
     background: #feb;
     padding: 20px;
     margin: 30px auto 10px auto;
     text-align: center;
     overflow: hidden;
  }
  .rounded: before, .rounded :: before, .rounded: after, .rounded :: after {
     display: block;
     height: 20px;
     content: url (img / corners.gif);
     background: url (img / corners.gif) top right no-repeat;
     margin: -30px -30px 10px -30px;
     padding: 0;
     text-align: left;
     line-height: 0;
     font-size: 0;
     overflow: hidden;
  }
  .rounded: after, .rounded :: after {
     margin: 10px -30px -30px -30px;
  }   <! DOCTYPE html PUBLIC '- // W3C // DTD XHTML 1.0 Strict // EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
 <html>
  <head>
   <title> Rounded corners </ title>
   <meta http-equiv = "Content-type" content = "text / html; charset = utf-8" />
   <link type = "text / css" rel = "stylesheet" media = "screen" href = "styles.css" />
   <! - [if lt IE 8]> 
   <script src = "http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type = "text / javascript"> </ script> 
   <! [endif] ->
  </ head>
  <body>
   <div class = "rounded">
     This block should have rounded corners.
   </ div>
  </ body>
 </ html> Source: https://habr.com/ru/post/30286/
All Articles