Automatically translated.View original post

Use pictures to make a background

Background-image is the CSS property used to define an image as the background of an HTML element. The background-image property specifies the URL of the image to be used as the background and can also configure other values such as repeating the image, position, and size.

Usage:

Define background pictures:

Use the background-image command: url ("path / to / image.jpg"); by path / to / image.jpg is the path to the image file.

Duplication of pictures:

Use the background-repeat feature to control the repetition of images vertically and horizontally (e.g. background-repeat: no-repeat;, background-repeat: repeat-x;, background-repeat: repeat-y;).

Position of image:

Use the background-position property to determine the position of the image in the element (e.g. background-position: center top;, background-position: 25% 75%;).

Size of Image:

Use the background-size feature to adjust the size of the image (e.g. background-size: cover;, background-size: contains;, background-size: 100px 200px;).

Example:

Code

< div style = "background-image: url ('your-image .jpg'); background-repeat: no-repeat; background-position: center; width: 300px; height: 200px;" >

2025/8/14 Edited to

... Read moreเมื่อพูดถึงการใช้ภาพพื้นหลังในเว็บไซต์ นอกจากการตั้งค่าพื้นฐานอย่าง background-image แล้ว ผมเคยลองปรับค่า background-repeat เพื่อเปลี่ยนรูปแบบการทำซ้ำของภาพพื้นหลัง เช่น การตั้งค่าเป็น no-repeat เพื่อไม่ให้รูปภาพซ้ำ ทำให้ภาพดูสะอาดตาและโฟกัสเนื้อหาหลักของเว็บได้ดียิ่งขึ้น นอกจากนี้ การกำหนด background-position ก็มีความสำคัญมากครับ เพราะจะช่วยให้ภาพวางตำแหน่งเหมาะสมกับองค์ประกอบโดยรอบ เช่น การตั้งเป็น center center จะช่วยวางภาพให้ตรงกลาง ทั้งแนวตั้งและแนวนอน ทำให้รูปภาพดูสมดุลกับหน้าจอมากขึ้น อีกคุณสมบัติที่ขาดไม่ได้คือ background-size ซึ่งสามารถช่วยปรับขนาดภาพให้เต็มองค์ประกอบ หรือขนาดพอดีได้ เช่น การใช้ background-size: cover จะทำให้ภาพขยายเต็มพื้นที่โดยไม่เสียสัดส่วน หรือใช้ contain เพื่อให้ภาพครอบคลุมแต่ไม่ถูกตัดขอบ เทคนิคเพิ่มเติมที่ผมเคยทดลองคือการใช้ภาพหลายภาพเป็นพื้นหลังโดยคั่นด้วยจุลภาคในคำสั่ง background-image ซึ่งช่วยสร้างเลเยอร์ภาพพื้นหลังที่ซับซ้อนและสวยงามยิ่งขึ้น พร้อมทั้งยังสามารถรวมกับคุณสมบัติอื่นๆ เช่น background-color หรือ background-attachment เพื่อเพิ่มรายละเอียดเอฟเฟกต์ให้กับพื้นที่นั้นๆ สำหรับใครที่กำลังเริ่มทำเว็บ ลองฝึกใช้ background-image กับค่าต่างๆ เหล่านี้ดูครับ จะช่วยให้เว็บไซต์ของคุณมีความน่าสนใจและมืออาชีพมากขึ้นแบบที่ผู้ชมต้องประทับใจแน่นอน

Related posts

Make money taking pictures
Become a Field Inspector no degree or certification required 18 and older with clean background #makemoneydriving #fieldinspector #notarypublic
ArtieshaTheNotary

ArtieshaTheNotary

4622 likes

A MacBook Air displays a website titled 'cozy corners of the internet,' featuring an animated lofi scene with a character wearing headphones. This image introduces websites for relaxing background sounds.
A MacBook Air shows the 'I miss my library' website, which recreates a library atmosphere with sounds like page flips and pen scribbling, ideal for studying or reading.
A MacBook Air displays the 'Lofi Café' website, a minimalist lofi radio station streaming chill beats 24/7 with cute animations, perfect for focus or relaxation.
Websites for Cozy Background Sounds & Ambience 🎧✨
Need relaxing background noise to focus, study, or just chill? Here are some of my favorite websites to create the perfect cozy vibe! 👇 📌 I Miss My Library – This site recreates the peaceful atmosphere of a library with soft page flips, distant whispers, and the occasional pen scribbling—perfect
Unrealtoreal

