Automatically translated.View original post

css persoective

# Web Site Writing Basics

# CSS # perspective

CSS Perspective is a feature used to create a 3D space for elements on a web page, determining the distance of the audience from the object, making the elements that are transformed (such as rotation) appear as real as what our eyes see in real life, such as objects that are closer to looking larger than objects that are far away, and affecting the depth of the overall picture. The smaller the perspective, the larger and closer the object looks to our eyes, the clearer the 3D dimension.

Perspective working principle

Create a 3D space:

The perspective property will enable 3D space for the subelements being transformed.

Define spacing:

The value of the perspective is the distance from the user to the Z-plane where the object is.

Effect on vision:

Minor Value: Make an object appear larger when it is near, and it has a distinctive dimension.

Very valuable: The depth effect will look more delicate, the object will look flattened.

Application to Transform:

Perspective is often combined with other CSS features, such as transform: rotateY (), to create the illusion of rotating 3D objects.

Difference between perspective and transform: perspective ()

Perspective (features):

Use with the parent Element to create a 3D space together for all converted child Element.

Transform: perspective () (function):

Use directly with the Element to be converted to determine the depth of the object directly.

Example of use

Code

/ * Assign 3D space to container * / .container {perspective: 1000px; / * Define user spacing * /}

/ * Convert child element to rotate and dimensional * / .child-element {transform: rotateY (30deg); / * element rotation example * /

}

2025/9/7 Edited to

... Read moreการใช้ CSS Perspective เป็นเรื่องสนุกที่ช่วยให้ผมสามารถสร้างมิติให้กับดีไซน์เว็บได้อย่างง่ายดาย โดยเฉพาะเมื่อต้องการให้วัตถุบนหน้าเว็บดูมีความลึกและเคลื่อนไหวเหมือนของจริง สำหรับผู้เริ่มต้น ควรรู้ว่าค่าของ perspective ยิ่งน้อยวัตถุดูจะยิ่งใหญ่และใกล้สายตามากขึ้น แต่ถ้าเพิ่มค่านี้ให้สูงขึ้น วัตถุจะดูเล็กและลึกมากขึ้น เช่นเดียวกับที่สายตาของเรามองเห็นวัตถุในชีวิตจริง อีกเทคนิคหนึ่งที่ผมชอบใช้ร่วมกับ perspective คือ transform: rotateY() ซึ่งช่วยทำให้วัตถุหมุนและแสดงผลได้สามมิติ ตัวอย่างโค้ดอย่างง่ายคือ กำหนด perspective ให้กับ container แล้วใส่ transform กับองค์ประกอบลูก ซึ่งสร้างเอฟเฟกต์ที่น่าทึ่ง ในโปรเจ็กต์ล่าสุด ผมได้ทดลองใช้ perspective ผสมกับ animation iteration count เพื่อทำให้วัตถุเคลื่อนไหวอย่างไม่รู้จบ เพิ่มความมีชีวิตชีวาให้กับหน้าเว็บ นอกจากนี้ยังช่วยให้เว็บดูทันสมัยและน่าสนใจสำหรับผู้ใช้อีกด้วย หากใครสนใจลองนำไปใช้ ผมแนะนำให้เล่นกับค่าของ perspective และมุมการหมุน เพื่อหาค่าที่เหมาะสมที่สุดสำหรับงานของตน เพราะแค่ปรับค่านิดเดียวก็เปลี่ยนความรู้สึกของดีไซน์ได้มากแล้ว

Related posts

looks weird but feels wffective
@hiizane

@hiizane

4 likes

Replying to @Neck im enjoying your persoective and this conversation. #fyp #fyppppppppppppppppppppppp #fypシ #politicstiktok #foryourpage
LifeWithToriSamone

LifeWithToriSamone

6 likes

🌸✨The flowers where I live🌺🌿
#flowers🌸🌺 #flowers 🫶🏽 #summerbod #cubana🇨🇺 #summer 📍 City/Country:la habana, Cuba
patotective.kmi

patotective.kmi

39 likes

we stan an overprotetective hero >>>
Although We Shouldn't by Gwen Parks #booktok #explore #romancebooks #booktok #bookrecommendations
Gwen Parks Romance Author

Gwen Parks Romance Author

6 likes

