megaByte
megaByte
KPCKevin Powell - Community
Created by dys πŸ™ on 9/10/2023 in #front-end
How to get an element to fit within its parent?
i would recommend using grid
html,
body {
margin: 0;
padding: 0;
}

* {
box-sizing: content-box;
}

main {
display: grid;
grid-template-columns: auto;
grid-template-rows: 1fr auto;
height: 100vh;
justify-items: stretch;
}

.top {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: auto;

width: 100%;

& menu {
& ul {
padding: 0;
margin-inline-end: 1rem;
}

& a {
white-space: pre;
}
}

& video {
align-self: stretch;
}
}

.bottom {
& .bar {
height: 5rem;

background-color: green;
}
}
html,
body {
margin: 0;
padding: 0;
}

* {
box-sizing: content-box;
}

main {
display: grid;
grid-template-columns: auto;
grid-template-rows: 1fr auto;
height: 100vh;
justify-items: stretch;
}

.top {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: auto;

width: 100%;

& menu {
& ul {
padding: 0;
margin-inline-end: 1rem;
}

& a {
white-space: pre;
}
}

& video {
align-self: stretch;
}
}

.bottom {
& .bar {
height: 5rem;

background-color: green;
}
}
5 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
nah just ignore them, i also get those warnings
24 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
No description
24 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
nice! for more improvements i would say make it all the way responsive. it should look good for all screen sizes
24 replies
KPCKevin Powell - Community
Created by 4ngel_._ on 9/9/2023 in #front-end
TAILWIND How To Ignore Tags
Since both button and div are in your li tag, both of them get applied with hover property, so just set the button element's class instead
37 replies
KPCKevin Powell - Community
Created by 4ngel_._ on 9/9/2023 in #front-end
TAILWIND How To Ignore Tags
Just set the button's class to hover:opacity-50
37 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
yep
24 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
I think what is causing that to happen is because your background container and card are sticking by default so when you increase your margin from the inner card, it also disrupts the box model of outer container too. Well im no expert either so my reasoning may be wrong. Css is hard af. So just use padding instead 🫑
24 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
lol
24 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
As for your Css i think it is fineπŸ‘
24 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
My solution is in React. But you can implement same thing in plain Javascript too
24 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
As for suggestions, you havent actually implemented a confirm submit button. What needs to happen is the user should fill the form and they need to click on 'Confirm' button, which on successful submitting of form shows a message saying Thank You. I think this was mentioned in the problem itself.
24 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
24 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
I have solved this challenge in Frontend Mentor, I would advise that you design the page for Mobile first, then the desktop. You will get a better idea of how your html and css should be structured in the best way so that it is responsive
24 replies
KPCKevin Powell - Community
Created by Anonymous DEV on 9/9/2023 in #front-end
having problem with margins
so when you are setting a margin from a child element, in your case you would be actually overflowing the parent div. So you should use overflow:hidden in your leftContainer. A better practice would be to use padding:3rem in your parent div, and no margin property for your cardFront
24 replies
KPCKevin Powell - Community
Created by megaByte on 9/1/2023 in #back-end
Advent Of Code doubt
fml
3 replies
KPCKevin Powell - Community
Created by megaByte on 9/1/2023 in #back-end
Advent Of Code doubt
Nvm i saw someones code, they just copied the data
3 replies
KPCKevin Powell - Community
Created by doki3 on 8/31/2023 in #front-end
Vertically centering a number
No description
31 replies
KPCKevin Powell - Community
Created by doki3 on 8/31/2023 in #front-end
Vertically centering a number
hmmm that makes sense
31 replies
KPCKevin Powell - Community
Created by doki3 on 8/31/2023 in #front-end
Vertically centering a number
wtf
31 replies