Unrealtoreal

4822 likes

An iPad displaying its Control Center with the text "IPAD HACKS YOU DIDN'T KNOW EXISTED" overlaid. The screen is blurred, highlighting the title of the tutorial.
An iPad showing its Control Center, with a stylus resting beside it. The text overlay instructs to "SWIPE DOWN FROM THE TOP RIGHT OF YOUR SCREEN TO ACCESS YOUR CONTROL SETTINGS."
A close-up of an iPad screen's Control Center, where a stylus points to a plus icon. The text instructs to "CLICK ON THE '+' BUTTON AT THE TOP LEFT OF THE CONTROL SETTING MENU."
How to Get Background Noises on Your iPad
Did you know your Apple Devices come with a built in sound machine!? I absolutely love this feature for when I’m working and need to focus, or when I’m having trouble falling asleep. The best part? It works without WiFi, so you can use it whenever and wherever! To add this to your control center
Ashley✨

Ashley✨

1612 likes

Photos u can use as a background..(I took them myself)
Houston
MJ_loves

MJ_loves

28 likes

Canva Tutorial - Remove The Image Background
How To Remove The Background For FREE Using Canva! 🤯 #canvatips #canvatutorial #canvahacks #canvadesign #canvaforbeginners #canvaforsmallbusinesses #canvaforentrepreneurs
Inuri

Inuri

161 likes

Canva Tutorial - How To Blur An Image Background
Canva Design Tutorial For Beginners - How To Blur The Background Of An Image Using Canva! #canvatips #canvahack #canvadesign #canvatutorial #canvaforbusiness #canvaforentrepreneurs #canvaforbeginners
Inuri

Inuri

133 likes

iOS 26 iMessage Background ✨
All the customizations you can do with the new update is stunning! ✨ what is your favorite part of the new iOS 26? Also, I have been decorating my iPad and MacBook and will be posting those soon! 🩷 #iphone17promax #ios26features #appledesign #iphonecustomization #iphonelayouttour
Klassy Kayy

Klassy Kayy

2924 likes

Canva Tip for Removing the Background of an Image💪🏽
✨ SIP & Canva Tips Series ✨ Kicking off the series with a quick intro and diving into one of my favorite Canva tools – the Background Eraser! 🎨 Watch how easy it is to remove backgrounds and level up your designs in seconds! 🥰Follow for more Canva tips, tricks, and design inspo! #CanvaTi
Bri | Canva👑

Bri | Canva👑

98 likes

How To Make Your Background Black & White On Canva
Canva Tutorial For Beginners -How to Make the Background of Your Photos Black and White Using Canva! #canvatips #canvadesign #canvatutorials
Inuri

Inuri

147 likes

A Mac screen displays a Miffy bunny image, with text overlay 'Mac Hack: Remove background in seconds' and 'SWIPE TO VIEW', set on a desk with aesthetic decor.
Two screenshots illustrate opening a photo in Mac Preview, selecting the markup tool, and then choosing the instant alpha wand tool for background removal.
A Mac screen shows the Miffy bunny image in Preview, with a pink overlay indicating the background selected by the instant alpha tool, ready to be deleted.
quick background removal tutorial for mac! 🍓
‧°𐐪♡𐑂°‧₊ 👩🏻‍💻 Did you know about this hack? Some do and some don’t, but if you usually rely on background removal tools online to create PNGs out of images, do this instead to save your time (if you have a Mac!) This requires using preview (opens when you double click on an image). Select mark
peachiesuga ♡

peachiesuga ♡

220 likes

