Created
August 15, 2018 09:10
-
-
Save tony-keller/3dd7edcc6bf12d382e6f59d41812dd10 to your computer and use it in GitHub Desktop.
Inline Gravity form with one field - flexbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.my-custom-wrapper{ | |
.gform_wrapper { | |
margin:0; | |
//position: relative; | |
form{ | |
display: flex!important; | |
justify-content: space-between; | |
.gform_body{ | |
width:100%; | |
} | |
} | |
//Some Gravity garbage needs reset: | |
ul, li{ | |
margin: 0!important; | |
padding: 0!important; | |
width:auto!important; | |
} | |
// The main validation error message comes and disrupt the flexbox, | |
// as it adds an item, so we hide since it is pretty useless: | |
.validation_error{ | |
display: none!important; | |
} | |
input[type=text]{ | |
width:calc(100% + 35px)!important; // this is to hide the end of input under the submit button. | |
height:40px; | |
padding: 6px 10px!important; | |
background: #FFF; | |
border: 1px solid #CCC; | |
font-size: 16px; | |
outline:none; | |
} | |
//the container of submit button: | |
.gform_footer { | |
width: auto; | |
input[type=submit] { | |
cursor: pointer; | |
margin: 0 !important; | |
height:40px!important; | |
padding: 6px 10px; | |
font-size: 16px; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is also a class made by Gravity form but it uses display: inline-table and I don't find it so good: .gf_simple_horizontal as seen here in the comments: https://www.ryanrudolph.com/creating-a-horizontal-gravity-form-using-css/#comment-14869