HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs 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 its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<div class="form">
<header class="form__header">
<h2 class="form__title">Awesome Form</h2>
<p class="form__instruction">Hey there! Let’s get to know each other. Please select one of the options below each question :D</p>
</header>
<form>
<fieldset class="form__options">
<legend class="form__question">What is your ideal match?
</legend>
<p class="form__answer">
<input type="radio" name="match" id="match_1" value="guy" checked>
<label for="match_1">
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<title>Icon Guy</title>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Guy" stroke="#FFFFFF" stroke-width="2">
<path d="M50,89 C28.4608948,89 11,71.5391052 11,50 C11,28.702089 28.8012779,11 50,11 C71.3811739,11 89,28.8647602 89,50 C89,71.5391052 71.5391052,89 50,89 Z" id="Oval"></path>
<path d="M34.5,59 C32.0147186,59 30,56.9852814 30,54.5 C30,53.1996039 30.5532818,51.9907899 31.5049437,51.1414086 C32.3241732,50.4102265 33.3788668,50 34.5,50 C36.9852814,50 39,52.0147186 39,54.5 C39,56.9852814 36.9852814,59 34.5,59 Z" id="eye"></path>
<path d="M65,59 C62.790861,59 61,57.209139 61,55 C61,53.844 61.4917357,52.7696523 62.3377558,52.0145589 C63.0660084,51.3645758 64.0033341,51 65,51 C67.209139,51 69,52.790861 69,55 C69,57.209139 67.209139,59 65,59 Z" id="eye"></path>
<path d="M13,39 C13,39 18.3404984,39.6508711 28,35 C37.6595016,30.3491289 40,26 40,26 C40,26 50.99493,36.4771587 58,38 C65.00507,39.5228413 75,42 86,36" id="Path-9"></path>
<path d="M40.0417765,73.6204199 C43.0857241,74.4024099 46.5428621,75 50,75 C53.4660267,75 57.0521869,74.3993329 60.2588177,73.6143844" id="Path-8"></path>
</g>
</g>
</svg>
Guy
</label>
</p>
<p class="form__answer">
<input type="radio" name="match" id="match_2" value="girl">
<label for="match_2">
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<title>Icon Girl</title>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Girl" stroke="#FFFFFF" stroke-width="2">
<path d="M34.5,59 C32.0147186,59 30,56.9852814 30,54.5 C30,53.1996039 30.5532818,51.9907899 31.5049437,51.1414086 C32.3241732,50.4102265 33.3788668,50 34.5,50 C36.9852814,50 39,52.0147186 39,54.5 C39,56.9852814 36.9852814,59 34.5,59 Z" id="eye"></path>
<path d="M65,59 C62.790861,59 61,57.209139 61,55 C61,53.844 61.4917357,52.7696523 62.3377558,52.0145589 C63.0660084,51.3645758 64.0033341,51 65,51 C67.209139,51 69,52.790861 69,55 C69,57.209139 67.209139,59 65,59 Z" id="eye"></path>
<path d="M40.0417765,73.6204199 C43.0857241,74.4024099 46.5428621,75 50,75 C53.4660267,75 57.0521869,74.3993329 60.2588177,73.6143844" id="Path-8"></path>
<path d="M89,85.7475102 C88.8955878,85.9344664 88.7467384,86.1876581 88.5568273,86.4896509 C88.099056,87.2175897 87.5756991,87.9455147 86.9988116,88.620918 C86.4739467,89.2354147 85.9304177,89.775041 85.375305,90.2191312 C84.8658937,90.6266602 84.2662576,91.0180436 83.595144,91.3893912 C82.7730663,91.8442719 81.887807,92.2460964 81,92.5896591 L81,40 L81,38.8469903 L79.8585786,39.0100505 C79.6614656,39.0382095 79.2577272,39.0826578 78.6591173,39.1278359 C74.3930423,39.4498038 68.7942651,39.2189264 62.1788854,38.0161301 C57.0399578,37.0817796 52.3111466,34.9372575 48.0532571,31.9450012 C45.9977761,30.5005001 44.1879399,28.9525501 42.6417908,27.4063877 C42.1025143,26.8671065 41.6354717,26.3675518 41.2428426,25.9209461 C41.0110166,25.65725 40.857774,25.472798 40.7852536,25.3808257 L40.0214746,24.4121805 L39.2317787,25.3598156 C39.1671043,25.4374249 39.0389509,25.5878658 38.8531645,25.8006757 C38.5410991,26.1581324 38.1830018,26.5571551 37.7847578,26.9872586 C36.6466602,28.2164041 35.4176003,29.445464 34.1458501,30.5900392 C32.5231664,32.0504545 30.951344,33.2630032 29.4855042,34.1425071 C29.0304384,34.4155466 28.5310795,34.7026476 27.9916336,35.002074 C27.4450358,35.3054703 26.8605908,35.6196896 26.2435123,35.9426764 C24.8349714,36.6799246 23.3234177,37.4285751 21.8115464,38.1490329 C21.2821626,38.4013022 20.7906968,38.6319577 20.3498881,38.8361138 C20.0860774,38.958295 19.8982917,39.04426 19.7992478,39.0891363 L19.211955,39.3552353 L19.211955,40 L19.211955,92.7152178 C19.1364886,92.6917076 19.0597241,92.667071 18.9817486,92.6412798 C17.9021752,92.2841999 16.8226398,91.7852694 15.8208322,91.1247895 C15.4101539,90.8540341 15.0203834,90.5606598 14.6544853,90.2439252 C14.1170024,89.7786609 13.5401931,89.1607001 12.9460031,88.4291975 C12.4227493,87.7850238 11.9163214,87.0910824 11.4478335,86.3968037 C11.2837801,86.1536836 11.1364341,85.928256 11.0082743,85.7265874 C11.0054836,85.7221962 11.0027255,85.7178532 11,85.713559 C11,85.0832089 11,84.7118308 11,81.6747405 C11,77.349481 11,77.349481 11,72.1591696 C11,71.5103806 11,71.5103806 11,70.8632812 C11,64.359375 11,64.359375 11,60 C11,52.5915787 11.1864157,47.4651466 11.4954955,44.2198091 C11.6016611,43.1050696 11.7139336,42.3079355 11.8230104,41.7807306 C11.8772398,41.5186217 11.907738,41.4205921 11.8944272,41.4472136 L11.8944272,41.4472136 L11.9531333,41.3298014 L11.979547,41.2012154 C11.9897736,41.151431 12.0134457,41.0449892 12.0517573,40.8856927 C12.1171311,40.6138739 12.199539,40.2967548 12.3001685,39.9381396 C12.5895905,38.9067215 12.9661965,37.7545848 13.4393808,36.5121684 C14.7929142,32.9582632 16.645561,29.4037594 19.0699875,26.0905275 C25.9786458,16.6491245 36.058878,11 50,11 C63.9680262,11 73.8677356,15.9210538 80.4573453,24.1261723 C82.7631629,26.9972841 84.4914427,30.0758538 85.7229878,33.1528363 C86.1530722,34.2273906 86.4899505,35.2232906 86.743943,36.1140543 C86.8941528,36.6408474 86.9824164,37.0099991 87.0191959,37.1949955 C87.0506645,37.3173809 87.0767576,37.4156648 87.1148011,37.570556 C87.1802255,37.836927 87.25369,38.161866 87.3332396,38.5463556 C87.562761,39.6557092 87.7931539,41.0150273 88.0087721,42.6321637 C88.6278466,47.2752226 89,53.0436001 89,60 L89,85.7475102 Z" id="Path-9"></path>
<path d="M19,75 C19,75 30,90 50,90 C70,90 81,75 81,75" id="Path-10"></path>
</g>
</g>
</svg>
Girl
</label>
</p>
<p class="form__answer">
<input type="radio" name="match" id="match_3" value="cat">
<label for="match_3">
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<title>Icon Cat</title>
<defs>
<path d="M30,60 C35.5228475,60 40,55.5228475 40,50 C40,44.4771525 35.5228475,40 30,40 C27.4438451,40 25.111693,40.9590696 23.3437566,42.5369956 C21.2918762,44.3683486 20,47.0333074 20,50 C20,55.5228475 24.4771525,60 30,60 Z" id="path-1"></path>
<mask id="mask-2" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="0" y="0" width="20" height="20" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<path d="M70,60 C75.5228475,60 80,55.5228475 80,50 C80,44.4771525 75.5228475,40 70,40 C67.4438451,40 65.111693,40.9590696 63.3437566,42.5369956 C61.2918762,44.3683486 60,47.0333074 60,50 C60,55.5228475 64.4771525,60 70,60 Z" id="path-3"></path>
<mask id="mask-4" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="0" y="0" width="20" height="20" fill="white">
<use xlink:href="#path-3"></use>
</mask>
</defs>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Cat" stroke="#FFFFFF" stroke-width="2">
<path d="M15.6045554,11.052094 C15.8984048,11.0790685 16.2166631,11.1118527 16.5541262,11.1509239 C17.7741019,11.2921716 18.9930349,11.4854282 20.1238677,11.7372596 C21.5364271,12.0518303 22.7030398,12.4356235 23.5244335,12.8796798 C23.5414694,12.8888901 23.5414694,12.8888901 23.5585058,12.8981029 C23.7454837,12.9992849 23.7454837,12.9992849 23.9322814,13.100615 C25.183042,13.7794963 26.5023737,14.5072598 27.8074703,15.2350739 C28.264319,15.489845 28.6867129,15.7264005 29.0643327,15.9386523 C29.2907055,16.0658914 29.451698,16.1566687 29.5369976,16.2048997 L30.0129434,16.4740134 L30.4963695,16.218581 C30.5673344,16.1810846 30.7119383,16.1070914 30.9251003,16.0018161 C31.2848257,15.824157 31.7030217,15.6256002 32.1745912,15.4113586 C33.5257414,14.7975092 35.0298711,14.1830609 36.6458832,13.6096354 C41.0121235,12.0603193 45.3587912,11.0981098 49.3883493,11.0069705 C49.5934656,11.0023313 49.7973581,11 50,11 C54.2448535,11 58.8202484,11.9774134 63.3996768,13.6091506 C65.0082003,14.1822979 66.5014458,14.796412 67.839795,15.4098861 C68.3068138,15.6239586 68.720528,15.8223395 69.0760239,15.9998165 C69.2865605,16.1049244 69.429157,16.178746 69.4989157,16.2160671 L70.0598516,16.5161694 L70.5693877,16.1352711 C70.7288369,16.0160765 71.0348348,15.7993306 71.4601611,15.5177561 C72.1731743,15.0457273 72.9520263,14.5733447 73.7686324,14.1333968 C74.6461433,13.6606362 75.5147404,13.2543551 76.3554025,12.9347134 C77.073559,12.6616515 77.9224108,12.3944661 78.8734801,12.1364647 C80.0278333,11.8233174 81.2694462,11.5400267 82.5117176,11.2922899 C82.8653336,11.2217709 83.1982991,11.1583175 83.504914,11.1022628 C83.6786981,11.3902848 83.8681602,11.7120308 84.0698708,12.0640137 C84.7606933,13.2694917 85.4517903,14.5773638 86.0960625,15.9391364 C87.0109499,17.8728978 87.7531432,19.7520794 88.2610367,21.5088656 C88.7442535,23.1802961 89,24.6918305 89,26 C89,30.3008468 88.6796109,33.4599844 88.1526222,35.645704 C87.8556082,36.8775888 87.5845534,37.4856497 87.4589164,37.6478706 L87.1692269,38.0219142 L87.2746954,38.4831138 C87.2877907,38.5403775 87.3128495,38.6519059 87.3481598,38.8121995 C87.4073036,39.0806867 87.4732841,39.3869781 87.5443883,39.7255644 C87.7476825,40.6936174 87.9510154,41.7251264 88.14067,42.7757683 C88.3125293,43.7278287 88.4647099,44.6498881 88.5919245,45.524531 C88.8551958,47.3346081 89,48.8615247 89,50 C89,71.5391052 71.5391052,89 50,89 C28.4608948,89 11,71.5391052 11,50 C11,48.9899882 11.1146583,47.627898 11.322919,46.0096575 C11.4215663,45.2431417 11.5391496,44.4353669 11.6716874,43.6012995 C11.8199275,42.6684169 11.9788584,41.7519204 12.1377591,40.8913635 C12.1933364,40.5903744 12.2449089,40.3180348 12.2911379,40.0792614 C12.3187384,39.9367046 12.3383263,39.8374968 12.3485635,39.7865461 L12.4050477,39.5054239 L12.3039793,39.2370858 C12.2625868,39.1271881 12.1841292,38.8977551 12.0807502,38.558328 C11.9052063,37.9819599 11.7288868,37.3144182 11.5638764,36.5652785 C10.8593638,33.3668246 10.5858251,29.8143853 10.9939861,26.109506 C11.047714,25.6218179 11.1161012,25.123161 11.1986391,24.6142671 C11.6129201,22.0599833 12.3682534,19.3202237 13.3666834,16.5201769 C13.9213566,14.9646241 14.5159533,13.4887989 15.11019,12.1415846 C15.2869676,11.740806 15.4527933,11.3763954 15.6045554,11.052094 Z" id="Oval"></path>
<use id="eye-base" mask="url(#mask-2)" stroke-dasharray="3,1" xlink:href="#path-1"></use>
<use id="eye-base" mask="url(#mask-4)" stroke-dasharray="3,1" xlink:href="#path-3"></use>
<path d="M30,59 C25.0294373,59 21,54.9705627 21,50 C21,47.400039 22.1071965,44.9810283 24.0096341,43.2830567 C25.6476564,41.8210822 27.7586614,41 30,41 C34.9705627,41 39,45.0294373 39,50 C39,54.9705627 34.9705627,59 30,59 Z" id="eye"></path>
<path d="M70,59 C65.0294373,59 61,54.9705627 61,50 C61,47.400039 62.1071965,44.9810283 64.0096341,43.2830567 C65.6476564,41.8210822 67.7586614,41 70,41 C74.9705627,41 79,45.0294373 79,50 C79,54.9705627 74.9705627,59 70,59 Z" id="eye"></path>
<g id="Mouth" transform="translate(40.000000, 58.000000)">
<path d="M4,1 L16,1" id="Path-2"></path>
<path d="M10,1 L10,9" id="Path-3"></path>
<path d="M0,9 C0,9 2,11 6,11 C9,11 10,9 10,9" id="Path-4"></path>
<path d="M10,9 C10,9 12,11 16,11 C19,11 20,9 20,9" id="Path-4" transform="translate(15.000000, 10.000000) scale(-1, 1) translate(-15.000000, -10.000000) "></path>
</g>
<path d="M88,59 L94,59" id="Path-5"></path>
<path d="M86,65 L94,65" id="Path-6"></path>
<path d="M83,71 L94,71" id="Path-7"></path>
<path d="M6,59 L12,59" id="Path-5"></path>
<path d="M6,65 L14,65" id="Path-6"></path>
<path d="M6,71 L17,71" id="Path-7"></path>
</g>
</g>
</svg>
Cat
</label>
</p>
<p class="form__answer">
<input type="radio" name="match" id="match_4" value="bacon">
<label for="match_4">
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<title>Icon Bacon</title>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Bacon" stroke="#FFFFFF" stroke-width="2">
<path d="M26.7421991,11 L44.6934895,11 C44.4642635,11.8890038 44.2357088,12.8521738 44.0217879,13.8601319 C43.6686334,15.5241344 43.3893164,17.1510083 43.2115625,18.6847916 C43.0733938,19.8770066 43,20.9868603 43,22 C43,24.2953026 43.2842672,25.4906009 44.0735181,27.4335995 C44.0844886,27.460605 44.0844886,27.460605 44.0954191,27.4875117 C44.7810245,29.1753309 45,30.0881983 45,32 C45,33.9378028 44.7782311,34.8618399 44.0715233,36.6286093 C43.2782311,38.6118399 43,39.7711361 43,42 C43,44.2288639 43.2782311,45.3881601 44.0715233,47.3713907 C44.7782311,49.1381601 45,50.0621972 45,52 C45,53.9378028 44.7782311,54.8618399 44.0715233,56.6286093 C43.2782311,58.6118399 43,59.7711361 43,62 C43,64.2288639 43.2782311,65.3881601 44.0715233,67.3713907 C44.7782311,69.1381601 45,70.0621972 45,72 C45,73.9648865 44.746648,75.105138 44.0622346,76.9533258 C43.9836128,77.1650796 43.9373676,77.2895732 43.9041387,77.3796045 C43.2582243,79.1296615 43,80.2671404 43,82 C43,83.9585976 43.3955175,85.955804 44.052921,87.8954052 C44.1840226,88.2822071 44.320539,88.6511962 44.4595146,89 L26.5929514,89 C26.5892869,88.9927054 26.5855915,88.9853358 26.581868,88.9778913 C26.3649897,88.5442782 26.1465065,88.0375185 25.9417268,87.4642166 C25.35344,85.8172472 25,83.9792187 25,82 C25,80.1782532 25.2200313,79.2521617 25.8993173,77.520192 C25.9150979,77.4799625 25.9150979,77.4799625 25.9309539,77.4395415 C26.7154768,75.4393193 27,74.230284 27,72 C27,69.7711361 26.7217689,68.6118399 25.9284767,66.6286093 C25.2217689,64.8618399 25,63.9378028 25,62 C25,60.0621972 25.2217689,59.1381601 25.9284767,57.3713907 C26.7217689,55.3881601 27,54.2288639 27,52 C27,49.7711361 26.7217689,48.6118399 25.9284767,46.6286093 C25.2217689,44.8618399 25,43.9378028 25,42 C25,40.0621972 25.2217689,39.1381601 25.9284767,37.3713907 C26.7217689,35.3881601 27,34.2288639 27,32 C27,29.8871932 26.7324112,28.7812593 26.0172482,27.1476206 C25.9663262,27.0314769 25.9663262,27.0314769 25.9163155,26.9172826 C25.2445626,25.3801954 25,24.3093799 25,22 C25,21.7371426 25.0042052,21.4703618 25.0125216,21.1998453 C25.0822756,18.9308899 25.4337302,16.4859615 25.9765721,14.0224508 C26.1910602,13.0490666 26.4208368,12.1406578 26.6503105,11.3229001 C26.6827758,11.207206 26.713475,11.0994592 26.7421991,11 Z" id="Rectangle"></path>
<path d="M37,20 C37,20 39,25 39,30 C39,35 37,35 37,40 C37,45 39,45 39,50 C39,55 37,55 37,60 C37,65 39,65 39,70 C39,75 37,80 37,80" id="Path-11"></path>
<path d="M31,20 C31,20 33,25 33,30 C33,35 31,35 31,40 C31,45 33,45 33,50 C33,55 31,55 31,60 C31,65 33,65 33,70 C33,75 31,80 31,80" id="Path-11"></path>
<path d="M56.7421991,11 L74.6934895,11 C74.4642635,11.8890038 74.2357088,12.8521738 74.0217879,13.8601319 C73.6686334,15.5241344 73.3893164,17.1510083 73.2115625,18.6847916 C73.0733938,19.8770066 73,20.9868603 73,22 C73,24.2953026 73.2842672,25.4906009 74.0735181,27.4335995 C74.0844886,27.460605 74.0844886,27.460605 74.0954191,27.4875117 C74.7810245,29.1753309 75,30.0881983 75,32 C75,33.9378028 74.7782311,34.8618399 74.0715233,36.6286093 C73.2782311,38.6118399 73,39.7711361 73,42 C73,44.2288639 73.2782311,45.3881601 74.0715233,47.3713907 C74.7782311,49.1381601 75,50.0621972 75,52 C75,53.9378028 74.7782311,54.8618399 74.0715233,56.6286093 C73.2782311,58.6118399 73,59.7711361 73,62 C73,64.2288639 73.2782311,65.3881601 74.0715233,67.3713907 C74.7782311,69.1381601 75,70.0621972 75,72 C75,73.9648865 74.746648,75.105138 74.0622346,76.9533258 C73.9836128,77.1650796 73.9373676,77.2895732 73.9041387,77.3796045 C73.2582243,79.1296615 73,80.2671404 73,82 C73,83.9585976 73.3955175,85.955804 74.052921,87.8954052 C74.1840226,88.2822071 74.320539,88.6511962 74.4595146,89 L56.5929514,89 C56.5892869,88.9927054 56.5855915,88.9853358 56.581868,88.9778913 C56.3649897,88.5442782 56.1465065,88.0375185 55.9417268,87.4642166 C55.35344,85.8172472 55,83.9792187 55,82 C55,80.1782532 55.2200313,79.2521617 55.8993173,77.520192 C55.9150979,77.4799625 55.9150979,77.4799625 55.9309539,77.4395415 C56.7154768,75.4393193 57,74.230284 57,72 C57,69.7711361 56.7217689,68.6118399 55.9284767,66.6286093 C55.2217689,64.8618399 55,63.9378028 55,62 C55,60.0621972 55.2217689,59.1381601 55.9284767,57.3713907 C56.7217689,55.3881601 57,54.2288639 57,52 C57,49.7711361 56.7217689,48.6118399 55.9284767,46.6286093 C55.2217689,44.8618399 55,43.9378028 55,42 C55,40.0621972 55.2217689,39.1381601 55.9284767,37.3713907 C56.7217689,35.3881601 57,34.2288639 57,32 C57,29.8871932 56.7324112,28.7812593 56.0172482,27.1476206 C55.9663262,27.0314769 55.9663262,27.0314769 55.9163155,26.9172826 C55.2445626,25.3801954 55,24.3093799 55,22 C55,21.7371426 55.0042052,21.4703618 55.0125216,21.1998453 C55.0822756,18.9308899 55.4337302,16.4859615 55.9765721,14.0224508 C56.1910602,13.0490666 56.4208368,12.1406578 56.6503105,11.3229001 C56.6827758,11.207206 56.713475,11.0994592 56.7421991,11 Z" id="Rectangle"></path>
<path d="M67,20 C67,20 69,25 69,30 C69,35 67,35 67,40 C67,45 69,45 69,50 C69,55 67,55 67,60 C67,65 69,65 69,70 C69,75 67,80 67,80" id="Path-11"></path>
<path d="M61,20 C61,20 63,25 63,30 C63,35 61,35 61,40 C61,45 63,45 63,50 C63,55 61,55 61,60 C61,65 63,65 63,70 C63,75 61,80 61,80" id="Path-11"></path>
</g>
</g>
</svg>
Bacon
</label>
</p>
</fieldset>
<button class="form__button" type="submit">Submit your info</button>
</form>
</div>
<footer>
<h2 class="footer__title">About this pen:</h2>
<h3 class="footer__subtitle">Properly styling a form</h3>
<p class="footer__parragraph">I made this pen to practice writing more semantic and accesible html. I previously made a pen about: <a target="_blank" href="https://codepen.io/AngelaVelasquez/full/Eypnq/">CSS Radio buttons</a>. That's why I think a form could be a great start for me to practice and learn how to write better HTML.</p>
<p class="footer__parragraph">References:</p>
<ul class="footer__list">
<li><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/How_to_structure_an_HTML_form">Definitions and usage on MDN</a></li>
<li><a target="_blank" href="https://codepen.io/SaraSoueidan/pen/40433575e3d0d026c7d9c00eb45522a1?editors=110">Styling checkboxes with SVG by Sara Soueidan</a></li>
</ul>
<p class="copyright">Awesome pen made by <a target="_blank" href="https://codepen.io/AngelaVelasquez">Angela</a></p>
</footer>
/* Font from Google fonts */
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,900');
/* Color palette */
$background-color: #00171F;
$footer-color: #003459;
$details-color: #00A7E1;
$font-color: #FAFAFA;
$submit-color: #00703f;
$submit-color-darker: #00824A;
/* Basic styles */
html, body {
height: 100%;
font-family: 'Source Sans Pro', sans-serif;
background-color: $background-color;
color: $font-color;
}
/* Form Styles */
.form {
max-width: 610px;
margin: 60px auto;
}
.form__header {
margin-bottom: 40px;
border-bottom: 1px dashed rgba($font-color,.15);
}
.form__title {
font-size: 45px;
margin: 10px 0;
}
.form__instruction {
font-size: 22px;
}
.form__options {
border: none;
padding: 0;
}
.form__question {
font-size: 25px;
}
.form__answer {
display: inline-block;
box-sizing: border-box;
width: 23%;
margin: 20px 1% 20px 0;
height: 180px;
vertical-align: top;
font-size: 22px;
text-align: center;
}
label {
border: 1px solid rgba($font-color,.15);
box-sizing: border-box;
display: block;
height: 100%;
width: 100%;
padding: 10px 10px 30px 10px;
cursor: pointer;
opacity: .5;
transition: all .5s ease-in-out;
&:hover, &:focus, &:active {
border: 1px solid rgba($font-color,.5);
}
}
.form__button {
height: 40px;
border: none;
background-color: $submit-color;
color: $font-color;
text-transform: uppercase;
font-family: 'Source Sans Pro', sans-serif;
padding: 0 20px;
border-radius: 20px;
font-weight: 900;
cursor: pointer;
margin: 40px 0;
transition: all .25s ease-in-out;
&:hover, &:focus {
background-color: $submit-color-darker;
text-shadow: 1px 1px 1px rgba(0,0,0,.25);
outline: none;
}
}
/* Input style */
input[type="radio"] {
opacity: 0;
width: 0;
height: 0;
}
input[type="radio"]:active ~ label {
opacity: 1;
}
input[type="radio"]:checked ~ label {
opacity: 1;
border: 1px solid $font-color;
}
/* Footer Styles */
footer {
background-color: $footer-color;
position: relative;
padding: 20px;
h2, h3, p, ul {
max-width: 610px;
margin: 20px auto;
}
}
.footer__title {
font-size: 30px;
margin-top: 40px;
color: $background-color;
}
.footer__subtitle {
font-size: 22px;
}
.footer__parragraph {
line-height: 1.5em;
font-size: 22px;
a {
color: $details-color;
}
}
.footer__list {
@extend .footer__parragraph;
}
.copyright {
@extend .footer__parragraph;
text-align: center;
border-top: 1px dashed rgba($font-color,.15);
padding: 10px 0;
margin: 40px auto;
}
Also see: Tab Triggers