How to Easily Create Pill Buttons (Tags) with HTML & CSS
View the SOURCE CODE:
codepen.io/dcode-software/pen...
In today's video we take a look at creating pill buttons (or tags) using HTML and CSS. This design is perfect for search functions, allowing your users to filter by certain things.
🏫 My Udemy Courses - www.udemy.com/user/domenic-co...
🎨 Download my VS Code theme - marketplace.visualstudio.com/...
💜 Join my Discord Server - / discord
🐦 Find me on Twitter - / dcodeyt
💸 Support me on Patreon - / dcode
📰 Follow me on DEV Community - dev.to/dcodeyt
📹 Join this channel to get access to perks - / @dcode-software
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
#dcode #html #css
Пікірлер: 13
Wow, I was expecting more complicated ways of doing it and the video ends! I am amazed by how easy it was to do these. Thank you for sharing.
Hey what is your visual studio theme and how do you make it so that the letters appears smoothly as you write?
Very nice and easy explanation, thanks.
Thank you Brother ,Its Really Help full for me
I used radiobuttons for background color, this way pill--selected has the same background color on reload
please do more web components tuts !
2:50 1 em is 16 px btw not 12 px.
i am not sure if you've already done video for that but would you please consider make a tutorial how to create simple tagging system?
@suelingsusu1339
2 жыл бұрын
here is a script that would do what you asked ... just replace the one in the video with this one... add a few more buttons and see what happens... document.querySelectorAll(".pill").forEach((pill) => { pill.addEventListener("click", () => { document.querySelectorAll(".pill--selected").forEach((p) => { p.classList.remove("pill--selected"); }); pill.classList.add("pill--selected"); }); });
@TomasMisura
2 жыл бұрын
@@suelingsusu1339 Thank you dude, much appreciated :),
ok bro nice but it will be more helpful if u do a video about algorithms step by step and teach us how we solve a problem I'm done with HTML and CSS so please if u can thx
first view
@dcode... this is a better script ... it unselects previously selected buttons and selects the clicked one document.querySelectorAll(".pill").forEach((pill) => { pill.addEventListener("click", () => { document.querySelectorAll(".pill--selected").forEach((p) => { p.classList.remove("pill--selected"); }); pill.classList.add("pill--selected"); }); });