Happy Sunday! ☺️
Here are some useful CSS Tricks for Frontend Developers👩💻
All examples shown here.
0️⃣ Sticky Footer
Ensure your footer sticks to the bottom of the page, even if the content is short.
1️⃣ Custom Scrollbars
Style your scrollbars to match your site design using the ::-webkit-scrollbar pseudo-element.
2️⃣ Text Stroke
Create outlined text using -webkit-text-stroke.
3️⃣ Viewport Units for Typography
Scale text size based on the viewport using vw units.
4️⃣ CSS Grid Auto-Placement
Control the automatic placement of grid items with grid-auto-flow.
5️⃣ Aspect Ratio Box
Maintain aspect ratio with the padding trick.
6️⃣ Clip-Path for Custom Shapes
Create custom shapes using clip-path.
7️⃣ CSS Variables with JavaScript
Dynamically change CSS variables using JavaScript.
8️⃣ Object-Fit for Images and Videos
Control how media fits within a container using object-fit.
9️⃣ CSS Counters
Create custom counters with counter-reset and counter-increment.
Use these CSS tricks to enhance your frontend skills and create more dynamic and visually appealing web applications!
#CSS #WebDevelopment #Frontend #Tips #Tricks
@typical_ddev
Here are some useful CSS Tricks for Frontend Developers
All examples shown here.
Ensure your footer sticks to the bottom of the page, even if the content is short.
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.content {
flex: 1;
}
footer {
background: #333;
color: white;
text-align: center;
padding: 10px;
}
Style your scrollbars to match your site design using the ::-webkit-scrollbar pseudo-element.
::-webkit-scrollbar {
width: 20px;
}
Create outlined text using -webkit-text-stroke.
h1 {
-webkit-text-stroke: 2px black;
color: white;
}
Scale text size based on the viewport using vw units.
h1 {
font-size: 10vw;
}
Control the automatic placement of grid items with grid-auto-flow.
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
grid-auto-flow: dense;
}
Maintain aspect ratio with the padding trick.
.aspect-ratio-box {
width: 100%;
padding-top: 56.25%; /* 16:9 aspect ratio */
position: relative;
}
Create custom shapes using clip-path.
.clip-path {
clip-path: polygon(50% 0%, 0% 100%, 100% 100%); /* triabgle */
background: red;
width: 100px;
height: 100px;
}
Dynamically change CSS variables using JavaScript.
:root {
--main-color: #3498db;
}
function changeCssVar() {
document.documentElement.style.setProperty('--main-color', '#e74c3c');
}
Control how media fits within a container using object-fit.
img, video {
width: 100%;
height: 100%;
object-fit: cover;
}
Create custom counters with counter-reset and counter-increment.
.counter {
counter-reset: section;
}
.counter h2::before {
counter-increment: section;
content: "Section " counter(section) ": ";
}
Use these CSS tricks to enhance your frontend skills and create more dynamic and visually appealing web applications!
#CSS #WebDevelopment #Frontend #Tips #Tricks
@typical_ddev
Please open Telegram to view this post
VIEW IN TELEGRAM
codepen.io
CSS Tips
...
Chat GPT on macOS can read content from application 🤓
To work with a compatible app, first make sure it’s running. Then, in the ChatGPT chat bar, click the Work With Apps button and select a compatible application.
This conversation will be saved in your history.
btw, chat gpt gives more detailed answer, meanwhile copilot just summurized. While both using gpt 4o💀
#ai #chatgpt #webdevelopment
To work with a compatible app, first make sure it’s running. Then, in the ChatGPT chat bar, click the Work With Apps button and select a compatible application.
This conversation will be saved in your history.
btw, chat gpt gives more detailed answer, meanwhile copilot just summurized. While both using gpt 4o
#ai #chatgpt #webdevelopment
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM