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

fieldset & legend

Hey, i have a couple of questions: 1) is the fieldset tag simply just used for grouping inputs and labels within a form or is there more to it? 2) is the legend tag used to simply label the fieldset, or is it used for a question like in the example image? 3) what makes the legend tag sit on top of the fieldset border (see image). Is this just built in functionality since there isn't anything in the user agent style sheet that could place it there, such as position: absolute? Is there a way to move it?...
No description

How to Enable Responsive Horizontal Scrolling for Flex Items in CSS?

I'm trying to create a responsive horizontal scrolling effect for a set of .package items using Flexbox in CSS. When there are more items than can fit on the screen, I want the overflow items to be accessible via horizontal scroll. This should be responsive based on the user's screen width. However, I'm encountering issues when the screen width is smaller than 1200px. The items either overflow without enabling scroll, or they don't display as intended. html code ```html...

White space between rows when using flex: wrap

Am trying to make a navbar, but when I use flex: wrap and the navbar shrinks, there is a lot off space between the first row and the second row (see image). Here you is my html and css https://codepen.io/lccua/pen/OJKXRPZ
No description

Color contrast checker, automatic suggestion?

what do u guys use to check for color contrasts? like this but that it automatically finds the matching opposite color? If a site like that even exists?
No description

How Supported Is Supported Enough?

This is a two part question. 1) What % on can i use is enough for you to use something in a production project? 2) What is the difference here? One is 70 and one is 90% but I'm not sure on the distinction....
No description

Prototype in JavaScript

Hello guys, can someone explain roughly about what prototype is in JavaScript please; I just had a look at it, from what I've understood, prototype deals with about what properties/methods are inherited from the class/constructor our object is being instantiated of. But I'm having a bit of difficulties to understood the diagram... can someone explain it please... also, was that correct to say that we can create an instance of an object using a constructor?...
No description

this keyword used on properties and methods when creating a new object in JavaScript

Hello guys, I just read that the purpose of the this keyword is to refer to the current object being executed... so writing something like this.name = name means that on that object particular being refered, we want to assign the name to it. This makes sense when we want to use a property but why should methods also have the this keyword?

Is it possible to create something like this with just CSS?

I can visualise some of the animations but I dont know if its all possible with CSS or would something else be used instead. Heres the link to what I am talking about https://dribbble.com/shots/24359214-Restaurant-Website-Design-Concept...

Styling cells that span multiple rows

I'm attempting to build a timetable using HTML tables and apply a class that visually indicates the current event using a bit of js. Each row represents 30 minutes, and different events last for different amounts of time. I've worked out how to apply the styles to cells in a given row, and worked out some logic for selecting the right <tr> based on the current time, but longer events span multiple rows and only receive the styling while the first 30-minute chunk (i.e. the row that the cell starts in) has the class applied....

Improving placement and transform for rotated items in a wheel

So I've been playing with this concept of having tasks divided into twelve months, a concept known as a year wheel. The idea is to display only a portion of it, because looking at the whole wheel gives you a headache, no matter how the text is flipped. And when you scroll, the wheel spins (scroll-driven animations). Here's my prototype: https://codepen.io/huma-erik/pen/dyxMwLK As you can see, it works as intended, except for having each .month align to the middle of the wheel. They do if there are two task items within .tasks, but that's just because an ugly hack with margin-block-start: -18px. Other amounts of tasks will be slightly misaligned, because their rendered heights isn't 18px * 2 (inspect the month of Nov, and you'll see). I tried using translateY(-50%) instead, but that's in conflict with items being rotated. Should I use trigonometry for this, or is there an easier approach?...

Any AI tools for this?

I want a mobile visual representation of this desktop design although i don't have access to the Figma file. Any help, please?
No description

Gradient Border Animation

I am trying to make a smoothish animation around this border, but cant really use an svg in the markup. Its almost right except at the 0deg and 180deg mark it gets very very small. is there any values i can adjust so that its about the same length all the way around, doenst have to be perfect . Also im putting the pseudo elements on the parent because i had them on the anchor tag which was working until the 'hang" and hang-sink" animations ran on hover, then the z-index stopped keeping the pseudos behind the button and they were instead on top. <- this link shows the behaviour im getting with the pseudo elements on the <a> instead of the wrapper. i would like to be able to put the pseudo elements on the <a> itself and not the parent wrapper so it inherits the animation and the border radius but am not sure how to combat the z-index issue....

Alignment

I am having hard time aligning this on the same line. Please, can anyone help me?
No description

My letter got scatter due to my css styling

my letter got scatter in my css please help me out in my browser it dispay like that my css and react file is there so you can help me out

use strict & data storage

Hey, i have a couple of questions: 1) I understand "use-strict"; is used to prevent mistakes and stop bad code from having a chance of running. Does anyone have any examples of something that is considered bad code running without the use of use-strict and then it not working when you add it? 2) let's say you have a tab system (see image for example). When you click on a different tab, the html changes to content relevant to the tab. Where is an appropriate place to store the data (text, image etc.) before inserting it to the page? I'm aware you may do this by changing .innerText/.innerHTML values and the value of the src attribute for the image, but storing them in variables or something doesn't quite feel right, though i may be wrong....
No description

Does `aria-labelledby` work if the id is on a parent element?

I have a unique use case where I have a {{ heading }} twig expression that renders markdown. So {{ heading }} will evaluate to something like <h2>Lorem ipsum</h2>. Therefore, I need to put the id on a parent element (see attached). Will this still be accessible? I'm trying to provide a name to my section...
No description

Creating a triangle connecting a div and a point on an image

I'm trying to sort out the best way to create the lower opacity triangles you see that connect the boxes with the names of the deltas on the left with their locations on the right. The solution only needs to work on larger viewports (once the elements stack the triangles aren't necessary). My default idea is finding a way to get three points with JS (top and bottom right of the box and then a rough estimation of the point on the map), then create a shape from those three points (somehow). I feel like there might be a way to do it with pseudo elements, but I'm not sure that's actually possible. What's the right approach here? If it matters, it's setup using grid, and it goes 1 (white boxes), 2 (map), 3 (colored boxes) so that it will stack in the right order on narrower viewports....
No description

Following "infinite horizontal scroll animation" tutorial from Kevin on Youtube; not working (help!)

So, I was following everything in this video: https://www.youtube.com/watch?v=iLmBy-HKIAw&t=530s&ab_channel=KevinPowell And everything was working right until the javascript part came in, where for some reason the "data-animated" attribute isn't being added. Here's screenshots of my code as I followed it from the tutorial:...
No description

Issue in playing the video.

Hey guys, so today i enrolled in the 21 days long Responsive Layout course but i am stuck in one video . The video is not playing , it has two resolutions set 240 and 1080. My internet is working properly. But the video is not playing . How can i watch the video. TITLE OF THE VIDEO : " Why it's a good idea to avoid height ". This is the 3rd video of day1. Can anyone please help.

Event bubbling in JS

Hello guys, sorry to disturb you all; in order to stop an event from propagating to its parent element, we can use the following code: ```js const container = document.querySelector('#container');...