Anchor Is The Best New CSS Feature Since Flexbox

  Рет қаралды 337,444

Web Dev Simplified

Web Dev Simplified

6 ай бұрын

Full Video: • CSS Anchor Is The Best...
🌎 Find Me Here:
My Blog: blog.webdevsimplified.com
My Courses: courses.webdevsimplified.com
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/WebDevSimplified
CodePen: codepen.io/WebDevSimplified
#Shorts

Пікірлер: 174
@mohammedshahid7884
@mohammedshahid7884 6 ай бұрын
This removes so much hassle which comes with relative position
@unhhgcrxexhjvuvujchcrzwzwz7956
@unhhgcrxexhjvuvujchcrzwzwz7956 5 ай бұрын
Stuff is so annoying
@antoniorocha9438
@antoniorocha9438 5 ай бұрын
Finally, a real "relative" positioning feature.
@raygong3964
@raygong3964 5 ай бұрын
For anyone wondering about browser support, this feature is still just a proposal, only chrome supports it as an experimental feature atm(not enabled by default)
@therealmist14
@therealmist14 5 ай бұрын
I'm guessing that's why I couldn't find this in "caniuse"
@edism
@edism 4 ай бұрын
Ffs
@soadsto
@soadsto 2 ай бұрын
they are taking forever to make it happen
@SirusStarTV
@SirusStarTV Ай бұрын
Now google chrome 125 has it
@yourlocalhuman3526
@yourlocalhuman3526 Ай бұрын
Ruined all my plans FFS
@chillin5703
@chillin5703 6 ай бұрын
FINALLY! I had been artificially replicating this using absolute and relative but it's such a pain in the arse. What a time save.
@rayaqin
@rayaqin 6 ай бұрын
making hover popups with this might be a nice experience
@thildamoon
@thildamoon 3 ай бұрын
That what i thought right away too!
@IStMl
@IStMl Ай бұрын
Popover API?
@MattDunlapCO
@MattDunlapCO 17 күн бұрын
Popover fixes z-index and anchors fix positioning. Anchors can also flip to the other side if there is no space.
@Kianfox
@Kianfox 5 ай бұрын
"works out of the box" I get it!
@garyduell3768
@garyduell3768 6 ай бұрын
Why couldn't this feature come out 10 years ago 😢
@chezchezchezchez
@chezchezchezchez Ай бұрын
Because things freaking evolve, dude
@IStMl
@IStMl Ай бұрын
@@chezchezchezchez it's called "relative" positioning.
@isuke01
@isuke01 15 күн бұрын
Because we still need next 5 years, it is supported only in the Chronium.
@sohamsarkar911
@sohamsarkar911 5 ай бұрын
This guy is single handedly carrying my career at this point
@sunflair-wa
@sunflair-wa 5 ай бұрын
samesies!
@sohamsarkar911
@sohamsarkar911 5 ай бұрын
@@sunflair-wa 🫂🫂
@chezchezchezchez
@chezchezchezchez Ай бұрын
Buy him a coffee then
@jamshediqbal7936
@jamshediqbal7936 2 ай бұрын
I think it would be useful if we want to show tooltip for an element.
@ruudlaff10
@ruudlaff10 5 ай бұрын
This has the potential to entirely change how we structure pages. It could even allow us to return HTML to it's semantic roots...
@_a_9773
@_a_9773 5 ай бұрын
It's a cool feature but u exaggerating man
@warrenarnold
@warrenarnold 5 ай бұрын
​@@_a_9773no my guy is fr, it was the remaining feature to complete html5
@yourlocalhuman3526
@yourlocalhuman3526 Ай бұрын
Don't get stiff bro😂
@mamertvonn
@mamertvonn 5 ай бұрын
Wow.... now css can start looking like scene tree, just like a local transform of a child to it's parent
@kierandansey7293
@kierandansey7293 5 ай бұрын
It's great addition. QML has been doing this forever and extend it to include height, width etc
@TonyNieuwenhuijs
@TonyNieuwenhuijs 4 ай бұрын
Golden knowledge Kyle, it's safe to say that every web-developer wil encounter a situation where this kind of "Relative" positioning is needed within their project.
@user-vx3ps5rc5l
@user-vx3ps5rc5l 5 ай бұрын
fantastic for dropdowns!
@RobertDogo
@RobertDogo 5 ай бұрын
No more relative on parent and absolute on child
@TheRiteHand
@TheRiteHand 5 ай бұрын
Cool to have the functionality, but the css working group has once again come up with novel/exotic syntax that bears no resemblance to anything else in the spec and will never be repeated again. This lack of consistency and elegance is unfortunate for, you know, the thing that's supposed to lend consistency and elegance to the web.
@MaxPicAxe
@MaxPicAxe 2 ай бұрын
Literally just needed this the other day thanks
@top_loserrr1221
@top_loserrr1221 2 ай бұрын
man, this help my project a lot... thanks
@johndevnoza4223
@johndevnoza4223 5 ай бұрын
for me it is very very wierd that anchor didnt existed in css for so many years, since begining of graphic design or animation or anything related to visuals, anchor exists in all the softwares, like photoshop after effects ETC, so they could just took an idea of anchor from them ,as they did for positions, rotations ETC. idk this took so long to have in css :D
@Dylan_thebrand_slayer_Mulveiny
@Dylan_thebrand_slayer_Mulveiny 5 ай бұрын
Would be infinitely better if it didn't eat the ID attribute.
@saadamehdi2848
@saadamehdi2848 2 ай бұрын
Yes we need to anchor elements to the first element matching selectors. At least classes. Where stuff appear should be a css/présentation issue. Right now it's useless pretty much.
@emedeirox
@emedeirox 6 ай бұрын
This reminds me object delphi
@jeff4r533
@jeff4r533 Ай бұрын
relative position left the chat
@kalibmartin7062
@kalibmartin7062 19 күн бұрын
😂😂😂😂😂
@ahassan5
@ahassan5 Ай бұрын
I use a css library or framework so i dont have to worry about this kind of stuff.
@LePhenixGD
@LePhenixGD 5 ай бұрын
Man that's incredible!!! Finally you won't need to worry about nesting an absolutely positioned element to a relative parent container Amazing stuff Kyle!
@tonybowen455
@tonybowen455 6 ай бұрын
This is incredible, ty!
@osraneslipy
@osraneslipy 5 ай бұрын
Thats so freakin awesome. This removes like 3 tons of concentrated pain from css element positioning.
@MrAlao675
@MrAlao675 5 ай бұрын
Awesome, what about browser compatibility?
@dennistja656
@dennistja656 4 ай бұрын
Thanks I think this has the potential to fix a problem I have or had
@thedelanyo
@thedelanyo 2 ай бұрын
This could be really useful in tooltip designs
@memesalldayjack3267
@memesalldayjack3267 2 ай бұрын
that sounds good, I'll mess around with it eventually, but i got used to using divs as the anchors essentially, so i might not actually use it
@ran_css
@ran_css 26 күн бұрын
Wooow now I'm understand anchor
@MonkeyD_Luthy
@MonkeyD_Luthy 5 ай бұрын
This is pretty cool .. new info for me thanks dude!
@perfect.stealth
@perfect.stealth 5 ай бұрын
This is absolutely gold. Drop downs just became much easier.
@mauriciomueller86
@mauriciomueller86 5 ай бұрын
This will be great to style menus and animations
@CodingScot
@CodingScot 5 ай бұрын
I so need to go back and learn CSS all again 😮
@germanballstuttgartball5291
@germanballstuttgartball5291 3 ай бұрын
Wow. Just today I dived deeper into the position property and wondered if you can set the anchor like that. This is really helpful. Thank you so much.
@shallonp5807
@shallonp5807 5 ай бұрын
This was so useful
@KatchMK1
@KatchMK1 4 ай бұрын
Wow this is really nice!
@quoclam7140
@quoclam7140 5 ай бұрын
I literally had to position something right before this video came out
@paulatony8657
@paulatony8657 2 ай бұрын
Awesome Feature
@haryanvideveloper777
@haryanvideveloper777 4 ай бұрын
Is there any way to make a fixed position element relative to a div ?
@koshalparwan3945
@koshalparwan3945 5 ай бұрын
It is not yet compatible with other devices, though 😢
@mob_abominator1868
@mob_abominator1868 6 ай бұрын
While this is very cool, the support for this rn is not very good, it's around 79%. Though I'll be sure to use it when the situation improves.
@appelsap45
@appelsap45 6 ай бұрын
Where do you go to see what the support is for this?
@mapledanish3662
@mapledanish3662 5 ай бұрын
Browser support makes this unusable for now, unfortunately.
@SirusStarTV
@SirusStarTV Ай бұрын
They don't have a solution to dynamic arrow positioning in popups when the popup goes out of edge
@abots
@abots 6 ай бұрын
Does anyone know browser compatibility for this
@Seven77tw
@Seven77tw 5 ай бұрын
I can't find docs of anchor attribute on MDN
@Mrfrontend
@Mrfrontend 2 ай бұрын
I don’t think browser support is good enough to replace relative / absolute positioning in my opinion yet. A cool experimental feature I hope gets more support tho.
@sourabhmalviya1893
@sourabhmalviya1893 4 ай бұрын
Reminds me of Android constraint and relative layouts ❤
@dreewhispers9408
@dreewhispers9408 5 ай бұрын
8 years writing CSS and i never used this, amazing stuff, no need for containers
@phil8899
@phil8899 2 ай бұрын
Why when you called it blue does it still go to that anchor and not by its id
@user-gr1rg5hu1x
@user-gr1rg5hu1x 6 ай бұрын
Kyle , what's your secret to always be updated with newest css features please ?
@WebsiteDevelopment-Uk
@WebsiteDevelopment-Uk 5 ай бұрын
caniuse website is the source for new CSS and html
@manuelcasares7270
@manuelcasares7270 4 ай бұрын
he travels to future and watches his own videos.
@zeusek-2137
@zeusek-2137 6 ай бұрын
id attribute is coming to play
@IAmMrLiverpool
@IAmMrLiverpool 6 ай бұрын
Awesome feature 🎉❤
@ankursehdev5448
@ankursehdev5448 4 ай бұрын
how is the support on various browsers?
@Oprichnik765
@Oprichnik765 5 ай бұрын
When will it be available? Can find it on caniuse
@thierryvt
@thierryvt 5 ай бұрын
aah yes, we're gonna position this orange square relative to the blue one therefore we must set the position to absolute! CSS makes so much sense lmao.
@Draghful
@Draghful 3 ай бұрын
This is a game changer. Holy cow :o
@bdedu
@bdedu 5 ай бұрын
The link you provided on description not working.😢
@Michael17000
@Michael17000 8 күн бұрын
Okay nice but it could be chaos in relative complex HTML and CSS after couple of developers with their own coding styles :) But cool, I didn't know that.
@WebsiteDevelopment-Uk
@WebsiteDevelopment-Uk 5 ай бұрын
Is it worth learning js
@epicmetod
@epicmetod 3 ай бұрын
Finally vanilla frontend stepped into 2001 In next 150 years we can build dynamic interactions using vanilla with ease without framework
@DarrenbyDesign
@DarrenbyDesign 5 ай бұрын
What's the support look like?! I wanna use this ASAP
@Kay_Drechsler
@Kay_Drechsler 3 ай бұрын
Quite a game changer. If just the browser support would be better.
@nandakresna41
@nandakresna41 2 күн бұрын
I'm new into web dev. So, does this mean, we don't have to use relative positioning to the parent element and just use absolute to the child element?
@vinodnaik4546
@vinodnaik4546 5 ай бұрын
Does this work for tooltip with nested elements?
@mikelneonedwin
@mikelneonedwin Ай бұрын
We had to wait for so long....
@YogKing
@YogKing 2 ай бұрын
Sounds a lot like layout constraints in iOS
@philodox13
@philodox13 3 ай бұрын
Can you animate it? That would open up some wild possibilities.
@maxaxanii7878
@maxaxanii7878 6 ай бұрын
It doesn’t work in my nextjs project. Says that type is not assignable, any idea why?
@saent_bass
@saent_bass Ай бұрын
Supported by 0.04% of browsers
@emmanuelsheshi961
@emmanuelsheshi961 5 ай бұрын
finally catching up to qml...
@lerneninverschiedenenforme7513
@lerneninverschiedenenforme7513 5 ай бұрын
your link in the description is neither clickable, nor copyable from a mobile device :(
@yassinesafraoui
@yassinesafraoui 4 ай бұрын
This could be incredible if added to tailwind
@trlolist3332
@trlolist3332 4 ай бұрын
I didnt see this just after i coded entire website....
@Leo_Chan
@Leo_Chan 4 ай бұрын
Now if only the id of the anchor could be assigned in CSS rather than an attribute of the HTML element.
@fase8729
@fase8729 3 ай бұрын
Thx
@JustinLietz
@JustinLietz 5 ай бұрын
This would have been so useful in my html class
@ryan_millard
@ryan_millard 5 ай бұрын
Thank you.
@mykhailohostieiev6513
@mykhailohostieiev6513 4 ай бұрын
'can i use' says it has 0% support in the browsers (works in chrome with experimental flag enabled)
@dhaneesh
@dhaneesh 6 ай бұрын
Useful
@Hadrhune0
@Hadrhune0 3 ай бұрын
it took them only 28 years to get it the right ffffffff way.
@QckSGaming
@QckSGaming 5 ай бұрын
Real relativity that completely breaks the structure of HTML. I am torn.
@peterjordanson4201
@peterjordanson4201 5 ай бұрын
What is the browser Support for it?
@olian7542
@olian7542 5 ай бұрын
Just like fishing a fish 🐟
@christopherolsson9072
@christopherolsson9072 5 ай бұрын
Why is this better the position absolute and relative?
@Ferrohh
@Ferrohh 24 күн бұрын
Ho messo in pausa 20 volte al minuto per assorbire il cringe, però mi sono spaccato ahahah L'ansia sociale ha paura di te
@Skibidi_Male_X
@Skibidi_Male_X 5 ай бұрын
Programmers are built differently
@perfect.stealth
@perfect.stealth 5 ай бұрын
so i just found out this isn't supported in the majority of browsers yet? Chrome (for some reason) doesnt work for me.
@ignrey
@ignrey 5 ай бұрын
This is a more comprehensible syntax change. You already can do that adding the orange within the blue the adding position:relative to the parent element and position:absolute to the child. I like the anchor attribute because now I have the chance to attach an external element that it wouldn't be affected by changes into original element like utilizing overflow:hidden. Overall we're going to a world with less dumb-basic JS scripting.
@jior6
@jior6 5 ай бұрын
Only took 30 years
@maxwebstudio
@maxwebstudio 5 ай бұрын
Oooooh nice one
@PaAndy89
@PaAndy89 5 ай бұрын
Omg ich liebe dieses neue feature!!!
@jsward17
@jsward17 5 ай бұрын
I’m laughing in so much legacy css pain from this 😅😅. A lot of not super useful css features dropping lately but this one nails it.
@8o8inSquares
@8o8inSquares 3 ай бұрын
Oh wow, that’s new for me
@yurisouza5574
@yurisouza5574 4 ай бұрын
Thats fucking dope
@shotkikk_priv
@shotkikk_priv 5 ай бұрын
8 years of developing. Never heard of it
@trashAndNoStar
@trashAndNoStar Ай бұрын
Cool, now lets wait 5 yrs until other browsers get on board
@felipekonig8135
@felipekonig8135 3 ай бұрын
Very nice
@dougm2738
@dougm2738 4 ай бұрын
Wow. Sweet. Never heard of this. Is it new?
@mmoplayah2874
@mmoplayah2874 3 ай бұрын
Browser support?
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 461 М.
Are You Making These CSS Height Mistakes?
8:54
Web Dev Simplified
Рет қаралды 123 М.
Happy 4th of July 😂
00:12
Pink Shirt Girl
Рет қаралды 39 МЛН
Получилось у Вики?😂 #хабибка
00:14
ХАБИБ
Рет қаралды 7 МЛН
КАРМАНЧИК 2 СЕЗОН 7 СЕРИЯ ФИНАЛ
21:37
Inter Production
Рет қаралды 522 М.
ROCK PAPER SCISSOR! (55 MLN SUBS!) feat @PANDAGIRLOFFICIAL #shorts
00:31
Use these instead of vh
6:06
Kevin Powell
Рет қаралды 481 М.
Learn Flexbox CSS in 8 minutes
8:16
Slaying The Dragon
Рет қаралды 1,4 МЛН
Learn CSS Box Model with Examples
11:15
Amin Mousavi
Рет қаралды 173
A flexbox trick to improve text wrapping
5:02
Kevin Powell
Рет қаралды 187 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 918 М.
Learn CSS Position In 9 Minutes
9:26
Web Dev Simplified
Рет қаралды 1,9 МЛН
CSS Tips And Tricks I Wish I Knew Before
12:12
Lama Dev
Рет қаралды 441 М.
Learn Every CSS Selector In 20 Minutes
19:38
Web Dev Simplified
Рет қаралды 440 М.
The Most Important Skill You Never Learned
34:56
Web Dev Simplified
Рет қаралды 171 М.
5 Modern CSS Features You Should Know In 2024
5:58
Academind
Рет қаралды 78 М.
Happy 4th of July 😂
00:12
Pink Shirt Girl
Рет қаралды 39 МЛН