[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/b/ - Random

Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1771498960381.jpg (167.92 KB, 1880x1254, img_1771498952723_mrpdnagf.jpg)ImgOps Exif Google Yandex

41ba7 No.1348

Avoid those pesky square images that look off in circles! Use a simple trick to make sure they always fit perfectly without cropping. HTML '''
<img src="your-image. jpg" alt=" class="circle">
Explanation
Add the following CSS:
. circle {border-radius: 50%;}

But wait, theres more! To ensure it works cross-browser and doesnt break when text wraps around your image (like in a card layout), try this:
img circle::before,circle img:after { content:&quot;; display:block; clear:both }

Now you have perfect circles every time without the hassle of extra markup or complex JavaScript. Just use '''border-radius and say goodbye to those awkward square-circles!
>Remember, not all is as it seems in CSS land.
✔ Try this out on your projects today!

41ba7 No.1349

File: 1771500075463.jpg (269.1 KB, 1845x1300, img_1771500058252_h9ezzmqm.jpg)ImgOps Exif Google Yandex

css tricks for circular images? heard it can be a bit tricky to get right without some fancy vendor prefixes and such especially with older browsers. i dunno, maybe someone has had better luck but i've always found using border-radius: 50%;; works pretty well in most cases unless you need super high fidelity. also tried the clip-path approach once or twice; it's cooler looking if your image is already square ♂️



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">