🫶I present to you my cat 😺
Havana #gatos #pets❤️ #cats🐾 #catsaresocute
patotective.kmi

patotective.kmi

12 likes

What do ya'll do with your fruit stickers?
we recently bought our first home and ive been sticking our fruit stickers, fortune cookie fortunes, stickers, name tags ect, on the inside of my pantry closet. It reminds me of the little markings we leave on doorways of our childrens height. do you keep yours as well? if so where?! would love t
JustJenny

JustJenny

8 likes

A clear glass mug of vibrant blue Butterfly Pea Flower tea sits on a wooden surface, with a tea box and sachet nearby. A floral arrangement with yellow and purple flowers is in the background, alongside black candle holders.
Butterfly Pea Flower Tea
This tea is more than a beauty, it’s a powerhouse waiting to be sipped. Warmed or chilled it is such a delight with so many benefits. 1. ANTIOXIDANT AND ANTI INFLAMMATORY Rich in antioxidant compounds, called ternatins which has been shown to alleviate inflammation and prevent cancer cell g
Kennyecta

Kennyecta

1120 likes

EXPERIENCE OAHU
here’s a list of places ect. to experience in Oahu Honolulu. these were some of my favorite activities to do there. 📒Note: please be respectful to local people/Kama’aina! #Lemon8Diary #storytime #shareyourthoughts #unfiltered #hawaii #travel #oahuhawaii #nature #beach #haleiwa
⋆ ୨୧teagan୨୧⋆

⋆ ୨୧teagan୨୧⋆

19 likes

Juicy, Fruity, Watermelon 🍉💦
There’s nothing like a cold bowl of watermelons with Celtic Salt in the Summer. Honestly y’all, I’m addicted… I can eat a whole watermelon within 2-3 days (no cap) 🫣… it’s my weakness!!!! So, hi everyone… my name is Kennyecta and I’m addicted to a HUGE COLD BOWL OF WATERMELON CHUNKS WITH CELTIC
Kennyecta

Kennyecta

1810 likes

A close-up shot of a vibrant pink, double-petaled hibiscus flower with yellow stamens, held gently by a hand, against a blurred background of green leaves and sunlight.
A cluster of small, delicate pink flowers with yellow centers, possibly Crown of Thorns, growing on a thorny stem with green leaves, against a light blue and white background.
Two white flowers with five petals and yellow centers, surrounded by lush green leaves, blooming in rocky soil under natural light.
🎞️Part two❗️🌸of the flowers I see every day✨
Part two of the flowers I see every day 🌸🌺🌻🌹🌼🪻🌿🪷 comenta si te gustaron estas flores 💋👇 📍 City/Country:la habana,cuba #flores #cuba #flawer
patotective.kmi

patotective.kmi

14 likes

Some Dolls at Ross!! ✨
they are rearranging my local ross, so the worker was still stocking up so i couldn’t get a full picture of the toy aisle! but they seem to be getting some good toys in this time around! ☠️🩷 #ross #dollcollector #monsterhigh #bratz #rossfinds
Sage Skullects🖤🩻

Sage Skullects🖤🩻

182 likes

A pink pouch with a large 'V' logo and two gold-cased lip products are displayed on a white surface, representing a PR package from Valentino.
A fragrance bottle is nestled in a pink box with a striped pattern, featuring the text 'BECOMING YOU IS YOUR POWER', indicating a PR gift from Lancôme.
An open box reveals various skincare products, including toners, serums, and moisturizers, with colorful packaging, representing a PR package from Good Molecules.
Pr ive been sent as a microinfluencer
From sharing my love for beauty to receiving PR—this journey has been amazing! Want to know how I started? Comment below, and I’ll make a video! ✨ #prproducts #prgifted #prpackage #microinfluencer #howtogetpr
_Beaukat

_Beaukat

21 likes

The image displays a 'Perrrrrfect vanilla marshmallow combo' with an ice cream cone and marshmallows. Four perfume bottles are shown: an OAKCHA 'THAT GIRL VIRAL VANILLA' bottle, a KAY ALI travel spray, a small pink KAY ALI bottle, and a larger amber liquid bottle, suggesting a fragrance layering combination.
Perrrrrfect vanilla marshmallow combo 🍦✨
Mannnn I got so many compliments when I was out yesterday. This combo is amazing . It gives you a warm cozy feeling and it’s such a pretty sweet scent all combined . You definitely need these on your shelf ! #paulreacts #thatgirlperfume #kayaliyumboujeemarshmallow #chocomusk #lemon8bea
CannonCo

