DEV Community

Cover image for 6 CSS Features to Make a Responsive Website

6 CSS Features to Make a Responsive Website

StakeDesigner on March 01, 2023

Creating a responsive website has become more important than ever. With more and more people accessing the web on a variety of devices, it's crucia...
Collapse
 
thomasbnt profile image
Thomas Bnt ☕

Hello ! Don't hesitate to put colors on your codeblock like this example for have to have a better understanding of your code 😎

console.log('Hello world!');
Enter fullscreen mode Exit fullscreen mode

Example of how to add colors and syntax in codeblocks

Collapse
 
stakedesigner profile image
StakeDesigner

Thank you for the suggestion! Adding colors to code blocks can definitely make them easier to read and understand. I'll keep that in mind for future posts. Have a great day! 😊

Collapse
 
thomasbnt profile image
Thomas Bnt ☕

yay ! 🚀

Collapse
 
codeofrelevancy profile image
Code of Relevancy

Great article

Collapse
 
stakedesigner profile image
StakeDesigner

thank you

Collapse
 
michaeltharrington profile image
Michael Tharrington • Edited

Heyo!

Just a heads up that you can embed these CodePen examples by using the following Markdown:

{% codepen https://codepen.io/StakeDesigner/pen/mdGRowp %}

Just something to consider in the future that would help to make your post even more dynamic!

Collapse
 
stakedesigner profile image
StakeDesigner

Thank you sir for the feedback, yes sure I will make like that next time

Collapse
 
crunchycpt profile image
crunchycpt

Very well written post! I wasn't aware of the clamp and the scroll snap properties. Thank you for this!
One small criticism: The width of a picture of 800x600 pixels isn't 4 times its height (this would have an aspect ratio of 4/1). It is 4 thirds its height, as the aspect ratio of 4/3 already tells ;)

Keep up the good work! 👍🏻

Collapse
 
stakedesigner profile image
StakeDesigner

Thank you sir for the feedback,

Collapse
 
yasuie profile image
Yassine Elo

First time I read about font-size: clamp()
I was struggling a bit with responsive headlines h1-h6 and I solved it by adjusting the font-size in multiple media queries.
But I ended up creating viewport break points that had no other use than declaring the font-size for the headlines ...

From now on I shall use clamp, thanks :D

Collapse
 
stakedesigner profile image
StakeDesigner

I'm glad to hear that you found the information about the clamp() function helpful for your responsive design

I hope that using clamp() proves to be a useful tag for your future design projects, and if you have any further questions, feel free to ask!

Collapse
 
nidhiparab profile image
Nidhi

Very well written!

Collapse
 
stakedesigner profile image
StakeDesigner

Thank you for your kind words! I'm glad that you found my writing to be well-written. If you have any further questions or comments, please don't hesitate to let me know. I am always happy to engage in thoughtful discussion about the topics I write about

Collapse
 
huylong profile image
huylong

Great article

Collapse
 
stakedesigner profile image
StakeDesigner

Thank you for your comment! I'm glad you found the article to be great. If you have any questions or further comments on the topic, feel free to let me know.

Collapse
 
charliekroon profile image
charliekroon

Super useful! I really struggled with making my side project responsive. Wish I would've read this article then, it would've really helped.

Collapse
 
stakedesigner profile image
StakeDesigner

Thank you for your comment! I'm glad you found the article to be great.

Collapse
 
tutrinh profile image
Tu Trinh

Very cool CSS properties. Thank you for sharing.

Collapse
 
stakedesigner profile image
StakeDesigner

Thank you for your comment!

Collapse
 
nauvyram profile image
Muthuraman

Really a great article

Collapse
 
stakedesigner profile image
StakeDesigner

Thank you for your comment!

Collapse
 
adriaanlouw profile image
AdriaanLouw

Thank you for an excellent, detailed article!

Collapse
 
stakedesigner profile image
StakeDesigner

Thank you for your comment!

Collapse
 
davidhccnguyen profile image
DavidHCCNguyen

Man it is going to take a bit for me to take this all in

Collapse
 
stakedesigner profile image
StakeDesigner

I totally understand. The topic can be complex and it's okay to take your time to understand it fully. Don't hesitate to ask any questions or seek further clarification if needed. I'm here to help and make sure everything is clear. Take your time and let me know if there's anything else I can do to assist you.

Collapse
 
web-dev-codi profile image
Web-Dev-Codi

I was under the impression that the middle value in clamp was to bind the first and last values. Meaning at which rate the two values grow until max value is achieved. Correct me if I'm wrong.

Collapse
 
stakedesigner profile image
StakeDesigner

You are partially correct! The middle value in the clamp function determines the range of values that should be allowed. Here's how it works:

Given three values min, mid, and max, clamp(x, min, max) returns mid if x is between min and max, otherwise it returns either min or max.

So the middle value, mid, is not used to determine the rate at which the values grow, but rather it acts as a threshold value that defines the range of allowed values. Any values below min are set to min, any values above max are set to max, and any values between min and max are returned unchanged.

I hope this clears things up!

Collapse
 
web-dev-codi profile image
Web-Dev-Codi

I appreciate the in-depth response. That clears allot of my confusion.

Thread Thread
 
stakedesigner profile image
StakeDesigner

Thank you for your comment!