Creating a transparent background in Canva
Did you know you can make your designs stand out with transparent backgrounds in Canva? Whether you’re creating logos, stickers, or overlay graphics, removing the background can be very beneficial. Simply click on Share -> ‘Download’ > ‘File Type’ > ‘Transparent Background’ (availab
Bri | Canva👑

Bri | Canva👑

214 likes

Make Your Video Background Black & White On Canva
Canva Tutorial For Beginners - How To Make Your Video Background Black & White While You Remain In Color! In Today’s Canva Design Hack, I Will Show You How To Create A Cool Video Effect For Social Media Using Canva! This Is How To Isolate Colors & Make The Video Background Black & W
Inuri

Inuri

66 likes

A laptop screen displays a Google New Tab page with a pink bow background and the text "HOW TO CUSTOMIZE YOUR GOOGLE BACKGROUND."
A laptop screen shows Google image search results for "coquette bow wallpaper laptop," with a sticky note instructing to "Look for an image of your choice."
A laptop screen displays Google image search results. A right-click menu is open, highlighting "Save image as..." with a sticky note instructing to "Right click your mouse and press save image as."
How to customize your google background🎀
1) look for an image of your choice 2) Right click and save image as 3)save your image 4) open new tab 5) click on the pencil icon located on the bottom right corner 6)click on change theme 7)click upload an image 8)click on your saved image 9)your new background should appear :3 ⋆˚🐾˖
Jocelyn

Jocelyn

26 likes

Cute background for pictures in boba place 🌸✨💜
#boba🧋
Stephhhh26

Stephhhh26

9 likes

A laptop screen displays a vibrant collage wallpaper featuring disco balls, money, a camera, a city skyline, and various text elements. Overlayed text reads "how to: cute laptop background windows laptop edition" with an arrow pointing to "lemon8 @xbrookeprice."
A laptop screen shows the Canva interface with a pop-up menu for "Create a design." An arrow points to "Presentations (16:9)" as part of "STEP 1: CANVA" instructions to create a design and select the 16:9 format.
A laptop screen displays the Pinterest website with an image of text art. "STEP 2: PINTEREST" instructions are shown, highlighting how to right-click and "Save image as" to save desired pictures for the collage.
✨HOW TO: Cute Laptop Background!✨
STEP 1: CANVA * create a design * presentations * select (16.9) format STEP 2: PINTEREST * find pics that you want in your collage * right click -> “Save image as” * save images to your files STEP 3: BACK TO CANVA * go back to your Canva draft * click “Uploads” * click “Upload files”
brooke

brooke

32 likes

Stadiums make a great background
Neyland is a great backdrop! #cars #fastcars #knoxvilletn #bmw #m5
Jessica M

Jessica M

10 likes

✨Make Progress Pictures Your BIGGEST Motivator✨
👉 Ever step on the scale and feel like you’re not making progress? That’s why progress pics are a game changer! They reveal the changes you can’t always feel or measure, from toning up to building muscle. Here’s why they’re at the top of my motivation list: ✨ They show your transformation, even
Margarita

Margarita

26 likes

A yellow plush object is in the foreground, partially obscuring a laptop displaying the title 'EMILY IN PARIS' on its screen. Overlay text asks, 'A TV show that brings you comfort?' with 'Lemon8' and '@captainlemon8' visible at the bottom.
What’s a TV show you use for background noise?
What's the TV show that you turn on for background noice that brings you comfort? Why do you like it? Share your cozy picks below! #letschat #lemon8tainment
Captain Lemon8

Captain Lemon8

380 likes

A tutorial cover image showing a girl with a dreary sky on the left and the same girl with a bright blue sky on the right, titled 'How to make THIS PHOTO Look like THIS TUTORIAL'.
A phone screen displaying the 'Superimpose' app icon and text indicating that the app 'superimpose' was used for the photo editing tutorial.
A screenshot of the 'Superimpose' app interface, showing options to 'Create New Project' and 'Add Background', with 'Photos' highlighted to select the base image.
How to edit background!
Here is my tutorial of how I made the sky blue with skies on a dreary day! Let me know if you try this out or if you have a way you edit your pictures!! #productivity #lemon8tutorial #Lemon8Diary #lemon8diarychallenge
Fiona Flower :)

Fiona Flower :)

12 likes

A woman with curly hair in a white crocheted top and denim skirt poses in a sunflower field, demonstrating a blurred background effect. Text asks, 'wanna easily blur out the background like this?' and prompts to 'save this photography tutorial' and 'Swipe»'.
The blue Lightroom Classic (LrC) logo is displayed on a dark background, with text instructing to 'Use the Lightroom CLASSIC program'.
A screenshot of the Lightroom interface shows the 'Presets' menu on the left, with an arrow and text indicating to 'Open up the presets menu on the left'.
wanna easily blur out the background like this❓
shout out to the model @Miss Tammy So if you took a bunch of pictures during a photo shoot that you want to apply the same beautiful blur effect too quickly, use the artificial intelligence tools in Lightroom to create this blur effect 🎨🤖 The AI and Lightroom will automatically detect the
🌻📸Chukwunonso

🌻📸Chukwunonso

26 likes

Not one to use my own pictures as background often
#putyourselffirst #selflove #selfrespect #selfcare #healingfirst
Lorena Collins

Lorena Collins

1 like

An iPhone screen displays the 'Background Sounds' settings, showing options like Volume, Balanced Noise, Bright Noise, Dark Noise, Ocean, Rain (checked), and Stream. The text overlay highlights this as an 'Underrated iPhone hack: Ambient sounds'.
An iPhone screen shows detailed 'Background Sounds' settings, explaining the feature's purpose to mask noise and aid focus. It displays 'Stream' as the selected sound, with volume controls and options to stop sounds when locked. Instructions for accessing the feature are also visible.
An iPhone displays the Control Center, with the 'Background Sounds' icon visible and active. Text indicates that once enabled, the feature is saved as a shortcut for easy access.
Underrated iphone hack: Background sounds!
Discover an underrated iPhone hack that'll revolutionize your daily routine: background ambient sounds! 🎧✨ Whether you're studying, working, or simply unwinding, this feature provides a soothing backdrop to enhance focus and relaxation. From gentle rain showers to calming ocean waves, the p
Ayesha 🍋

Ayesha 🍋

1185 likes

A light brown and white ferret with a blue leash stands in green grass, looking directly at the camera. Text overlay reads "+ CUTE FERRET ONLY TWO USE FOR BACKGROUND."
Cute ferret only two use for background
Leo

Leo

13 likes

A split image showing a couple under a veil, with the left side labeled 'BEFORE' (darker foreground) and the right side labeled 'AFTER' (brighter, balanced exposure). It illustrates the impact of Lightroom editing on foreground and background balance.
The 'BEFORE' version of a photo featuring a couple under a veil, with text noting it's 'extremely dark to maintain quality bright background' but has 'good framing,' highlighting the initial exposure challenge.
A screenshot of Lightroom editing panels, displaying specific settings for Tone, Presence, Tone Curve, and Color Grading. Text emphasizes these are example settings for learning to edit photos.
edit contrasting foreground & background-lightroom
This was a super bright day in Lake Tahoe, so we found the best shade we could and made do! The only problem with that is your background and foreground will be exposed completely differently, so I had to fix that in Lightroom so the photo wasn't too unbalanced. Every camera is different and
christina ◡̈

christina ◡̈

395 likes

pink background 💗 💓
#pink cloud ☁️🌸 #pinkvibes #pinkdecor #pinkaestetic #pinkfinds
QueenBRY😚

QueenBRY😚

802 likes

A smiling woman with curly hair stands in a sunflower field, wearing a crop top and jeans. Text overlays instruct "how to make a model pop out from the background" and "SWIPE to see" with arrows, indicating a photography tutorial.
A graphic displays a 5-in-1 photo reflector, showing its various surfaces (white, black, silver, gold, translucent). The image highlights the different reflective options available for photography lighting.
A white background features the bold black text "FOLLOW ME FOR MORE TIPS" with a brown thumbs-up emoji. This serves as a call to action for viewers.
how to make a model pop out from the background 📸🌻
📸📝Three easy steps: 1.) 🌻kindly ask the model to stand with their back facing the sun💁🏾‍♀️ 2.) 🌻then ask an assistant to hold up a silver reflector to bounce the sun’s light onto the model☀️ 3.) 🌻meter your camera, and take the picture📸 The benefits of using reflector vs a flash: ✅ It’
🌻📸Chukwunonso

🌻📸Chukwunonso

10 likes

DIY Background
Easy DIY flower board! All of the flowers are from the dollar store and I spent about $10 (including the board and hot glue sticks I already had) in total on this easy project! Just an idea 💡for pictures or whatever comes to your mind. #Lemon8Diary #embracevulnerability #DIYProject #diyhome
Jenny 💕

Jenny 💕

6 likes

See more