<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: bodybody123</title>
    <description>The latest articles on DEV Community by bodybody123 (@bodybody123).</description>
    <link>https://dev.to/bodybody123</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F644564%2F8b1f1b47-5a0f-48a1-87ad-5e92ff1019ed.png</url>
      <title>DEV Community: bodybody123</title>
      <link>https://dev.to/bodybody123</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bodybody123"/>
    <language>en</language>
    <item>
      <title>How to make cutout corner in CSS</title>
      <dc:creator>bodybody123</dc:creator>
      <pubDate>Thu, 05 Aug 2021 06:05:22 +0000</pubDate>
      <link>https://dev.to/bodybody123/how-to-make-cutout-in-css-48b</link>
      <guid>https://dev.to/bodybody123/how-to-make-cutout-in-css-48b</guid>
      <description>&lt;h1&gt;
  
  
  let's just get to the point shall we
&lt;/h1&gt;

&lt;p&gt;first we need to make container and some boxes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="container"&amp;gt;
    &amp;lt;div class="box"&amp;gt;1&amp;lt;/div&amp;gt;
    &amp;lt;div class="box"&amp;gt;2&amp;lt;/div&amp;gt;
    &amp;lt;div class="box"&amp;gt;3&amp;lt;/div&amp;gt;
    &amp;lt;div class="box"&amp;gt;4&amp;lt;/div&amp;gt;
    &amp;lt;div class="box"&amp;gt;5&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then in the CSS we need to copy the following code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
    display: flex;
    flex-direction: row;

.box {
    margin: 10px;

    /* Simple trick to center content */
    display: flex;
    justify-content: center;
    align-items: center;

    width: 64px;
    height: 64px;
    padding: 4px;
    background: #f00;

    /*This is the meat of the cutout */
    clip-path: polygon(
       15% 0%,
       85% 0%, 
       100% 15%, 
       100% 85%, 
       85% 100%, 
       15% 100%, 
       0% 85%, 
       0% 15%);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if you want to add like box-shadow you first need to make container for each box&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
        &amp;lt;div class="box-container"&amp;gt;
            &amp;lt;div class="box"&amp;gt;1&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;

...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then in the css&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.box-container {
    filter: drop-shadow(4px 4px 4px rgba(0, 0, 0, 1));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the result:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5cmgsgjpognlm1md3bb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5cmgsgjpognlm1md3bb.png" alt="box cutout with drop shadow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and that's it, the clip-path is can do more than just a cut out i found this tool that'll prolly help you with clip-path in general &lt;a href="https://bennettfeely.com/clippy/" rel="noopener noreferrer"&gt;https://bennettfeely.com/&lt;/a&gt;&lt;br&gt;
firefox has tool too to help you with by opening dev tools &lt;code&gt;ctrl+shift+c&lt;/code&gt;(then click the element you want to edit)&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhkde6s3wtwtah7g3mqd2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhkde6s3wtwtah7g3mqd2.jpg" alt="Firefox dev tools"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>beginners</category>
      <category>material</category>
    </item>
  </channel>
</rss>
