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

Flexbox and borders

Hello there I have a block of text and and an empty div with background color and want to layout them horizontally using flexbox. All works great until I add border to the empty div. For some reason the borders are not accounted for the width and instead added on top of the resulted width of the div. As a result the div is wider than the text block. the box-sizing property for everything is set to border-box if that's relevant. Is this the expected outcome?...
No description

Framework vs Vanilla JS

Apologize for a noob question. I was wondering what’s the best way to tackle authentication, routing, search, and state management in multi page web apps? Should I use a framework or is vanilla JS sufficient? I have gotten conflicting opinions. I am working on a project from Frontend mentor. https://www.frontendmentor.io/challenges/entertainment-web-app-J-UhgAW1X

nav ul not taking whole height space

yeah basically, i've been staring at the code for half an hour and couldn't find anything to fix, i ideally want it to take the full height space here's the codepen: https://codepen.io/staticoly/pen/BavXBPz...

transform chain positions - how is it organizing these?

https://codepen.io/Laing91/pen/OJreYLK As you can see in the codepen, without transform they both start at the same point, but with it, they end up at different points, and the only thing different is translate/rotate are swapped (Same values). Is anyone able to explain why it's ended with them at different locations? the course isn't too clear on it, and I'd like to know πŸ˜„...

Creating a responsive figure with caption, without using layout models (i.e grid, flexbox)

Say you have a parent container of a fixed height but variable width. The parent contains an image and caption. The caption height is set to min-content and will wrap as the parent width's decreases. Can you set the image to fill all the available height, using 'classical' css properties and without overflow? ```html <figure> <img />...

Image Caption width of Image

Well hello everyone, I have a given size (fullscreen modal) in which I want to show an Image as large as possible. That would be easy with object-fit: contain but unfortunately the image also needs a caption below it, that should have the width of the image itself. If the image was always landscape that would be easy, but it might have any aspect ratio. I added an image how its supposed to look like and I have a codepen, where I tried around with grid and flex, but couldn't find a solution. Thank you for your ideas πŸ‘οΈ https://codepen.io/tobiaswust/pen/rNoEYXV...
No description

Carousel not working even though Javascript is Correct:

I am creating a portfolio and one of the features I've provided is a carousel where you can scroll through my monthly music rotation. I have defined the function for the forward and prev buttons the result is I'm not getting a response but the console is reading it. Here's my code below: ```
<div className='w-full h-auto flex gap-72 justify-center'>...

Why the container does not work?

Hi everyone, I need clarification about why the container does not limit the image size. I've read some articles that say the width of image should be 300px at this example. https://codepen.io/CodingTrain_1/pen/PoXrEOV...

HTML elements incompatible with different device resolution

When the site is viewed on 100% zoom (normal) the site is perfectly fine, but when trying to view the website with developer tools (f11) emulator, the site elements are not positioned well or as intented. I need help with the positioning of my html elements so that it supports on multiple devices with different screen resolution/dimension. https://codepen.io/Lithundir/pen/BavgYJz -- some assets won't load cause its local file https://www.youtube.com/watch?v=WIR73untges...

Not the same in other browsers

I was trying to find a way how to achieve fixed height for table's body, after some time, I finally found solution, but now this code won't work exactly the same way like in Chrome browser. GOAL: trying to make code to work in different browsers (works in Chrome, but not in Firefox) TRIED: I thought, maybe I need prefixes, but nothing changed. I think the issue is with table's container height, but not sure how to fix it now, without breaking inner code ...
No description

Scaling/Dimension problem

How do i fix the position of the elements? so that it's well supported for all types of device's dimension. New to HTML https://www.youtube.com/watch?v=WIR73untges...

eventlistener JS

i need help with javascript. here is the code linked: https://codepen.io/gsadopkgj/pen/zYyVPgr scroll down to the "SUBPAGE CONTENT" comment in the javascript pen. essentially in the comments i explain what i'm trying to do there....

Neon Button

Hello! Im following Kevins Tutorial for the neon button with reflection, Im between 6:20 and 7:39 and this is my CSS code so far. Every time I update my live server it is not showing the glow that the button should have, A picture and links down below any help would be appreciated! :root { --clr-neon:hsl(317 100% 54%); --clr-bg: hsl(323 21% 16%);...
No description

Prevent tab navigation on child elements from a "collapsed" element

Hi, I'm making a container element that holds a list of items. This container can be collapsed or expanded, like an accordion, and I'm achieving this effect by adjusting the max-height property, which hides the elements inside of it visually but are still present in the DOM. Because of this, they are still reachable through tab navigation, but I'd like to avoid those items from being interacted with when the accordion is collapsed. I thought that using tabindex="-1" on the accordion or the list parent would be enough but it seems this attribute does not cascade to the children. Is there an easy way to do this using only HTML/CSS? https://codepen.io/D10f/pen/MWZMOvx...

Notification on icons

I have make round black notification with numbers on top right of icons, please check is this is good way to make or not, I am bit confused about it, looking forward to your point of view, thanks https://codepen.io/hamzacodepen951/pen/qBLzXOm...
No description

can anybody help me to build this effect.

effect desc - whenever circle hovers an element the color of the text changes but the catch is that the color of the only circle region changes not whole elem. even if half w element is selected than half w color will see change. see below the effect for better understanding .
No description

responsive videos, loaded based on view port width

I'm trying to find the best possible way to add responsive videos to the background of my site. I would have loved to use something like srcsets for the picture element but as far as I see, thats not a thing yet. Are there any css native options to do responsive videos – loading different videos for different view port sizes? or would I need to go down the javascript road for something like that?

Div element should have same height based on the background-image height

Hi All, This is first time i am asking a question, if you see any problem in QA pattern please help to correct me that is highly appreciable. Question :- how can any div/html element will auto-adjust their height based on the background-image height....

Would you make this a table?

I feel like this looks like a table so it should be a table; but it would be much harder for me to style this I believe as a table.
No description

Adding bc to a buttton

i tried googling and found a way that worked for most people which was using the 'background: url()' selector, but that still didn't work for me. so somebody please help. heres a codepen: https://codepen.io/staticoly/pen/poqXopY...