CannonCo

38 likes

shes came along ways n the last year or so
theres not anything on this car i havent changed and or upgraded. Built engine,cage,lsd,removable core support, ect. Ready for the season to start already! #builtnotbought #integra #carcommunity #carcontent #carsoflemon8 #turbo
Royseph Youngeth

Royseph Youngeth

3 likes

Gut Healthy & Eectrolyte Low Cal Smoothie🍍🍏🍓
Here’s a full breakdown of the benefits of each fruit in my smoothie and an estimated calorie and sugar count for the whole drink. Its the perfect morning booster—hydrating, energizing, and full of fiber 💪🍓🍍🍏🐉 🍓 1/3 cup Strawberries Benefits: * High in Vitamin C – boosts immunity and skin he
Chalie_Baker

Chalie_Baker

122 likes

New to Lemon8
Hello “ #Lemon8ers ” 😅 I’m Coco I live in Fl. My bday is 12/18 (SagGang) im in my 30s ✨, im really a girls girl Something I love: food | gaming | shopping | Makeup | self care | Hair | Gardening 🍃| Content Creating | Sports Betting & ect…🖤 So Ive been using this app for a yr. and have nev
xoqueencoco

xoqueencoco

7 likes

The weird remedy that worked!
So let’s all face it, no matter how much we try to hide it, we are all getting older with time… but just because we are getting older each day does not mean our bodies have to feel that way. From the foods we eat, our daily routines/activities to certain diagnoses from the doctor to just aging (
Kennyecta

Kennyecta

563 likes

SOTN...Lavender!
#lavender #philosophy #bodycare #LUSH #sleep
Neena_Skye

Neena_Skye

1 like

Psalm 1 - 150
Psalms is such a good place to go when your emotions are big. Happy, sad, stressed, angry, ect. GO TO PSALMS! I have been in Psalms for about 5 months now by reading 1 chapter a day and let me tell you, Ive experienced a lot of emotions in 5 months and Psalms has just been so uplifting for me.
BrittanyBear96

BrittanyBear96

48 likes

Doll Shopping! 💕
Very happy with what i got! This is actually my first G3 Frankie Doll, been wanting to get them for a while now. BUT definitely head to your local ross for doll finds! :3 ☠️🩷 ♥︎ • • • • • #bratzaesthetic #bratz #monsterhigh #dollcollector #rossfinds
Sage Skullects🖤🩻

Sage Skullects🖤🩻

34 likes

If theres anything in this life i could say changed my entire persoective on life and gave me purpose to want to live again- it would be my children. I couldnt do life without these little hands and feet of mine. They have made me such a better person, i will forever continue cherishing every small
♡ Maryanna ♡

♡ Maryanna ♡

0 likes

P.4 OF DRAWINGS OF TRANSFORMERS AND ECT🌸✨🫶
P.4 drawings of transformers and ECT
SHOCKWAVE_BLUE

SHOCKWAVE_BLUE

7 likes

Arbolito 🌸
Un arbolito bien lindo de mi campo🌳🩷 #tree
patotective.kmi

patotective.kmi

9 likes

A vibrant smoothie bowl in a white dish, topped with banana slices, raspberries, red and green grapes, strawberry wedges, shredded coconut flakes, and a honey drizzle. The text "Smoothie Bowl Healthy Meets Delicious" is overlaid, with "Lemon8" and "@samuelandkennyecta" in the corner.
Smoothie bowls have my heart🍓🍌
Ugh I must confess, I have a thing for smoothie bowls. Not just any pre-frozen smoothie bowl, but a fresh, vibrant, nutrient dense smoothie bowl that has all of the fresh ingredients. Let’s talk about it!!! Lately, since the last frozen fruit recall, I found myself buying fresh fruits and pac
Kennyecta

Kennyecta

15 likes

Mini picnic
Havana Ya casi es verano☀️🍉👙 #verano #cubana
patotective.kmi

patotective.kmi

3 likes

See more