##  [How do I make an element stretch 100% width of the screen in a predefined theme?](/how-do-i-make-an-element-stretch-100-width-of-the-screen-in-a-predefined-theme) 

This article is part of a series I am writing on how to make a modern basic HTML page. If you are interested in getting first access to such content then be sure to sign up for the newsletter.

@import url("https://assets.mlcdn.com/fonts.css?version=1705921");
  /* LOADER */
  .ml-form-embedSubmitLoad {
    display: inline-block;
    width: 20px;
    height: 20px;
  }
  .g-recaptcha {
    transform: scale(1);
    -webkit-transform: scale(1);
    transform-origin: 0 0;
    -webkit-transform-origin: 0 0;
    height: ;
  }
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
  }
  .ml-form-embedSubmitLoad:after {
    content: " ";
    display: block;
    width: 11px;
    height: 11px;
    margin: 1px;
    border-radius: 50%;
    border: 4px solid #fff;
    border-color: #C6E9B9 #C6E9B9 #C6E9B9 transparent;
    animation: ml-form-embedSubmitLoad 1.2s linear infinite;
  }
  @keyframes ml-form-embedSubmitLoad {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  #mlb2-11389960.ml-form-embedContainer {
    box-sizing: border-box;
    display: table;
    margin: 0 auto;
    position: static;
    width: 100% !important;
  }
  #mlb2-11389960.ml-form-embedContainer h4,
  #mlb2-11389960.ml-form-embedContainer p,
  #mlb2-11389960.ml-form-embedContainer span,
  #mlb2-11389960.ml-form-embedContainer button {
    text-transform: none !important;
    letter-spacing: normal !important;
    margin-block-start: 0;
    margin-block-end: 0;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper {
    background-color: #3aa6d740 !important;
    border-width: 0px;
    border-color: transparent;
    border-radius: 4px;
    border-style: solid;
    box-sizing: border-box;
    display: inline-block !important;
    margin: 0;
    padding: 0;
    position: relative;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper.embedPopup,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper.embedDefault { width: 400px; }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper.embedForm { max-width: 885px; width: 100%; }
  #mlb2-11389960.ml-form-embedContainer .ml-form-align-left { text-align: left; }
  #mlb2-11389960.ml-form-embedContainer .ml-form-align-center { /*text-align: center;*/ }
  #mlb2-11389960.ml-form-embedContainer .ml-form-align-default { display: table-cell !important; vertical-align: middle !important; text-align: center !important; }
  #mlb2-11389960.ml-form-embedContainer .ml-form-align-right { text-align: right; }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedHeader img {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    height: auto;
    margin: 0 auto !important;
    max-width: 100%;
    width: undefinedpx;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody {
    padding: 20px 20px 0 20px;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody.ml-form-embedBodyHorizontal {
    padding-bottom: 0;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent {
    text-align: left;
    margin: 0 0 20px 0;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent h2,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent h4 {
    color: #000;
    font-family: 'Open Sans',Arial,Helvetica,sans-serif;
    font-size: 30px;
    font-weight: 400;
    margin: 0 0 10px 0;
    text-align: left;
    word-break: break-word;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent h4,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent h4 {
    color: #000000;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 30px;
    font-weight: 400;
    margin: 0 0 10px 0;
    text-align: left;
    word-break: break-word;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent p,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent p {
    color: #000000;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    margin: 0 0 10px 0;
    text-align: left;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent ul,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent ol,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent ul,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent ol {
    color: #000000;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 14px;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent ol ol,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent ol ol {
    list-style-type: lower-alpha;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent ol ol ol,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent ol ol ol {
    list-style-type: lower-roman;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent p a,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent p a {
    color: #000000;
    text-decoration: underline;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-block-form .ml-field-group {
    text-align: left!important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-block-form .ml-field-group label {
    margin-bottom: 5px;
    color: #333333;
    font-size: 16px;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-weight: bold; font-style: normal; text-decoration: none;;
    display: inline-block;
    line-height: 22px;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent p:last-child,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent p:last-child {
    margin: 0;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody form {
    margin: 0;
    width: 100%;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-formContent,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow {
    margin: 0 0 20px 0;
    width: 100%;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow {
    float: left;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-formContent.horozintalForm {
    margin: 0;
    padding: 0 0 20px 0;
    width: 100%;
    height: auto;
    float: left;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow {
    margin: 0 0 10px 0;
    width: 100%;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow.ml-last-item {
    margin: 0;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow.ml-formfieldHorizintal {
    margin: 0;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-color: #cccccc;
    border-radius: 4px !important;
    border-style: solid !important;
    border-width: 1px !important;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 14px !important;
    height: auto;
    line-height: 21px !important;
    margin-bottom: 0;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 10px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input::-webkit-input-placeholder,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow input::-webkit-input-placeholder { color: #333333; }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input::-moz-placeholder,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow input::-moz-placeholder { color: #333333; }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input:-ms-input-placeholder,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow input:-ms-input-placeholder { color: #333333; }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input:-moz-placeholder,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow input:-moz-placeholder { color: #333333; }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow textarea, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow textarea {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-color: #cccccc;
    border-radius: 4px !important;
    border-style: solid !important;
    border-width: 1px !important;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 14px !important;
    height: auto;
    line-height: 21px !important;
    margin-bottom: 0;
    margin-top: 0;
    padding: 10px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-radio .custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-radio .custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-checkbox .custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-checkbox .custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedPermissions .ml-form-embedPermissionsOptionsCheckbox .label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-interestGroupsRow .ml-form-interestGroupsRowCheckbox .label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description::before {
    border-color: #cccccc!important;
    background-color: #ffffff!important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input.custom-control-input[type="checkbox"]{
    box-sizing: border-box;
    padding: 0;
    position: absolute;
    z-index: -1;
    opacity: 0;
    margin-top: 5px;
    margin-left: -1.5rem;
    overflow: visible;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-checkbox .custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-checkbox .custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedPermissions .ml-form-embedPermissionsOptionsCheckbox .label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-interestGroupsRow .ml-form-interestGroupsRowCheckbox .label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description::before {
    border-radius: 4px!important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow input[type=checkbox]:checked~.label-description::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedPermissions .ml-form-embedPermissionsOptionsCheckbox input[type=checkbox]:checked~.label-description::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-checkbox .custom-control-input:checked~.custom-control-label::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-checkbox .custom-control-input:checked~.custom-control-label::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-interestGroupsRow .ml-form-interestGroupsRowCheckbox input[type=checkbox]:checked~.label-description::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-radio .custom-control-input:checked~.custom-control-label::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-radio .custom-control-input:checked~.custom-control-label::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-radio .custom-control-input:checked~.custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-radio .custom-control-input:checked~.custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-checkbox .custom-control-input:checked~.custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-checkbox .custom-control-input:checked~.custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedPermissions .ml-form-embedPermissionsOptionsCheckbox input[type=checkbox]:checked~.label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-interestGroupsRow .ml-form-interestGroupsRowCheckbox input[type=checkbox]:checked~.label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow input[type=checkbox]:checked~.label-description::before  {
    border-color: #000000!important;
    background-color: #000000!important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-radio .custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-radio .custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-radio .custom-control-label::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-radio .custom-control-label::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-checkbox .custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-checkbox .custom-control-label::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-checkbox .custom-control-label::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-checkbox .custom-control-label::after {
    top: 2px;
    box-sizing: border-box;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedPermissions .ml-form-embedPermissionsOptionsCheckbox .label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedPermissions .ml-form-embedPermissionsOptionsCheckbox .label-description::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description::after {
    top: 0px!important;
    box-sizing: border-box!important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description::after {
    top: 0px!important;
    box-sizing: border-box!important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-interestGroupsRow .ml-form-interestGroupsRowCheckbox .label-description::after {
    top: 0px!important;
    box-sizing: border-box!important;
    position: absolute;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-interestGroupsRow .ml-form-interestGroupsRowCheckbox .label-description::before {
    top: 0px!important;
    box-sizing: border-box!important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .custom-control-label::before {
    position: absolute;
    top: 4px;
    left: -1.5rem;
    display: block;
    width: 16px;
    height: 16px;
    pointer-events: none;
    content: "";
    background-color: #ffffff;
    border: #adb5bd solid 1px;
    border-radius: 50%;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .custom-control-label::after {
    position: absolute;
    top: 2px!important;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedPermissions .ml-form-embedPermissionsOptionsCheckbox .label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-interestGroupsRow .ml-form-interestGroupsRowCheckbox .label-description::before, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description::before {
    position: absolute;
    top: 4px;
    left: -1.5rem;
    display: block;
    width: 16px;
    height: 16px;
    pointer-events: none;
    content: "";
    background-color: #ffffff;
    border: #adb5bd solid 1px;
    border-radius: 50%;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedPermissions .ml-form-embedPermissionsOptionsCheckbox .label-description::after {
    position: absolute;
    top: 0px!important;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description::after {
    position: absolute;
    top: 0px!important;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .custom-radio .custom-control-label::after {
    background: no-repeat 50%/50% 50%;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .custom-checkbox .custom-control-label::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedPermissions .ml-form-embedPermissionsOptionsCheckbox .label-description::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-interestGroupsRow .ml-form-interestGroupsRowCheckbox .label-description::after, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description::after {
    background: no-repeat 50%/50% 50%;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-control, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-control {
    position: relative;
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5rem;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-radio .custom-control-input, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-radio .custom-control-input, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-checkbox .custom-control-input, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-checkbox .custom-control-input {
    position: absolute;
    z-index: -1;
    opacity: 0;
    box-sizing: border-box;
    padding: 0;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-radio .custom-control-label, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-radio .custom-control-label, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-checkbox .custom-control-label, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-checkbox .custom-control-label {
    color: #000000;
    font-size: 12px!important;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    line-height: 22px;
    margin-bottom: 0;
    position: relative;
    vertical-align: top;
    font-style: normal;
    font-weight: 700;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow .custom-select, #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow .custom-select {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-color: #cccccc;
    border-radius: 4px !important;
    border-style: solid !important;
    border-width: 1px !important;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 14px !important;
    line-height: 20px !important;
    margin-bottom: 0;
    margin-top: 0;
    padding: 10px 28px 10px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    height: auto;
    display: inline-block;
    vertical-align: middle;
    background: url('https://assets.mlcdn.com/ml/images/default/dropdown.svg') no-repeat right .75rem center/8px 10px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow {
    height: auto;
    width: 100%;
    float: left;
  }
  .ml-form-formContent.horozintalForm .ml-form-horizontalRow .ml-input-horizontal { width: 70%; float: left; }
  .ml-form-formContent.horozintalForm .ml-form-horizontalRow .ml-button-horizontal { width: 30%; float: left; }
  .ml-form-formContent.horozintalForm .ml-form-horizontalRow .ml-button-horizontal.labelsOn { padding-top: 27px;  }
  .ml-form-formContent.horozintalForm .ml-form-horizontalRow .horizontal-fields { box-sizing: border-box; float: left; padding-right: 10px;  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow input {
    background-color: #ffffff;
    color: #333333;
    border-color: #cccccc;
    border-radius: 4px;
    border-style: solid;
    border-width: 1px;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 20px;
    margin-bottom: 0;
    margin-top: 0;
    padding: 10px 10px;
    width: 100%;
    box-sizing: border-box;
    overflow-y: initial;
    height: initial;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow button {
    background-color: #116b71 !important;
    border-color: #116b71;
    border-style: solid;
    border-width: 1px;
    border-radius: 4px;
    box-shadow: none;
    color: #C6E9B9 !important;
    cursor: pointer;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 14px !important;
    font-weight: 700;
    line-height: 20px;
    margin: 0 !important;
    padding: 10px !important;
    width: 100%;
    height: auto;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow button p {
    max-height: 0;
  }
  
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-horizontalRow button:hover {
    background-color: #9a9a9a !important;
    border-color: #9a9a9a !important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow input[type="checkbox"] {
    box-sizing: border-box;
    padding: 0;
    position: absolute;
    z-index: -1;
    opacity: 0;
    margin-top: 5px;
    margin-left: -1.5rem;
    overflow: visible;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow .label-description {
    color: #000000;
    display: block;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 12px;
    text-align: left;
    margin-bottom: 0;
    position: relative;
    vertical-align: top;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow label {
    font-weight: normal;
    margin: 0;
    padding: 0;
    position: relative;
    display: block;
    min-height: 24px;
    padding-left: 24px;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow label a {
    color: #000000;
    text-decoration: underline;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow label p {
    color: #000000 !important;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif !important;
    font-size: 12px !important;
    font-weight: normal !important;
    line-height: 18px !important;
    padding: 0 !important;
    margin: 0 5px 0 0 !important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow label p:last-child {
    margin: 0;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit {
    margin: 0 0 20px 0;
    float: left;
    width: 100%;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button {
    background-color: #116b71 !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    color: #C6E9B9 !important;
    cursor: pointer;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 21px !important;
    height: auto;
    padding: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button.loading {
    display: none;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button:hover {
    background-color: #9a9a9a !important;
  }
  .ml-subscribe-close {
    width: 30px;
    height: 30px;
    background: url('https://assets.mlcdn.com/ml/images/default/modal_close.png') no-repeat;
    background-size: 30px;
    cursor: pointer;
    margin-top: -10px;
    margin-right: -10px;
    position: absolute;
    top: 0;
    right: 0;
  }
  .ml-error input, .ml-error textarea, .ml-error select {
    border-color: red!important;
  }
  .ml-error .custom-checkbox-radio-list {
    border: 1px solid red !important;
    border-radius: 4px;
    padding: 10px;
  }
  .ml-error .label-description,
  .ml-error .label-description p,
  .ml-error .label-description p a,
  .ml-error label:first-child {
    color: #ff0000 !important;
  }
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow.ml-error .label-description p,
  #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-checkboxRow.ml-error .label-description p:first-letter {
    color: #ff0000 !important;
  }
  @media only screen and (max-width: 400px){
    .ml-form-embedWrapper.embedDefault, .ml-form-embedWrapper.embedPopup { width: 100%!important; }
    .ml-form-formContent.horozintalForm { float: left!important; }
    .ml-form-formContent.horozintalForm .ml-form-horizontalRow { height: auto!important; width: 100%!important; float: left!important; }
    .ml-form-formContent.horozintalForm .ml-form-horizontalRow .ml-input-horizontal { width: 100%!important; }
    .ml-form-formContent.horozintalForm .ml-form-horizontalRow .ml-input-horizontal &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; div { padding-right: 0px!important; padding-bottom: 10px; }
    .ml-form-formContent.horozintalForm .ml-button-horizontal { width: 100%!important; }
    .ml-form-formContent.horozintalForm .ml-button-horizontal.labelsOn { padding-top: 0px!important; }
  }

  .ml-mobileButton-horizontal { display: none; }
  #mlb2-11389960 .ml-mobileButton-horizontal button {
    background-color: #116b71 !important;
    border-color: #116b71 !important;
    border-style: solid !important;
    border-width: 1px !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    color: #C6E9B9 !important;
    cursor: pointer;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
    padding: 10px !important;
    width: 100% !important;
  }
  @media only screen and (max-width: 400px) {
    #mlb2-11389960.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-formContent.horozintalForm {
      padding: 0 0 10px 0 !important;
    }
    .ml-hide-horizontal { display: none !important; }
    .ml-form-formContent.horozintalForm .ml-button-horizontal { display: none!important; }
    .ml-mobileButton-horizontal { display: inline-block !important; margin-bottom: 20px;width:100%; }
    .ml-form-formContent.horozintalForm .ml-form-horizontalRow .ml-input-horizontal &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; div { padding-bottom: 0px !important; }
  }

  @media only screen and (max-width: 400px) {
    .ml-form-formContent.horozintalForm .ml-form-horizontalRow .horizontal-fields {
      margin-bottom: 10px !important;
      width: 100% !important;
    }
  }
## Tech &amp; Design Newsletter



Email  
 





Subscribe 

 Loading...







Subscribe 

 Loading...





#### Thank you!

Please check your email to confirm your email address.












    function ml_webform_success_11389960() {
        var $ = ml_jQuery || jQuery;
        $('.ml-subscribe-form-11389960 .row-success').show();
        $('.ml-subscribe-form-11389960 .row-form').hide();
    }

    fetch("https://assets.mailerlite.com/jsonp/786936/forms/111143270386500633/takel")
![.](https://track.mailerlite.com/webforms/o/1518766/m6e3o4?v1605146791)

There are 2 ways to make an element stretch 100% of the view width that I know of. And there are possibly multiple more. One way is to make sure the element doesn't have any constraining wrapper and then add a CSS rule to make the element 100% as illustrated below.

Image

 ![element set to one hundred percent](/sites/default/files/2022-05/element-set-to-one-hundred-percent.png)

 

 However, this isn't always possible, especially if you are using a grid framework as this will usually require a wrapper as shown below.

Image

 ![HTML element contained in a wrapper](/sites/default/files/2022-05/HTML-element-contained-in-a-wrapper_0.png)

 

 This is even more true if you are using dynamically generated templates as part of a CMS or framework and only want to add the rule to the odd image, quoted text, or code snippet within an article. In this situation, the chances are you not only have a constraining grid wrapper but also a wrapper that is wrapping the article content or various other div wrappers.

So how do you deal with this scenario? Read on to find out.

In this article, I am going to show you how you can make an element 100% of the viewport width where you have to deal with dynamically generated templates and can't modify the output due to needing to rewrite too much code. The technique requires you to add a wrapper and or a class to the element or section you want to stretch to 100% view width and use a bit of CSS. You can also use pseudo-classes if you are a CSS master.

Okay, let's take a quick look at an example.

### Prepare the HTML

Preparing the HTML is really simple. It is as easy as adding a class to an HTML tag that is wrapping what you want to expand to 100% of the view width. You may need to also add a wrapper if you can't use one that already exists. For those of you who are CSS wizards and ninjas, you could also use a pseudo-class.

Now that we have the element selected we can add the CSS rule in the next step

### The magic CSS to make your element break all boundaries and do what seems impossible

Using our selector, which in this case is a div with a class of one-hundred-vw, we can make the element 100vw with the 4 properties outlined below:

```css
.one-hundred-vw {
  width: 100vw;
  position: relative; 
  max-width: 100vw;
  left: 50%;
  margin-left: -50vw;
}
```

1. The first thing we will need to do is add the position property to the rule and make it relative. Make sure you use relative here as other position values won't work.

**Related:** [CSS Positioning using the Position Property](/css-positioning-using-the-position-property "position property in CSS")

2. Add the max-width 100vw property-value pair. Without this, this technique doesn't work.
3. Then push the element to the left using the left property, this effectively overrides any positioning and as you will see it is now half off the right side of the page.
4. Add a negative margin of 50vw to now offset the position.

That's it, the rest is purely styling preferences.

### Giving the element some space inside and out

Giving the element some space above and below makes sure the elements before and after don't touch it. Then add padding to move the content or element(s) inside away from the edge.

Both of these property values may be set at a global level rule if you have a design system in place, but just in case you haven't it is worth mentioning.

### The content inside

To place element(s) inside you could add a display property and position them like that. For example, you could add display: flex with justify-content: space around instead of padding or any number of other layout techniques. The idea again is to give a little white space and make sure the content isn't touching the edges, unless, of course, the design is to have the content touch the edges, such as a full-width background image.

Well, I hope this is helpful to see how you can apply multiple rules to an element to achieve a nice effect to make the background of a section cover 100% of the page width or 100vw. Have a play around, see what happens if you make it 90% and then move it right and add a right margin. That's what I do here, experiment to see what happens.

Thanks for dropping by the design kojo dojo and be sure to sign up for the newsletter so you get some HTML and CSS goodness to your inbox.

Till next time my friends, sayonara, adious, kia ora.



Tags

[Snippets](/snippets)