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: How to make something from an iframe stick to the bottom of the parent page?

Hi all, I am trying to solve a particular problem. I have a button on a page which has a property position: fixed, bottom:0 ...

Min height of content, preferred of screen with max

I'm making a landing page and I want the first section to take up full screen (or more if needed for content and padding) but also have some kind of max height, it can be a fixed number or something related to screen width if it works (like max-height: 150vw) but at the moment I can't come up with anything. I made a codepen and at the moment it has min-height: 100vh on the first section and in screenshot 1 you can see it works as intended, it also grows to more than 100vh if the screen is smaller than content+padding. However, if I zoom out (screenshot 2) then it still takes up all of the screen (as expected with 100vh) and I really don't want that to happen. Is there a way to do that? I tried something like height: clamp(???, 100vh, 2000px) but I'm not sure what should go into the first argument of clamp, like ideally I'd want something like fit-content but it doesn't work....
No description

CSS Height Control

I'm having trouble to center everything equally in a grid. For example images or short texts can break the entire flow. What could be the best solution to have everything equal even if the images are short or we have less text compare to others?
No description

Wordpress - Display text dynamically based on URL parameters on Astra template with elementor

I'm using the Astra Theme, I picked one of their starter templates and I'm editing it with Elementor. I would like to add a text to the template that says "Welcome John" where John Doe is replaced by a parameter name that I pass in the URL, how can I do this? Is there a better approach to displaying a dynamic name onto a template? Example: if the link is mywebsite.com/?name='Mike' then the text will be "Welcome Mike" just like what's shown on this video [https://www.youtube.com/watch?v=BskYG-y_t8E] I'm building an invitation so that's why I require each invitation to have the name of the guest. Thanks for any help!...

How do I go about this design?

No codepen because not sure where to start. I was thinking maybe exporting the circles as an svg and using the path as a clip-path? But if I do that, then the green circle on the left would need to be in the image or absolutely positioned on it so not sure how well that would work
No description

slick slider containment issue

I'm being a complete dunce here and cannot for the life of me get the images inside this slick slider carousel to be contained inside the fixed height parent div. Can anyone point me in the direction of a fix please? https://codepen.io/mrjonoces/pen/eYamwRy...

how can we do it?

Is there any way of achieving this line in between as a progress using html css
No description

mousedown event set on parent but keeps getting child element

Basically the title, when having the mousedown event on a parent I only want the target to be the parent wherever I click on the parent but Im getting the child as the target when clicking even though there's no event set on the child. Here's a jsbin to illustrate it: https://jsbin.com/bopoboqire/edit?html,css,js,output ...

CSS pattern matching

Hey everyone, I'm curious if there's a way to apply pattern matching when selecting elements using CSS. In particular, I want to target anchor elements that contain a particular word in their href attribute, for example:
a[href="*keyword*"] {}
a[href="*keyword*"] {}
This doesn't work, but the idea is that if the word "keyword" appears in the attribute "href" it would select this element. Is this possible, or is there something equivalent to this?...

Tracking scripts failing on deployment

Hi all, Not really something I've messed about with but I keep trying to add tracking scripts to a site and they keep failing. Running locally gets this error:
Uncaught TypeError: Cannot set properties of undefined (setting 'q')...

Help with JS logic to close menu if search is clicked, or vice-versa

Hello everyone, I am currently working on my own website and have stumbled upon an issue with the functionality of mobile menu and search toggles in the site header. Here is the link to a pen of my current code: https://codepen.io/is_dhananjay/pen/yLWyYjK...

Nextjs Multi layout setup

Is there a standard way to handle multiple view ui changes in nextjs app dir. I would like to conditionally render a basic / advanced view on a page based on user's choice should I use route groups for each route to handle this setup...

Positioning last div at end, when using flex and flex-wrap

Hi! See screenshot for reference. I'm banging my head against this one. I have a flex container with flex-wrap enabled. I want the last button (class "close-button") to show at the bottom right corner of the flex-container. The number of buttons in the container can be anything. ...
No description

Dark Mode

I have a simple question, when the user on his phone or laptop has his dark mode option on ... Is there a way it doesn't affect the colors on my website?

Does anyone have any tips for up-scaling fonts on retina displays?

I've been trying to use fluid typography to make sure that my sites look good on retina displays, butr I can quite get me head around it to make it work properly. If you have an <h1> that roughly 4.5 rem @3840x1600, how would you go about having it scale proportionately between 1440px and 5120px? Any tips or tricks anyone would like to share? I'm in abit of a jam at the moment....

Text overflowing it's max width when there's no spaces between words

Hey, i have a max-width set on two p tags. As demonstrated with the first tag, it wraps and doesn't overflow it's max-width when the words are separate. However as demonstrated on the second tag, if there's a really long word it doesn't wrap and it overflows. Could someone please explain why this occurs and if there's a way to fix it? Thanks in advance. https://codepen.io/deerCabin/pen/gOJbzWR...

can't highlight text from pseudo element

Hey, i have a heading class that displays a caption underneath it with the text being what's provided in a data attribute. It doesn't let me highlight this text with my cursor though, does anyone know why? Many thanks https://codepen.io/deerCabin/pen/mdYyLdr...

DisneyPlus Sliders

Hey, I was wondering how the DisneyPlus Content Sliders work on the Startpage. Previously it was a flex box with the Video Covers as Childs that were moved in the parent with a transform. But now i canโ€™t figure out how theese new content sliders work. Maybe it has something to do with scroll snapping but i am not sure. I would be glad if someone could help me ๐Ÿ˜„...
No description

Shadcn default styling issue

Does anyone know why default shadcn styles aren't applying?