It is in general a great feature to include a Form as RAW-HTML and not as an iframe into a website. That feature allows to control the look and have it work properly with the UI on the website.
However there are quite some stylings included by default, which are have to be overwritten on the page in order to retain the targeted look. Fieldsets are set to a specific layout and include margins/paddings – plainly styling which you may not need at all and are bound to overried in order to retain your sites look.
Is there an way (an option for example) to get rid of all styling – and only inlcude the required html & javascript for the forms to work? One to not add style-tags.
I understand that for validation of the form and possibly a determened flow it is required to show/hide elements – and sure it makes sense to have some minimal styling for those purposes.
Yet adding unrequired 32kb of styling is surely a bit much.
Hi, @ARaminger Thanks for your question. Here’s a link to the available options — How to customize the form embed code.
Your feedback is valuable. If you have a moment, adding your suggestion to the Ideas Community and getting some upvotes will be very helpful in getting your suggestion in front of the Product team. If you add a link back to your Idea post, I’ll be sure to give it an upvote to help get the ball rolling.
Best,
Jaycee
Hi @Jaycee_Lewis , thanks for the info there. That page I also found. Yet there is no solution present for the described issue. The attribute ‘css’ seems not to be used when having ‘raw-html’ enabled – at least my styling got not applied - and it doesn’t occur anywhere in the compiled markup – execpt as an attribute within a hidden input).
For each instance a separate <style> tag gets added - with quite some re-occuring styling (each ~ 10kb in size). So if you have n-forms on your page, you end up with n-times additional css – quite some part in it which you wouldn’t want to have there at all.
Code inserted (example):
.fn-date-picker.pika-single{z-index:9999;display:block;position:relative;color:#333;background:#fff;border:1px solid #ccc;border-bottom-color:#bbb;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;*zoom:1}.fn-date-picker.pika-single.is-hidden{display:none}.fn-date-picker.pika-single.is-bound{position:absolute;box-shadow:0 5px 15px -5px rgba(0,0,0,.5)}.fn-date-picker.pika-single:after,.fn-date-picker.pika-single:before{content:" ";display:table}.fn-date-picker.pika-single:after{clear:both}.fn-date-picker .pika-lendar{float:left;width:240px;margin:8px}.fn-date-picker .pika-title{position:relative;text-align:center}.fn-date-picker .pika-title select{cursor:pointer;position:absolute;z-index:9998;margin:0;left:0;top:5px;filter:alpha(opacity=0);opacity:0}.fn-date-picker .pika-label{display:inline-block;*display:inline;position:relative;z-index:9999;overflow:hidden;margin:0;padding:5px 3px;font-size:14px;line-height:20px;font-weight:700;background-color:#fff}.fn-date-picker .pika-next,.fn-date-picker .pika-prev{display:block;cursor:pointer;position:relative;outline:none;border:0;padding:0;width:20px;height:30px;text-indent:20px;white-space:nowrap;overflow:hidden;background-color:transparent;background-position:50%;background-repeat:no-repeat;background-size:75% 75%;opacity:.5;*position:absolute;*top:0}.fn-date-picker .pika-next:hover,.fn-date-picker .pika-prev:hover{opacity:1}.fn-date-picker .pika-next.is-disabled,.fn-date-picker .pika-prev.is-disabled{cursor:default;opacity:.2}.fn-date-picker .is-rtl .pika-next,.fn-date-picker .pika-prev{float:left;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==");*left:0}.fn-date-picker .is-rtl .pika-prev,.fn-date-picker .pika-next{float:right;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=");*right:0}.fn-date-picker .pika-select{display:inline-block;*display:inline}.fn-date-picker .pika-table{width:100%;border-collapse:collapse;border-spacing:0;border:0}.fn-date-picker .pika-table td,.fn-date-picker .pika-table th{width:14.285714285714286%;padding:0}.fn-date-picker .pika-table th{color:#999;font-size:12px;line-height:25px;font-weight:700;text-align:center}.fn-date-picker .pika-table abbr{border-bottom:none;cursor:help}.fn-date-picker .pika-button{cursor:pointer;display:block;-moz-box-sizing:border-box;box-sizing:border-box;outline:none;border:0;margin:0;width:100%;padding:5px;color:#666;font-size:12px;line-height:15px;text-align:right;background:#f5f5f5}.fn-date-picker .pika-button:hover{color:#fff!important;background:#ff8000!important;box-shadow:none!important;border-radius:3px!important}.fn-date-picker .is-today .pika-button{color:#3af;font-weight:700}.fn-date-picker .is-selected .pika-button{color:#fff;font-weight:700;background:#3af;box-shadow:inset 0 1px 3px #178fe5;border-radius:3px}.fn-date-picker .is-disabled .pika-button{pointer-events:none;cursor:default;color:#999;opacity:.3}.fn-date-picker .pika-week{font-size:11px;color:#999} .hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 .inputs-list.inline-list li{vertical-align:top;display:inline-block;word-wrap:break-word;padding-right:16px}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 .inputs-list.inline-list li:after{clear:both}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 .inputs-list.inline-list li input{float:left}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 .inputs-list.inline-list.inline-list-2 li{width:50%}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 .inputs-list.inline-list.inline-list-2 li:nth-child(2n){padding-right:0}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 .inputs-list.inline-list.inline-list-3 li{width:33%}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 .inputs-list.inline-list.inline-list-3 li:nth-child(3n){width:34%;padding-right:0}.hs-fieldtype-intl-phone.hs-input{padding:0;background:none;border:none;height:auto}.hs-fieldtype-intl-phone.hs-input:after{clear:both;content:" ";display:table}.hs-fieldtype-intl-phone.hs-input .hs-input{margin-bottom:0}.hs-fieldtype-intl-phone.hs-input input{width:68%!important;float:right}.hs-fieldtype-intl-phone.hs-input select{float:left;width:30%!important}@media (max-device-width:480px) and (min-device-width:320px),(max-width:400px){.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7>.hs-phone>.input>.hs-fieldtype-intl-phone.hs-input>input.hs-input{width:68%!important}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7>.hs-phone>.input>.hs-fieldtype-intl-phone.hs-input>select.hs-input{width:30%!important}}.hs-fieldtype-textarea.hs-input{resize:vertical}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 .hs-button{white-space:pre-wrap}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 .hs-richtext{word-break:break-word}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 fieldset{border:0;padding:0;margin:0;max-width:500px}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 fieldset.form-columns-1 .hs-input{width:95%}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 fieldset.form-columns-1 .input{margin-right:8px}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 fieldset.form-columns-1 input[type=checkbox],.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 fieldset.form-columns-1 input[type=radio]{width:auto}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 fieldset.form-columns-2 .hs-form-field{width:50%;float:left}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 fieldset.form-columns-2 .input{margin-right:8px}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 fieldset.form-columns-3 .hs-form-field{width:32.7%;float:left}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 fieldset.form-columns-3 .input{margin-right:8px}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 label.hs-hidden{visibility:hidden}.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7 .hs-field-desc{width:100%}.hs-custom-style .hs-input,.hs-custom-style fieldset{max-width:100%}.hs-custom-style>div.form-columns-3 .hs-form-field,.hs-custom-style fieldset.form-columns-3 .hs-form-field{width:33.3%}.hs-custom-style>div>div:last-of-type .hs-input:not([type=checkbox]):not([type=radio]),.hs-custom-style fieldset>div:last-of-type .hs-input:not([type=checkbox]):not([type=radio]){width:100%;max-width:100%}.hs-custom-style>div input:not([type=image]):not([type=submit]):not([type=button]):not([type=radio]):not([type=checkbox]):not([type=file]),.hs-custom-style fieldset input:not([type=image]):not([type=submit]):not([type=button]):not([type=radio]):not([type=checkbox]):not([type=file]){box-sizing:border-box;padding:0 15px;min-height:27px}.hs-custom-style>div textarea,.hs-custom-style fieldset textarea{padding:10px 15px}.hs-custom-style .hs-dependent-field>div .hs-input:not([type=checkbox]):not([type=radio]){width:100%}@media (max-width:400px),(min-device-width:320px) and (max-device-width:480px){.hs-custom-style .hs-input:not([type=checkbox]):not([type=radio]),.hs-custom-style fieldset{margin-right:0!important;width:100%!important}form.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7:not(.hs-video-form) .form-columns-2 .hs-form-field,form.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7:not(.hs-video-form) .form-columns-3 .hs-form-field{float:none;width:100%}form.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7:not(.hs-video-form) .form-columns-2 .hs-form-field .hs-input,form.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7:not(.hs-video-form) .form-columns-3 .hs-form-field .hs-input{width:95%}form.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7:not(.hs-video-form) .form-columns-2 .hs-form-field input[type=checkbox],form.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7:not(.hs-video-form) .form-columns-2 .hs-form-field input[type=radio],form.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7:not(.hs-video-form) .form-columns-3 .hs-form-field input[type=checkbox],form.hs-form-b1b24391-63d1-4e00-afbf-45155cc68a17_8cfbe5d5-1269-4464-b807-e118d5d2f1c7:not(.hs-video-form) .form-columns-3 .hs-form-field input[type=radio]{width:auto}}.legal-consent-container .field.hs-form-field{margin-bottom:8px}.legal-consent-container .hs-field-desc.checkbox-desc{margin:-12px 0 0 21px}.legal-consent-container .hs-form-booleancheckbox-display input{float:left}.legal-consent-container .hs-form-booleancheckbox-display>span{display:block;margin-left:20px}.legal-consent-container .hs-form-booleancheckbox-display p{margin:0;display:inline}.legal-consent-container .hs-error-msgs label{color:#f2545b}.legal-consent-container~.hs_recaptcha{margin-top:18px}.cookie-reset-container{font-size:14px;margin-bottom:10px;text-align:right}#hs-outer-captcha-target,#hs-outer-captcha-target *{display:none;height:0;width:0}.hubspot-link__container{font-size:14px;padding-bottom:40px;position:relative;color:#9fa0a2;font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.hubspot-link-text{color:#00a4bd;font-weight:400}.hubspot-link__container.sproket{color:#9fa0a2}.hubspot-link{color:#9fa0a2}.hubspot-link,.hubspot-link:hover{text-decoration:none}.hubspot-link:hover .hubspot-link-text{text-decoration:underline}.hubspot-link__icon{margin-bottom:-1px;margin-right:5px}.hubspot-link__container.sproket .hubspot-link__icon{width:30px;margin-right:0;float:left;margin-top:-9px;margin-left:-5px}
There might be some reasoning for some part of it, yet there is also quite a bunch of it there which is not required at all.
Similar much gets added for every form-instance.