- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
object-position Property in CSS
The object-position property is used to specify whether how we should position image or video inside its own box.
Example
<!DOCTYPE html> <html> <head> <style> img.demo { width: 200px; height: 200px; object-fit: none; object-position: 10px 20%; border: 2px dashed yellow; } </style> </head> <body> <h2>Demo Heading</h2> <img class="demo" src="https://www.tutorialspoint.com/memcached/images/memcached-mini-logo.jpg" alt="Memcached" width="400" height="250"> <h2>Memcached Tutorial</h2> <img src="https://www.tutorialspoint.com/memcached/images/memcached-mini-logo.jpg" alt="Memcached" width="300" height="250"> </body> </html>
Output
Advertisements