Automatically translated.View original post

css transition

# Web Site Writing Basics

# CSS

# trasition

CSS transitions are features in CSS that make changes to properties (properties) of web elements occur smoothly instead of changing them suddenly. You can define Transition properties such as transition-delay, transition-duration, and transition characteristics (transition-timing-function) to control the change of values from one state to another, such as changing the background color gradually when the user hovers (hover) the mouse, to add a good and interesting experience to the user.

Working Principles

Change of status:

CSS transitions work when the properties of an element change in value, such as from a normal state to a hover state or focus.

Default and final values:

Transition determines the default and final values of that property.

Delay and duration:

You can set the change to start, delay, or determine the amount of time required for the change to occur gradually.

Easing Function:

You can determine the speed of change, such as starting fast and slowing down (ease-out) or changing at a linear speed.

How to use

You can define CSS transitions with the features:

Transition-property:

Identify which properties require transitions.

Transition-duration:

Determine the amount of time it takes to change the value.

Transition-delay:

Define a delay before the transition starts.

:

Determine the rate of acceleration of change.

Transitional:

It is a shortened property (shorthand) that combines these properties in one line.

Example of use

Suppose you want the background color of the button to change gently from red to blue when hovering the mouse. You can write the code as follows:

Code

. My-button {

Background-color: red;

Transition: background-color 0.5s ease-out; / * Define to change the background color in 0.5 seconds * /

}

.my-button: hover {

Background-color: blue;

}

2025/9/5 Edited to

... Read moreนอกจากการเข้าใจพื้นฐานของ CSS Transition แล้ว การเลือกใช้การเปลี่ยนแปลงที่เหมาะสมในแต่ละส่วนของเว็บก็สำคัญมาก เช่น การใช้ transition กับปุ่มที่ผู้ใช้งานจะกดบ่อยๆ จะช่วยให้รู้สึกตอบสนองได้ดีขึ้น และลดความกระทันหันของภาพที่เปลี่ยนไปอย่างรวดเร็ว ข้อควรระวังคือไม่ควรใส่ transition ในทุกองค์ประกอบพร้อมกัน เพราะจะทำให้เว็บไซต์ช้าและผู้ใช้รู้สึกว่าการเคลื่อนไหวดูเกินจริง ควรเลือกใช้เฉพาะจุดที่สำคัญ หรือเพิ่มชีวิตชีวาให้กับส่วนที่ต้องการเน้น ตัวอย่างที่ใช้ transition ยอดนิยม เช่น การเลื่อนสีพื้นหลังเมื่อโฮเวอร์เมาส์ หรือการเปลี่ยนขนาดตัวอักษรอย่างนุ่มนวล เพื่อให้เว็บไซต์ดูทันสมัยและมืออาชีพมากขึ้น ยังมีเรื่อง easing function ที่ควรทดลองใช้ เช่น ease-in, ease-out หรือ linear เพื่อปรับความรู้สึกของการเคลื่อนไหวตามความเหมาะสมของดีไซน์และประสบการณ์ผู้ใช้ หากคุณกำลังใช้เครื่องมือออกแบบอย่าง Figma ฟีเจอร์ scale strokes & effects checkbox ที่เกี่ยวข้องกับ transition ก็ช่วยให้การทำงานสะดวกและใกล้เคียงกับการโปรแกรม CSS มากขึ้น สามารถออกแบบการเปลี่ยนแปลงได้ตรงตามความต้องการมากขึ้น โดยรวมแล้ว CSS Transition ไม่ได้เป็นแค่เครื่องมือความงาม แต่ยังช่วยเพิ่มประสบการณ์ใช้งานที่ดีและลื่นไหล ทำให้เว็บดูมีชีวิตชีวาและน่าประทับใจมากขึ้นอย่างมาก ลองปรับใช้ในการทำเว็บของคุณ แล้วจะเห็นความแตกต่างอย่างชัดเจน

Related posts

IG: brncss.shay ⭐️🦋💞
#makeup #makeuptutorial #baseroutine #fullcoverage #flawlessskin #beautyproducts #TutorialMakeup
Shay Janae 🎀🍒

Shay Janae 🎀🍒

282 likes

A dark blue background with the title 'CSS KNOWLEDGE TEST!' and a purple lightbulb icon. Text asks 'How many can you get right? comment your score below!' with a Lemon8 logo and username.
A dark blue background with a white box containing 'Q1: What does the CSS property justify-content: space-between; do?' and four multiple-choice options (A-D).
A dark blue background with a white box containing 'Q2: Which unit is relative to the parent element's font size?' and four multiple-choice options (A-D).
💡 Think you know CSS? Let’s find out!
💡 Think you know CSS? Let’s find out! Take this short quiz and see how many you get right 😎 Comment your score below 👇 #CodeWithAysha #CSSQuiz #LearnToCode
Aysha

Aysha

3 likes

A dark blue graphic titled 'CSS Tips to Write Cleaner & Shorter Code!' with a lightbulb and CSS file icon. It displays a code snippet `margin: 10px 20px;` and text encouraging beginners to cut down on repetition and level up their styling game.
A graphic demonstrating CSS margin and padding shorthand. It contrasts separate `margin-top`, `margin-right`, `margin-bottom`, `margin-left` properties with the concise `margin: 10px 20px;` shorthand, explaining 10px for top/bottom and 20px for left/right.
A graphic illustrating CSS font shorthand. It compares multiple font properties like `font-style`, `font-weight`, `font-size`, `line-height`, and `font-family` with the single-line shorthand `font: italic bold 16px/1.5 'Poppins', sans-serif;` for cleaner code.
CSS Tips to Write Cleaner & Shorter Code!
#csstips #webdevelopment #learntocode #frontendtips #codebetter
Aysha

Aysha

20 likes

Chevron-Style Breadcrumb Navigation in CSS
#webdesign #codinglife #studytips #codingforbeginners #breadcrumbs
Aysha

Aysha

5 likes

A desk with a laptop and monitor, displaying the title '6 FIGURE JOBS WITHOUT A college degree' and 'SWIPE + starting pay' for job seekers.
A beach scene with job titles and starting salaries: Data Scientist ($124,000), Data Engineer ($127,000), Business Analyst ($84,000), Software Engineer ($105,000), and Engineering Manager ($131,000).
A beach with lounge chairs and umbrellas, listing jobs and salaries: Test Engineer ($95,000), Cybersecurity Engineer ($145,000), Technical Program Manager ($150,000), Product Manager ($121,000), and UI/UX Architect ($123,000).
6 figure jobs that don’t need formal education 👩‍🎓👩‍💻
1. Data Scientist 💼 Starting salary: $124,000 🚀 How to start: Learn data analysis, statistics, and machine learning. Build projects using platforms like Kaggle, and showcase your work on GitHub. 🎓 Recommended courses/bootcamps: - Multiverse Data Fellowship (15-18 months)
vedha | career tips (tech) 👩‍

vedha | career tips (tech) 👩‍

3303 likes

#freetiktok
clovescss

clovescss

13 likes

CSS Cheat Sheet
Essential CSS tricks every developer needs! 🔥 Save this for your next project - covers flexbox, grid, animations, and responsive design in one handy reference. Perfect for beginners and pros alike! 💻✨ #CSS #WebDevelopment #Coding #Programming #Developer
EM

EM

4 likes

Prncss Btch

Prncss Btch

5 likes

A title slide for "CSS ESSENTIALS Part 16: CSS TRANSITIONS." It introduces mastering CSS Transitions for smoother interactions, featuring a "Hover" button example and the creator's handle.
This slide defines CSS Transitions as creating smooth changes between property values without JavaScript. It visually contrasts "Before" (no transition) and "After" (with transition) states.
The slide presents the basic syntax for CSS Transitions: `transition: property duration timing-function delay;`. It explains that this syntax controls how the transition behaves.
What are CSS Transitions?
CSS Transitions add smooth, polished animations to your site — with just a few lines of code! ✨ Perfect for buttons, menus, hover effects & more. In this post, I’ll break down CSS Transitions so you can start using them today. 🚀 Save this guide & share with a fellow coder! 👩‍💻 #WebDe
Aysha

Aysha

4 likes

Day 1: Hello World-Kicking Off My Coding Challenge
Kicking off my 30-day coding challenge with a creative spin on the classic 'Hello World'! 🌟 Watch as I transform this beginner project into something visually stunning with animations. 💻✨ Follow along to learn HTML, CSS, and JavaScript #creativecoding #codingskills #beginnerfriendly
Aysha

Aysha

3 likes

Build an interactive FAQ section — no JavaScript
💬 Day 18 of the “HTML + CSS in Action” series! In this tutorial, we’ll create a fully functional FAQ Section using the <details> and <summary> tags — styled beautifully with CSS. Learn how to add interactivity without JavaScript and make your webpage more engaging and user-friendly.
Aysha

Aysha

6 likes

The image introduces "HTML + CSS IN ACTION: 30 Days of Mini Projects Modal Popup," showcasing a modal example with text "This is a Modal" and an "Open Modal" button. It highlights "Pop up power—no JavaScript needed" for Day 23, by Code With Aysha.
This image defines a modal popup as a small overlay that captures user attention and "locks" the screen. It displays a side panel with "Quick Settings" including Dark Mode, Font Size, Accent Color, Animations, Notifications, and Quick Links.
The image explains why building modals with HTML + CSS matters, demonstrating a "Page" and an "Overlay + Centered Card" modal. It emphasizes learning CSS selectors, visibility control, layering, transitions, and responsive centering without JavaScript.
Build a Sleek Slide-in Side Panel with HTML CSS
Build a modern slide-in side panel using only HTML and CSS! Perfect for quick settings, theme controls, and navigation links. Fully responsive and beginner-friendly — no JavaScript required. #HTMLCSS #WebDesign #FrontendDevelopment #codewithaysha
Aysha

Aysha

5 likes

A title slide for 'HTML + CSS IN ACTION: Portfolio Flip Cards,' showing a conceptual flip card with front and back details, indicating it's Day 29 of mini-projects by Code With Aysha.
An illustration of 'What Are Flip Cards?' showcasing six example portfolio projects like Product Card, Media Player, and Modal Component, explaining their use for portfolios, product previews, and feature highlights.
A visual explanation of 'How Flip Cards Work,' demonstrating a card rotating from 0° to 180° and listing CSS properties like `transform-style: preserve-3d;` and `rotateY(180deg);` for the 3D flip effect.
Portfolio Flip Cards (HTML + CSS Mini Project)
Day 29 — Portfolio Flip Cards (HTML + CSS) Today we’re building interactive flip cards you can use in any portfolio or web project. No JavaScript needed! These cards flip smoothly on hover to reveal more information — perfect for showcasing your projects, skills, team members, or services. Wha
Aysha

Aysha

2 likes

A person with long dark hair showcases elaborate cheetah print eye makeup, extending across the forehead and cheeks. They wear nose rings, glossy lips, and long pink nails, looking directly at the camera.
A person with long dark hair and cheetah print eye makeup has their eyes closed, gently touching their cheek with a hand that displays long pink nails.
A person with long dark hair and bangs looks directly at the camera, featuring intricate cheetah print eye makeup, nose rings, and glossy lips.
IG/Tiktok: @brncss.shay ⭐️🎀🌸
Eye inspo: BeatsByDeb (on IG) 🐆🤎🔥 #baddiemakeup #cheetah #leopard #makeup #makeupideas #creativemakeup
Shay Janae 🎀🍒

Shay Janae 🎀🍒

51 likes

The cover image for a CSS Cheatsheet for Beginners, featuring the CSS3 logo and the text "Learn the most-used properties in one place!" on a dark blue background.
A CSS Cheatsheet section detailing properties for Background (color, image, repeat, position, size), Border (border, radius, top), and Outline (outline, offset) with example values.
A CSS Cheatsheet section outlining properties for Position (relative, top, left, z-index), Size & Dimension (width, height, max-width), and Float & Clear (float, clear) with example values.
CSS CHEATSHEET for Beginners
#css3cheatsheet #learncss #webdesignbasics #frontendtips #codingforbeginners
Aysha

Aysha

31 likes

This image introduces Day 2 of "HTML + CSS IN ACTION: 30 Days of Mini Projects," focusing on "Buttons with Hover Effects." It emphasizes making buttons interactive with CSS, presented by Code With Aysha.
This image illustrates the importance of hover effects by comparing a plain button to one with a hover glow. It explains that hover effects make website buttons interactive and engaging.
This image presents code for creating a button with hover effects. It includes basic HTML for the button and CSS styles for its appearance, along with a purple background and scale transform on hover.
Day 2: Buttons with Hover Effects | HTML + CSS
Welcome to Day 2 of HTML + CSS in Action! 🚀 Today we’re transforming a plain HTML button into an interactive button with hover effects using CSS. A simple touch that makes your websites feel alive and professional! #HTMLCSS #CodingForBeginners #MiniProjects #hoverbutton #codewithaysha
Aysha

Aysha

8 likes

This image introduces "HTML + CSS IN ACTION: 30 Days of Mini Projects," focusing on Day 14: "Two-Column Layout (Sidebar + Main Content)." It highlights organizing webpages with a clean two-column design, presented by Code With Aysha.
This image defines a two-column layout, showcasing an example with a sidebar for navigation and a main content area. It explains that the sidebar is for navigation/extra info, and the main content is for articles/posts, built using HTML and CSS.
This image explains the benefits of a two-column layout, including organization, scannability, structuring real-world websites, and responsive design. A diagram illustrates sidebar and content alignment within the layout.
How to Build a Two-Column Layout with HTML + CSS
Learn how to create a clean, responsive two-column layout using only HTML and CSS! This project shows you how to combine a sidebar and main content area using Flexbox — perfect for dashboards, blogs, and portfolios. #HTML #CSS #Flexbox #WebDesign #codewithaysha
Aysha

Aysha

5 likes

HTML + CSS + JavaScript = MAGIC! 🔥
HTML alone is just a structure, CSS adds style, but JavaScript brings it to life! 🚀 Watch how I build this Digital Clock from scratch using HTML, CSS & JavaScript! 👨‍💻💡 Try it yourself & level up your coding skills #codingforbeginners #htmlcssforbeginners #studymotivation #learntocod
Aysha

Aysha

3 likes

An introductory slide titled "CSS ESSENTIALS Part 18 CSS SHADOWS" featuring three colored squares with shadows, inviting users to add "shadow magic" to their UI for enhanced visual appeal.
A slide defining "What is a Shadow in CSS?" by comparing a square with no shadow to one with a soft shadow, explaining that CSS shadows add depth to elements like boxes and text.
A slide detailing the `box-shadow` syntax in CSS, showing a code example and a visual representation of a box with a shadow, along with its offset-x, offset-y, blur-radius, and color parameters.
CSS Shadows Explained
Shadows can do more than just look pretty — they add depth, guide user focus, and enhance UI hierarchy. In this post, we break down how to use box-shadow and text-shadow with real examples. Perfect for beginners and growing devs! #CSSEssentials #CSSShadows #FrontendTips #codewithaysha
Aysha

Aysha

10 likes

The image is a title slide for 'CSS ESSENTIALS Part 11 DISPLAY PROPERTY', introducing the concept of CSS display property as fundamental to layout. It features a question, 'Ever wonder how layout works? It starts with display'.
This image explains 'display: block', showing two 'Block element' boxes stacked vertically, each taking full width. It notes that block elements start on a new line and are used for sections, divs, and paragraphs.
The image illustrates 'display: inline', showing three 'Box' elements ('Box 1', 'Box 2', 'Box 3') sitting next to each other. It explains that inline elements' width fits their content and are used for spans, links, and small text.
CSS Display Property – Control the Layout Flow
Understanding the display property is the foundation of layout in CSS. Whether you're building buttons, sections, or full-page grids — this guide will help you choose the right type. Save and swipe through to level up your CSS skills! #CSSDisplay #LearnCSS #WebDesignTips #FrontendB
Aysha

Aysha

3 likes

HTML and Css Fundamentals.
1. Core HTML Elements: Defines HTML as the "skeleton" of a website, explaining the use of h1 to h6 for headings, <p> for paragraphs, and styling tags like <strong> for importance, <em> for emphasis, <sub> for subscripts, and <sup> for superscripts. 2. Lists
ZeroandoneHQ

ZeroandoneHQ

1 like

Melany pricssa

Melany pricssa

0 likes

@prettyprxncsss
Location:las vegas #sky high #trees #nature #clouds #wallpapers
Tierra Sharee

Tierra Sharee

1 like

Crying
Everyday damn day!😭😭😭😭
7uckyLocss

7uckyLocss

1 like

The image is a title slide for "HTML + CSS IN ACTION: 30 Days of Mini Projects Resume Layout," featuring a preview of a clean resume design for "Aysha Sanyang Frontend Developer" with sections for profile, contact, and skills. It highlights "Day 26" and "Code With Aysha."
This image defines "What Is a Resume?" and showcases a detailed resume layout for "Aysha Sanyang Frontend Developer," including sections for profile, contact, skills, experience, and education. It explains that a resume is a professional overview highlighting skills, experience, education, and achievements.
The image explains "Why This Matters" for a resume layout, reiterating the definition of a resume and showing a simplified layout. It emphasizes that a good resume layout is easy to scan, professionally structured, clean, modern, and ideal for portfolios and personal websites.
Build a Clean Resume Layout (HTML + CSS Only)
Every great resume focuses on 3 things: 💼 Experience – what you’ve done 🎓 Education – what you’ve learned 🛠 Skills – what you can do In Day 26 of our HTML + CSS series, we’re turning these core sections into a clean, modern resume layout UI. Perfect for portfolios, personal sites, or frontend
Aysha

