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

Scrollbar Effect!

Hello guys, I have a question searched for it and unfortunately could not find the answer! Here i have the page scrollbar, how i can get the content behind the scrollbar (the scroll bar is transparent) as example the green thing is part of background image, i want the scrollbar to be on the background image as well as shows part of it through its transparency . Thanks in advance!...
No description

Masking divs to a background image of its container?

Hi everyone! I have been racking my brain trying to figure out a way to implement this. I know of masking but I am not sure at all how to even begin something like this. I tried playing around with code pens that I have found using keywords but I have had no luck trying to achieve what I am looking to do. This is just a concept idea, but I figure a visual would help. I attached two images to this that capture exactly what I am trying to do. I wish I had code already but I have no idea. I threw this together in photoshop with the initial blue boxes representing the four child elements. The second image just shows that only the background shows for the children elements, and it is ideally fixed to that background so they aren't all taking on that background. My thought is the child elements are transparent background, so they show the parent element's background, but the parent background only displays where those elements are in the viewport, similar to how text masking is, but for divs....
No description

Feedback on responsiviness and javascript use

Hello, I almost finisch a FEM challenge and I wonder how I can improve the responiviness and my javascript. And of course semantic html it is about a form that needs to be validated....

Can you provide guidance on setting up a container that uses an SVG in a different shape?

Hi , i was figuring this out how i can make this container with different shaped svg on left corner can anyone help me how i can do need some kind of reference or any articles which can demonstrate this kind of structure ?...
No description

How to setup the initial layout on a page - where do I put containers?

If you were building a layout from scratch, how would you do it, and where would you put containers? THAT is my biggest hurdle with CSS, can never seem to get it right. ```js <main> <div class="main-wrapper">...

how to fix background breaking

this is my portfolio. i made a absolute background in a self closing div inside a section set to relative, and the background is banding and new lines are forming ever since . can someone help me fix this?
No description

Where do I put the font face?

I was just trying @font-face {} with a CSS file, I was just wondering where this is usually kept at. (I mean the file with the fonts, like a .tff)
No description

Problem positioning content with subgrid

Guys, I'm having a problem positioning the content of my first line. As you can see, I positioned the content of my cards with subgrid, basically I have a layout of 6 columns repeat(2, 2.5rem 1fr 2.5rem). The content is positioned correctly on mobile, but when I switched to the desktop I don't know why I can't get the content in the first line to extend from column line 2 to -2. I think it's a specificity problem, some statement I made on mobile that I'm not overriding when I move to desktop. Could anyone look at my code and help me find where this problem is? Live site: https://sircarloschaves.github.io/single-price-grid-component/ ...
No description

Does anyone know why Kevin used _index.scss instead of index.scss when setting up @use and @forward?

https://www.youtube.com/watch?v=CR-a8upNjJ0&t=242s - this is the exact place where he talks about this. I'm just curious if it should be _index.scss or index.scss and why it should be the case. Thanks!

CSS Custom Properties for every Component

I'm working on a project in Astro and using Svelte to handle all UI components. This project is getting very complex. I have styling for a child component that is specific to a parent component. Is it a bad idea / bad practice to create custom properties in a child with a child's name on the variable? Or, would it be better to have parent specific styling in child? ...

Align cards items in defined grid

Hey, another day is here and I have another challenge for you: Imagine I have a grid defined, and inside that grid are cards (flexboxes) 🃏. I need to align the title, the icon, and the list of text - and the way I always have the title and the first line of the list aligned. And I don't know the height of the box, it's dynamic, based on the number of rows in the list. Space between is probably not usable, because I can have a sheet with different number of items, and they should always be at the title....
No description

CSS Grid question - moving children to appear in 1st row

Hi all, just a vanilla grid question, I would like to move 1st and 3rd child to render at the top (1st row) instead of rendering in the bottom (2nd row). So everything should stay the same but the top row's gap should be used by left and right child instead of spilling onto the new rows, if that makes sense? I can't provide codepen because the code is not readable (Magento2 Hyva + Tailwind stack), the children are actually nested in separate PHTML files and grid is just wrapping over them, if that makes sense. I have applied a bunch of Tailwind breakpoint specific classes to get it to current state. I somehow believe that I'm missing a simple trick to just tell 1st and 3rd child to use the available space in 1st row above them....
No description

Center the img perfect and get it responsive

Hi guys im running into a few problems: My image on a wider screen doesnt fit, even if i make the height bigger it will result that its not fitting on a normal laptop screen. How can i make it fit perfecty Also its not really responsive, the image dissapears when i make the screen smaller. I want the picuture underneath the text on mobiles etc. ...
No description

Help centering an element in a flex container

I have a flex container with flex-wrap: wrap. When it wraps the cta text breaks on another row, but when this happens I need it to be horizontally centered. I thought about creating a media query for when this happens and set justify-self: center to the element but that's a grid property. Any idea on how can I do that?
No description

Setting text of pseudo element from JavaScript

I'm trying to set the text of a pseudo element (::before or ::after) through JavaScript. ```css h1 { --text: "Hello World!";...

Need Advice About Twitter Clone

Hello, everyone! I need advice! I want to create a Twitter clone using only HTML/CSS/JavaScript. So, I found the HTML markup of the tweet section (in Twitter's UI), and there the tweet input field is implemented using div elements. But isn't the text input supposed to be a textarea? And if yes, shouldn't it be inside a form tag?
No description

No width on my grid

This works on a desktop/laptop but on mobile IOS / chrome it has no width, why? https://jsfiddle.net/qd4gboj8/1/