Kevin Powell - Community

KPC

Kevin Powell - Community

A friendly place for developers to meet other devs, ask questions, get help, and just have a good time šŸ™‚.

Join

front-end

resources

back-end

ui-ux

os-and-tools

help

Loop through Two Arrays (JS)

I have two arrays which I'm trying to loop through to determine if they have matching values. Here is a portion of the code: ``` currentProducts.forEach(item1 => {...
No description

How use client components with next18n?

Now I change languages like this Language.tsx ```tsx 'use client'
...
No description

How does the input checkbox work if it's hidden?

Here you can see from https://youtu.be/1TZjgQ0Osic 6:30, he creates that hamburger button, he hides the input, and then he uses css selectors to "use" that hidden input element in order to toggle the sidebar, how does that work?
No description

Child to be 100% of the align-self parent, but not more!

Hey everyone. So this is my layout, like on the picture. Both lef (blue) and right (red) side are made to be: align-self:stretch. Since the body is min-height: calc(100vh - header height), both left and right side will stretch to the end of the container. Since my right (red) side doesn't have a predefined height, can my yellow content inside the red element be 100% of it's parent (red element)....
No description

Font-Size Effects: Unraveling the Dual Impact on Text Height and Width

as of my knowledge the font-size effect only the the height of the text in an element(correct me if am wrong). which mean if font-size is 10px, height of text inside an element become 10px if changing the font-size to 20px the height of the text become 20px. but the question I want to ask here if above is correct then why the width of the text also changes as the font-size of the element change codesandbox: https://xlvn5c.csb.app/...

Virtual Grid

Hello, I don't have a specific css question. It is rather a "how would you achieve this" question. I have a really large table (realised with grid) and due to the filter options, the site gets really slow because it has to rerender a lot of nodes. So I decided to build a script which computes which cells are currently visible and which ones are not. ...

Having Issues With The Height Property

I wanted to know if it is appropriate declaring your height on the html element for a fresh html project, so you can work on that. I ran into an issue trying to learn how to build header's & footer's, so I wanted my footer to be at the bottom of the page while my header stays at the top & my main element have some height that fills the whole screen without it having to scroll to reach the bottom. In my codepen, if you comment out the height for the main, the footer & header collapse and become one block but I wanted them to stick to the top & bottom so I declared the height for the main element where content would sit. Here is the link to the Codepen...

hero section design

Hey, what would be the best way to go about this sort of design for a hero section where the image intentionally overflows the container as shown in the image? Would it be setting a max height on the container or perhaps a property on the image? I’d much appreciate any insight, many thanks! (Sorry for the poor quality image haha, I had to draw it on phone)
No description

Why my images get smaller when i zoom ad viceversa?

```css .row { display:flex; gap:1em; max-width: 100%;...

CSS grid, setting maximum span

Is there a way to set a max value for CSS grid-column: span such that it takes up n-columns maximum or spans across all available columns if there are fewer than that? If I use span in a grid with auto-fill it'll forces additional columns even when there isn't space for any and makes them look weird....

Navigating a dashboard with js only

I want to know how to navigate through a dashboard contents like(profile, settings, analytics...) Using only js... because I am a beginner and I still don't know react... Could I change the content of the same container each time or this will be a bad practice...

Spam me with JavaScript projects for a beginner.

Hi I am a beginner in javascript (I have knowleage with html/css) and want to start creating some projects, can you guys give me some ideas about beginner friendly projects to start with? I want them to go from really easy and then step by step adding more difficulty.. I want to have lots of projects I can be creating this week. I want both real world projects and some fun ones to create just for the purpose of learning....

Having to set a height declaration using -webkit-line-clamp on older iOS devices?

On a page I'm building I am using the line clamp that Kevin showed in a YouTube short I came across recently. '.line-limit { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;}' It is working as expected on all my Win 11 desktop browsers and in responsive mode but I checked on my iPhone 6S+ (iOS 15.7.9) and the paragraphs are shown full length and there are lines of text that are overlapping. I was able to look at the page on an iPhone 15 in the store this morning and it was working as expected. ...
Example of .line-limit CSS on older iOS device without Height declaration

Getting back into the document flow after using Positioning Absolute.

I'm trying to add a form after my css image for a school assignment and I can't figure out how to make it show under my img-container. https://codepen.io/tehlefty/pen/YzdaPPM?editors=1100 Any thoughts?

Buttons "jump" after hover animation

So the title itself is pretty explanatory. I'm trying to give my buttons a hover effect that makes them bigger when hovering but somehow when you stop hovering and it goes back to its normal size, it does a little jump. I've made a codepen with the code of the buttons so you can easily check it, but I'm leaving a video too. PS: It happens with logos too. https://codepen.io/Tekyo/pen/vYvdrNg...

Advanced Css and GSAP intro

hey guys im trying to recreate the intro from this website where the images come in from 5 columns and then the middle image gets bigger : https://camillemormal.com/ so far i have achieved this : https://codepen.io/alisa-khodadadi/pen/RwEQzZe ...

Layout issues

When I am hovering over a button, it pushes the button next to it as I have applied some styles when hovered. Here is my code html <div id="header">...

fetch error

guys how to debug these kinds of errors i got this while fetching a url ``` node:internal/deps/undici/undici:11576 Error.captureStackTrace(err, this); ^...

Body tag not working

I tried selecting the body tag, to change the background color when the button is checked, I couldn't figure out why the body tag doesn't change. When I added a div, it worked on the div. https://codepen.io/aldous-waites/pen/RwEQqQE...