Aysha

3 likes

The image introduces CSS Positioning (Relative, Absolute, Fixed, Sticky) with a computer monitor icon displaying a CSS document. It states the purpose is to learn how different position properties affect web elements and when to use each one.
This image defines CSS positioning, showing a flowchart illustrating the behavior of Relative (moves relative to itself), Fixed (stays in place), Absolute (moves relative to nearest positioned ancestor), and Sticky (sticks at set position) properties. It lists these as key properties.
The image explains `position: relative` with 'Before' and 'After' diagrams showing an element moved right and down. It describes how it moves an element relative to its normal position without affecting other elements, useful for slight adjustments.
CSS Positioning: Relative, Absolute, Fixed-Sticky
#csspositioning #webdevelopment #learntocode #codingforbeginners #TechTips
Aysha

Aysha

4 likes

A dark blue cover page titled "Beginner-Friendly CSS Visual Guide" with a CSS file icon, inviting users to master CSS basics and style websites like a pro. The Lemon8 logo and username are at the bottom.
A dark blue slide introducing CSS, defining it as Cascading Style Sheets for styling HTML elements. It shows a CSS icon and provides examples of CSS syntax with a selector, property, and value.
A dark blue slide explaining CSS Selectors. It features a diagram showing a CSS file icon branching to 'p', 'div', 'class', and 'id' selectors, with text describing common selector types and their usage.
Beginner-Friendly CSS Visual Guide
#cssforbeginners #frontenddevelopment #cssvisualguide #codingforbeginners #htmlandcss
Aysha

Aysha

9 likes

Efecto hover en una imagen con css
Aprende cómo crear un efecto hover en una imagen con CSS #CSS #html #htmlcssforbeginners #websites #webdesign
The Digital Mike

The Digital Mike

2 likes

A title slide for 'HTML + CSS IN ACTION: Login Form' from '30 Days of Mini Projects - Day 9' by Code With Aysha, highlighting a simple, beautiful, and functional design.
Defines a login form with an example UI showing username, password fields, and a login button. Explains its purpose for user authentication.
Displays the basic HTML structure for a login form and the corresponding CSS styles for a dark mode theme, including hover effects.
How to Create a Stylish Login Form with HTML + CSS
For Day 9 of my 30 Days of Mini Projects, I’m showing you how to design a modern login form. ✔ Clean design ✔ Dark mode style ✔ Hover effects for the button #HTMLCSS #LoginForm #CodingForBeginners #codewithaysha #webdesign
Aysha

Aysha

5 likes

Build a Modern Blog Preview Card with HTML & CSS |
Today we’re building a clean blog post preview card: 🖼 Image 📝 Title 📝 Short text snippet This layout is used in blogs, portfolios, and news websites — perfect for practicing real-world UI design. You’ll learn: ✨ Semantic HTML structure 🎨 Card layout & spacing in CSS 🪄 Hover + shado
Aysha

Aysha

4 likes

Melany pricssa

Melany pricssa

0 likes

The image introduces CSS Backgrounds, Part 10 of CSS Essentials. It shows the `background` property using `linear-gradient` to define style and color, encouraging users to make layouts pop with background styling.
This image explains the `background-color` property, demonstrating how to set an element's base color using a hex code. It highlights its use for creating contrast, branding, or clarity in web design.
The image illustrates the `background-image` property, showing how to add an image behind content using `url('pattern.png')`. It suggests using this property to add texture or branding flair to web elements.
CSS Backgrounds – Color, Images & Control
#CSSBackgrounds #LearnCSS #CSSForBeginners #FrontendTips #codewithaysha
Aysha

Aysha

11 likes

qicss

qicss

0 likes

CSS Cheat Sheet
Essential CSS tricks every developer needs! 🔥 Save this for your next project - covers flexbox, grid, animations, and responsive design in one handy reference. Perfect for beginners and pros alike! 💻✨ #CSS #WebDevelopment #Coding #Programming #Developer
EM

EM

1 like

How to Use CSS Box Shadow for Stunning Effects
#CSS #webdesign #boxshadow #hovereffect #learntocode
Aysha

Aysha

0 likes

See more