5 CSS Tips & Tricks for better Responsive Web Design

  Рет қаралды 82,192

Coding2GO

Coding2GO

Күн бұрын

Пікірлер: 87
@Shulkerkiste
@Shulkerkiste Ай бұрын
4:42 The _calc()_ function can be omitted because _clamp()_ supports calculations too.
@PicSta
@PicSta Ай бұрын
Was about to mention the same, glad you did that already🙂
@divi1223
@divi1223 Ай бұрын
Oh cool, didn’t know
@Islandstone89
@Islandstone89 Ай бұрын
0:26 Relative padding 2:02 Responsive font-sizes 4:57 Responsive images 6:59 Dynamic viewport height (dvh) 8:20 HTML inert attribute
@microdotmatrix
@microdotmatrix Ай бұрын
important side-note regarding what you said in the last tip: when adding a transition property to an element, you should always try to avoid using your position/sizing properties. this is what your transform properties are for. like in the example given, do not apply your transition by targeting the property "right: -16px" to "right: 0px", instead use "transform: translateX(-16px)" to "transform: translateX(0)". use scale or rotate as well. your standard position and sizing attributes are calculated with CPU, while your transformation properties are done by GPU; adding transition properties to elements using transformation properties are GPU accelerated, while using the position/sizing and margin/padding values will cause layout re-flow, meaning the browser must recalculate these all of these values when one is changed, which can effect browser performance on the client. depending on where and how the effected value changes, and how many other elements use relative units to the one effected, this can cause a cascade of calculations and a lot of problems.
@AronsDjurHandel
@AronsDjurHandel 7 күн бұрын
To work around the issue of potentially poor cropping of images when using `object-fit: cover;` you can also use the element and pass multiple different image sources through the element for different screen sizes to reduce the amount of zooming of the object-fit on smaller screens and reduce load time of unnecessarily large images on mobile devices! But all in all these are good tips!
@vishsingh7235
@vishsingh7235 3 күн бұрын
I just used for the first time yesterday. Your suggestion is a really smart use case for it.
@dontnowatimdoing446
@dontnowatimdoing446 21 күн бұрын
Omg this is amazing thank you! Subscribed and bell notification on!
@retroklub_tv
@retroklub_tv Ай бұрын
The dvh tip was amazing, thank you!!
@lalitmeena5141
@lalitmeena5141 25 күн бұрын
Bro really deserve sabarscribe ❤
@eazyhoon2124
@eazyhoon2124 6 күн бұрын
That inert attribute look good, and only now I found it? Thanks man
@mateo-hm
@mateo-hm Ай бұрын
This videos are so nice and so helpful for me, soon I will have my web portfolio done and it will be much easier using these tricks, thanks!
@canProg
@canProg 10 күн бұрын
Very nice ! Thank you. Very clear and direct explanations.
@giordano.araujo
@giordano.araujo 9 күн бұрын
great value video 👍
@RASTUDIO_0
@RASTUDIO_0 Ай бұрын
He is a big don of CSS... Thanks Fabian Sir... ❤❤❤❤❤❤❤❤
@fernandobarros1911
@fernandobarros1911 Ай бұрын
Thank you very much, Fabian 👍
@vinodkumarw.bittiwar398
@vinodkumarw.bittiwar398 Ай бұрын
Great 👍 dvh is new for me
@lilrex2015
@lilrex2015 7 күн бұрын
What a great video. You earned yourself a sub sir
@yahyamohamoud2954
@yahyamohamoud2954 Ай бұрын
Bro's explanation is great. easy and simple to understand.
@habibou3057
@habibou3057 12 күн бұрын
Très utile, merci beaucoup 👍
@zeinmayhoub11
@zeinmayhoub11 24 күн бұрын
That was so helpful especially the dvh part which I had a problem with, Keep the great work ❤💪
@adityapatil1361
@adityapatil1361 11 күн бұрын
Nice video you can explain about inert attribute ❤
@br1580
@br1580 Ай бұрын
Learnt a lot, thank you
@CommanderBalok
@CommanderBalok Ай бұрын
Useful tips. Thank you for making this video.
@Dineshkumar-cz8ij
@Dineshkumar-cz8ij Ай бұрын
I did not except this....Great😻
@MuhammadAdnan2.0
@MuhammadAdnan2.0 Ай бұрын
Perfect 👍 well explained quickly...
@spip931
@spip931 Ай бұрын
Thank you for this video. I have a question : for tip number 1, how do you determine the 2 min values ​​(in this case 5em and especially 8%)?
@petarkolev6928
@petarkolev6928 Ай бұрын
Wow, really nice 🙂
@arifhaiman5
@arifhaiman5 Ай бұрын
It is very helpful
@arab_memes
@arab_memes Ай бұрын
Great tips and video 👍
@VideosViraisVirais-dc7nx
@VideosViraisVirais-dc7nx 29 күн бұрын
2:02 this tip is gold. I was frustated because i found boring creating the same property for every screen
@VideosViraisVirais-dc7nx
@VideosViraisVirais-dc7nx 29 күн бұрын
The left is for PC, and the right is for tiny screen. No more hardcode
@gamingzonezone1
@gamingzonezone1 8 күн бұрын
Make a detailed video on css grid topic
@mero.suwadi
@mero.suwadi Ай бұрын
Great video
@malikhanzalaasif
@malikhanzalaasif Ай бұрын
Best tips
@OpeyemiAkinlamilo-qu1ou
@OpeyemiAkinlamilo-qu1ou Ай бұрын
Gold 🔥
@crumblywing
@crumblywing Ай бұрын
thanks for your share:)
@graphnick-dev
@graphnick-dev Ай бұрын
For better responsive sizes not based on the viewport, I recommend using container query units such as cqi. It uses the same clamp approach described, but you world need to add a container context on the parent using container-type: inline-size.
@DjMacV
@DjMacV 3 күн бұрын
wow dvh tip, fix my bug :D
@TheMetalMag
@TheMetalMag Ай бұрын
thank you
@Zap_09
@Zap_09 Ай бұрын
Very nice video. But can you make an updated darkmode switch video. The one you have every time you you go to a different page it flashes white for a sec and the darkmode button doesn't work on the new page.
@marcoiscoolies
@marcoiscoolies 7 күн бұрын
This is weird, but what is the browser being shown in the video with the resizing?
@gamingzonezone1
@gamingzonezone1 Ай бұрын
make a detailed video on @media query
@sarvarbek_dev
@sarvarbek_dev Ай бұрын
With Tailwind CSS, everything is perfect. I never use plain CSS.
@space8143
@space8143 12 күн бұрын
Ahaha😂😂😂 idiot
@danielcastillotamayo
@danielcastillotamayo Ай бұрын
you can now animate from display none with interpolate-size: allow-keywords, so you dont have to do all that workaround, which imo is too much boilerplate. Its almost at 70% in caniuse
@VideosViraisVirais-dc7nx
@VideosViraisVirais-dc7nx 29 күн бұрын
Clamp Min, std, max
@renekomane
@renekomane Ай бұрын
What is the difference of using aria-hidden="true" or inert ?
@dedse3
@dedse3 Ай бұрын
There's always a hidden CSS feature, there's always one!
@l0ad1ng55
@l0ad1ng55 Ай бұрын
and I see this video after I finished my first big website…
@lullkaz
@lullkaz 11 күн бұрын
Me too....
@m4adz766
@m4adz766 16 күн бұрын
Thème name please ?
@ElectricKota
@ElectricKota Ай бұрын
Nice video, I have some tips for you. For the mobile menu, avoid using JavaScript as it's unnecessary. Instead, use an input of type 'checkbox' to toggle the menu, and a label for it as a button. In CSS, use the Visibility property to hide it from the page, combined with opacity and transition to achieve the desired effect. For the heading, you can use @container queries if you have the heading only in part of the page. And pro tip: if you use REMS, set HTML to 10px; this makes calculations for setting your sizes easier. Don't forget to set up BODY to 1.5rem for elements that you forget to style, otherwise, they will appear small
@Kpt.
@Kpt. Ай бұрын
We need to change aria attributes dynamicly which are essencial for the accesibility. Edit; Also for your pro tip, i cannot test it right now but probably it is same as changing HTML font-size to 62.5%, so some cons for that: Potentially huge accessibility problems for anyone who changes their default font size Changing defaults is unexpected, so can confuse other developers (or even yourself in the future) Hard to maintain and even harder to remove later on Conflicts with third-party code Many engineering teams will look negatively on job applicants who use this in their code, because they are aware of the issues it can cause.
@Shulkerkiste
@Shulkerkiste Ай бұрын
Most sites have a default size of 16px. In general, it's recommended not to set the default size to 10px, but instead use 1rem = 16px as normal.
@ChuckWatson
@ChuckWatson Ай бұрын
The checkbox hack is not totally accessible and not good with screen readers, it should be avoided. Also mucking up font size on the html element is not a good idea at all since it is not expected and can lead to unusual behavior.
@konstantinosntamadakis9439
@konstantinosntamadakis9439 Ай бұрын
Bro all your tips are not considered good accessibility practice, at least for the checkbox and html font sizes
@mattwood8659
@mattwood8659 Ай бұрын
This is how I've always done it to. Use a checkbox to toggle it open and close. Yiu don't want access for your content to be dependent on JavaScript. But I think it's okay to use JavaScript just for the accessibility part of it. Alot of acessability requires JavaScript anyway
@alexanderleonidas3260
@alexanderleonidas3260 Ай бұрын
Big!
@anabi5158
@anabi5158 Ай бұрын
👍👍👍👍👍👍👍👍
@Andrea-t4j5v
@Andrea-t4j5v 29 күн бұрын
how many sites don't take into consideration CLS for publicity banner and images.. I hate when the paragraphs shift up or down while I'm reading, every time one of those banner is loaded
@mzvvz
@mzvvz Ай бұрын
Nice google
@HassanJanjua-lm9te
@HassanJanjua-lm9te Ай бұрын
Can anyone suggest some videos on how to make a website responsive? I'm kind of stuck
@techpukhraj
@techpukhraj Ай бұрын
Create KZbin video downloader website please
@waldemarnosinski6836
@waldemarnosinski6836 Ай бұрын
I don't know why but my container isn't centering?
@Bdjsisbsjsj
@Bdjsisbsjsj 29 күн бұрын
Use display flex on parent element
@groovebird812
@groovebird812 Ай бұрын
It is an illusion that all images of the page have the same dimensions or aspect ratio. You should not use this for the global img tag, instead use a class
@enriqueruiz320
@enriqueruiz320 5 күн бұрын
😱
@zaheerrhman
@zaheerrhman Ай бұрын
Please add Hindi in the Video Track
@mohammedAli7106
@mohammedAli7106 Ай бұрын
make full tutorial for css sir
@The-Great-Brindian
@The-Great-Brindian Ай бұрын
10 mins of invaluable tips for devs of all backgrounds. I knew just 3 of these, and one partially, lol 😅
@مازنالفار-ز1ز
@مازنالفار-ز1ز Ай бұрын
Do you have a project for a website with login, verification and permissions html css javascript node js
@VideosViraisVirais-dc7nx
@VideosViraisVirais-dc7nx 29 күн бұрын
4:45 this is getting very spaghet ngl
@HunterZolomon
@HunterZolomon Ай бұрын
Thanks, useful stuff. But I'd do it differently for 5. Tip 5: Instead of using 2 different buttons in 2 different places, use one toggle button on top of everything else that visually morphs between hamburger and X, but stays in the same spot. Simpler, cleaner and faster nav. (I realize you may be doing it to demonstrate the inert function, but I always felt a single toggle button works best.)
@coding2go
@coding2go Ай бұрын
Thanks for sharing! It is a great solution
@letmewatch.
@letmewatch. Ай бұрын
Could you show a demo code for this via codepen? 😬
@LawJolla
@LawJolla 3 күн бұрын
Variable padding is bad ui
@WaqasAli-dq9wg
@WaqasAli-dq9wg Ай бұрын
Luftwaffe 😂
@PicSta
@PicSta Ай бұрын
Tip #3 is where I'll disagree. Defining an aspect-ratio on an image tag, like for a CSS reset, is not a good choice. We usually have different images for different needs and purposes on our website. I'd rather style the IMG tags based on their specific section. A good example will be article images where you wish for all the same sizes, then a proper solution would look like so. section.someclassname img {...} So globally I wouldn't set this, but for a specific area it's an ideal problem solver.
@coding2go
@coding2go Ай бұрын
Yes, we actually mean the same thing. I wouldn't use it for a css reset either. Only to maintain consistent dimensions within a specific section. I only used the img tag selector in the video because there was nothing else on the example website. On production level the selector would be different (depending on where the image is used). Hope that clarifies it ✌️
@PicSta
@PicSta Ай бұрын
@@coding2go I think you wouldn't do that in a reset, but others might do that as they have seen it like this. Maybe next time you can explain it in a better contextual way. Of course, this is just constructive criticism, and take it easy, Fabian.
@FarhanAli-s7u
@FarhanAli-s7u Ай бұрын
First. You can say "first reply on whole video" on this comment
@dev.RobiulHassan
@dev.RobiulHassan 3 күн бұрын
please add bengali in audio track.
@rudra9535
@rudra9535 19 күн бұрын
thank you
The problems with viewport units
13:23
Kevin Powell
Рет қаралды 371 М.
10 CSS PRO Tips and Tricks you NEED to know
9:00
Coding2GO
Рет қаралды 132 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Useful & Responsive Layouts, no Media Queries required
11:03
Kevin Powell
Рет қаралды 187 М.
The CSS Display Property is Changing Forever
15:20
Web Dev Simplified
Рет қаралды 90 М.
Inverted Border Magic: Stunning CSS Masking Effects!
11:35
Devly Code
Рет қаралды 25 М.
Learn Flexbox CSS in 8 minutes
8:16
Slaying The Dragon
Рет қаралды 1,8 МЛН
I Spent 100 Hours Inside The Pyramids!
21:43
MrBeast
Рет қаралды 42 МЛН
Learn CSS Flexbox in 20 Minutes (Course)
20:37
Coding2GO
Рет қаралды 378 М.
7 Design Patterns EVERY Developer Should Know
23:09
ForrestKnight
Рет қаралды 323 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 994 М.
The Easy Way to Design Top Tier Websites
11:54
Sajid
Рет қаралды 726 М.
Top 10 Advanced CSS Responsive Design Concepts You Should Know
20:16
Web Dev Simplified
Рет қаралды 552 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН