Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <h1>CSS Shapes: shape-outside - infinitely thin spikes 2</h1>
<p>Shows the behaviour of the shape-outside property from the CSS Shapes specification, with regard to infinitely thin spikes.</p>
<p>See also:
  <ul>
    <li><a href="https://codepen.io/karaken12/pen/oXPMzY?editors=110" target="_blank">CSS Shapes: fill-rule with self intersection</a></li>
    <li><a href="https://codepen.io/karaken12/pen/BNqByK?editors=110" target="_blank">CSS Shapes: shape-outside - infinitely thin spikes</a></li>
    <li><a href="https://codepen.io/karaken12/pen/bdmbwg?editors=110" target="_blank">CSS Shapes: shape-outside - infinitely thin spikes 2</a></li>
  </ul>
</p>

<h2>SVG images</h2>
<div class="svg">
  <h3>Case 1</h3>
  <p>Polygon with triangular spike</p>
  <svg width="100" height="100">
    <polygon points="0 0,50 0,50 100,75 100,75 50,70 100,0 100" stroke="blue">
    </polygon>
  </svg>
</div>

<div class="svg">
  <h3>Case 2</h3>
  <p>Polygon with infinitely-thin spike</p>
  <svg width="100" height="100">
    <polygon points="0 0,50 0,50 100,75 100,75 50,75 100,0 100" stroke="blue">
    </polygon>
  </svg>
</div>

<h2>Floats using shape-outside</h2>
<div class="float">
  <h3>Case 1</h3>
  <p>Polygon with triangular spike</p>
  <div class="case1"></div>
  <p>text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text</p>
</div>

<div class="float">
  <h3>Case 2</h3>
  <p>Polygon with infinitely-thin spike</p>
  <div class="case2"></div>
  <p>text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text</p>
</div>

<h2>Floats using shape-outside and 10px margin</h2>
<div class="float">
  <h3>Case 1</h3>
  <p>Polygon with triangular spike</p>
  <div class="case1 margin"></div>
  <p>text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text</p>
</div>

<div class="float">
  <h3>Case 2</h3>
  <p>Polygon with infinitely-thin spike</p>
  <div class="case2 margin"></div>
  <p>text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text</p>
</div>

              
            
!

CSS

              
                .case1, .case2, .case3 {
  float: left;
  width: 100px;
  height: 100px;
}

.case1 {
  shape-outside: polygon(0px 0px,50px 0px,50px 100px,75px 100px,75px 50px,70px 100px,0px 100px);
}

.case2 {
  shape-outside: polygon(0px 0px,50px 0px,50px 100px,75px 100px,75px 50px,75px 100px,0px 100px);
}

.margin {
  shape-margin: 10px;
}

////////////////////////////////////////////////////

// Background images to show the polygons.
// These are exactly as in the SVG versions.
$bgcolor: red;
$case1bg: url("data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMTAwcHgiIGhlaWdodD0iMTAwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICA8cG9seWdvbiBwb2ludHM9IjAgMCw1MCAwLDUwIDEwMCw3NSAxMDAsNzUgNTAsNzAgMTAwLDAgMTAwIiBzdHJva2U9ImJsdWUiPg0KICAgIDwvcG9seWdvbj4NCjwvc3ZnPg==");
$case2bg: url("data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMTAwcHgiIGhlaWdodD0iMTAwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICA8cG9seWdvbiBwb2ludHM9IjAgMCw1MCAwLDUwIDEwMCw3NSAxMDAsNzUgNTAsNzUgMTAwLDAgMTAwIiBzdHJva2U9ImJsdWUiPg0KICAgIDwvcG9seWdvbj4NCjwvc3ZnPg==");
.case1 {
  background: $case1bg, $bgcolor;
}
.case2 {
  background: $case2bg, $bgcolor;
}

svg {
  background: $bgcolor;
}

// Some styles to make to examples look better. 
.svg, .float {
  float: left;
  margin:10px;
  width: 300px;
}

h2 {
  clear:left;
  margin: 0;
}

              
            
!

JS

              
                
              
            
!
999px

Console