Applying padding on login button breaks down complete structure of page in Firefox
Answered
KlaasPeters posted this in #help-forum
Hello,
I tried to apply some padding on the login button of my login form page.
The Form.module.css button styling:
This is the button containing div in JSX in the /pages/login.js file:
It's the
Anyone has an idea how to solve this problem? I tried Google, but couldn't really put in to the right words what's the problem, because I'm very new. (so no result)
I created these files by repeating all steps from this tutorial: https://youtu.be/t0Fs0NO78X8?t=2149
In the tutorial there is no problem with the page breaking down, just like in the Google Chrome browser.
In the end I want to create my own social webapp compatible with all browsers, so I like to know how to fix this kind of issues with the Firefox browser.
Please let me know if you have a suggestion! Thank you in advance!
I tried to apply some padding on the login button of my login form page.
The Form.module.css button styling:
.button {
@apply w-full bg-gradient-to-r from-blue-500 to-indigo-500 rounded-md;
@apply py-3 text-gray-50 text-lg;
}This is the button containing div in JSX in the /pages/login.js file:
<div className='input-button'>
<button type='submit' className={styles.button}>
<div className={styles.loginButtonMargin}>
Login
</div>
</button>
</div>It's the
@apply py-3 that's the problem, without the py-3 the site looks great. The problem only seems to occur in Firefox.Anyone has an idea how to solve this problem? I tried Google, but couldn't really put in to the right words what's the problem, because I'm very new. (so no result)
I created these files by repeating all steps from this tutorial: https://youtu.be/t0Fs0NO78X8?t=2149
In the tutorial there is no problem with the page breaking down, just like in the Google Chrome browser.
In the end I want to create my own social webapp compatible with all browsers, so I like to know how to fix this kind of issues with the Firefox browser.
Please let me know if you have a suggestion! Thank you in advance!
Answered by Dayo
so, unless you have a specific reason for doing that, you're better off with
height of 100% or min height of 100vh10 Replies
@Dayo just out of curiosity, why do you have 2 `@apply` inside the button class?
I just did everything exactly like the person in the tutorial, I'm not sure why he chose to do that that way
I quick fixed the problem by decreasing the padding of the text input fields. I think the problem was that the content didn't fit the most outer container of my layout which has a height set by the
h-screen class name@Dayo hmm. does your container have a fixed height?
is
className='h-screen' a fixed height? Translated to plain CSS it stands for height: 100vh@KlaasPeters is `className='h-screen'` a fixed height? Translated to plain CSS it stands for `height: 100vh`
technically, yes. it means 100% of the viewport height
SOLVED!: I changed
h-screen to min-h-screen and now everything is solved! I increased the padding on the text fields and the Form + Image are now vertically centered on the screen again.so, unless you have a specific reason for doing that, you're better off with
height of 100% or min height of 100vhAnswer
@Dayo so, unless you have a specific reason for doing that, you're better off with `height of 100%` or `min height of 100vh`
Thank you for helping, you got the answer!