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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 650 590" width="635" height="550" id="vday" role="img">
  <title>Large red heart with text that says Bee my valentine?</title>
  <g id="heart">
    <path d="M 297.29747,550.86823 C 283.52243,535.43191 249.1268,505.33855 220.86277,483.99412 C 137.11867,420.75228 125.72108,411.5999 91.719238,380.29088 C 29.03471,322.57071 2.413622,264.58086 2.5048478,185.95124 C 2.5493594,147.56739 5.1656152,132.77929 15.914734,110.15398 C 34.151433,71.768267 61.014996,43.244667 95.360052,25.799457 C 119.68545,13.443675 131.6827,7.9542046 172.30448,7.7296236 C 214.79777,7.4947896 223.74311,12.449347 248.73919,26.181459 C 279.1637,42.895777 310.47909,78.617167 316.95242,103.99205 L 320.95052,119.66445 L 330.81015,98.079942 C 386.52632,-23.892986 564.40851,-22.06811 626.31244,101.11153 C 645.95011,140.18758 648.10608,223.6247 630.69256,270.6244 C 607.97729,331.93377 565.31255,378.67493 466.68622,450.30098 C 402.0054,497.27462 328.80148,568.34684 323.70555,578.32901 C 317.79007,589.91654 323.42339,580.14491 297.29747,550.86823 z" />
  </g>
  <g id="message" aria-hidden="true"><text x="150" y="200" id="beemy">Bee My</text><text x="110" y="300" id="val">Valentine?</text>
  </g>
</svg>
<br><br>
<h2>
  <a target="_blank" href="https://codepen.io/cariefisher/pen/NWwvqYy">Go to step 3</a>
</h2>
              
            
!

CSS

              
                /* Most SVG files are not very accessible out of the box, so you need to add or modify the code to create a more inclusive experience. The code you add or modify will depend on how you plan to use the SVG and what AT/browsers/OS you need to support. I've done extensive research on this topic and have created resources to help you decide which method is best for your environment and user needs.

For this SVG, we only need some basic alternative information and full browser/At support, so I used pattern #5 which is: <svg> + role="img" + <title>. I could have just as easily used pattern #8 (<svg> + role="img" + <title> + aria-labelledby="[ID]") for the same support, but it is more complex to implement, meaning more chances for things to go wrong. When you can - keep it simple!

My Smashing Magazine article "Accessible SVGs: Perfect Patterns For Screen Reader Users" which highlights the testing process: https://www.smashingmagazine.com/2021/05/accessible-svg-patterns-comparison/

Updated SVG CodePen with AT testing matrix at the bottom: https://codepen.io/cariefisher/pen/QWpjded */

@import url("https://fonts.googleapis.com/css2?family=Open+Sans&family=Parisienne&display=swap");

body {
  font-family: "Parisienne", cursive;
  margin: 2rem;
}

a {
  color: #000000;
  text-decoration: underline;
  margin-left: 2rem;
  font-family: "Open Sans", sans-serif;
}

/* heart */
#heart {
  fill: #ff0000;
  stroke: #000000;
  stroke-width: 15;
  stroke-dasharray: 1, 30;
  stroke-linecap: round;
}

/* text */
#message {
  fill: #000000;
  font-size: 6rem;
  font-weight: bold;
}

              
            
!

JS

              
                
              
            
!
999px

Console