Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

Email entry + buy button Responsive

Hello, I want this code:

CSS:
[form] {
    padding: 2px;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

[form] input[type=text],
[form] input[type=email],
[form] select {
    width: 100%;
    border: 1px solid #bbb;
    height: auto;
    margin: 5px 0 0 0;
}

[form] .sib-default-btn {
    margin: 1px 0;
    padding: 12px 156px;
    color: #fff;
    background-color: #fb7955;
    border-color: #444;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4285;
    text-align: center;
    cursor: pointer;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    white-space: normal;
    border: 10px solid transparent;
    border-radius: 3px;
}

[form] .sib-default-btn:hover {
    background-color: #444;
}

[form] p {
    margin: 10px 0 0 0;
}

img {
    width: 100%;
    height: auto;
}

Responsive is!

a test video:


greetz
 
Last edited by a moderator:
You mean you want the orange button the same width as the field?

It'll also be helpful to see your HTML and CSS code for the button and field.
I have no idea what that CSS code you posted is supposed to be.
 
You mean you want the orange button the same width as the field?

It'll also be helpful to see your HTML and CSS code for the button and field.
I have no idea what that CSS code you posted is supposed to be.
I want the two fields to be the same size and responsive when you move them or in mobile view!
The code is from the plugin, where you create exactly these forms!!

what you need exactlY?
 
i have only these code and the other is the custom style code!

<p class="sib-email-area">
<input type="email" class="sib-email-area" name="email" placeholder="Email-Adresse" value="">
</p>

<p>
<input type="submit" class="sib-default-btn" name="submit" value="JETZT GRATIS GESCHENK ANFORDERN!">
</p>
 
The button doesn't have any defined width, so it'll be the width of the text + the left and right padding.
If the width of the page is greater than the width of the button, the button will not span the whole width of the page like (I assume) you want it to.
If you want it to be the full width of the page, as I see it is with the textfield, you have to give the button width:100%;
Is there a reason why you didn't give the button 100% width like the textfield?

Also, Is there a reason why the input elements are inside p elements?
 
The button doesn't have any defined width, so it'll be the width of the text + the left and right padding.
If the width of the page is greater than the width of the button, the button will not span the whole width of the page like (I assume) you want it to.
If you want it to be the full width of the page, as I see it is with the textfield, you have to give the button width:100%;
Is there a reason why you didn't give the button 100% width like the textfield?

Also, Is there a reason why the input elements are inside p elements?
Would you be so kind and optimize the code for me? I would be very grateful to you! I also think that the font in the button has no definition?

To answer your question: No, there is no reason!
 
If you want those input elements in container elements, I would use the div element.
The p element is meant for text.

So for the HTML, something like this should be good.
HTML:
<div class="sib-email-area">
    <input type="email" class="sib-email-area" name="email" placeholder="Email-Adresse">
</div>
<div>
    <input type="submit" class="sib-default-btn" name="submit" value="JETZT GRATIS GESCHENK ANFORDERN!">
</div>


I can't really do anything with the CSS, because it looks like you might have other elements in the form that I do not know about.

You have to add width: 100%; to the .sib-default-btn class to fix your problem.
CSS:
[form] .sib-default-btn {
    width: 100%;              /*add this line for the button to be the same width as the input field*/
    margin: 1px 0;
    padding: 12px 156px;
    color: #fff;
    background-color: #fb7955;
    border-color: #444;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4285;
    text-align: center;
    cursor: pointer;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    white-space: normal;
    border: 10px solid transparent;
    border-radius: 3px;
}
 
If you want those input elements in container elements, I would use the div element.
The p element is meant for text.

So for the HTML, something like this should be good.
HTML:
<div class="sib-email-area">
    <input type="email" class="sib-email-area" name="email" placeholder="Email-Adresse">
</div>
<div>
    <input type="submit" class="sib-default-btn" name="submit" value="JETZT GRATIS GESCHENK ANFORDERN!">
</div>


I can't really do anything with the CSS, because it looks like you might have other elements in the form that I do not know about.

You have to add width: 100%; to the .sib-default-btn class to fix your problem.
CSS:
[form] .sib-default-btn {
    width: 100%;              /*add this line for the button to be the same width as the input field*/
    margin: 1px 0;
    padding: 12px 156px;
    color: #fff;
    background-color: #fb7955;
    border-color: #444;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4285;
    text-align: center;
    cursor: pointer;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    white-space: normal;
    border: 10px solid transparent;
    border-radius: 3px;
}
wow! really really thank you! it works perfectly!
 
You're welcome

I forgot to mention you also need to change the p to div here if you're changing those p elements to div elements:
CSS:
[form] p {
    margin: 10px 0 0 0;
}
CSS:
[form] div {
    margin: 10px 0 0 0;
}
 

Latest posts

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom