{"id":39748,"date":"2026-01-24T03:09:23","date_gmt":"2026-01-24T11:09:23","guid":{"rendered":"https:\/\/cloudinary.com\/blog\/?p=39748"},"modified":"2026-01-24T03:09:25","modified_gmt":"2026-01-24T11:09:25","slug":"how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image","title":{"rendered":"How can CSS cropping techniques isolate or hide portions of an image?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Front-end developers frequently ask how to show only a portion of an image without opening a graphics editor. In community threads, you will see variations of the same need: create square avatars, focus on a subject in a banner, mask a shape, or crop an image responsively.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Question:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><em>How can CSS cropping techniques isolate or hide portions of an image? I want to show only part of an image in different layouts, such as square thumbnails, circle avatars, hero banners with a focal point, and masked shapes. I would like examples using CSS for images and backgrounds, and any notes on performance or accessibility. Bonus if there is a way to offload actual cropping server side for better performance.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Answer:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">CSS can visually crop by confining, positioning, or masking an image within a frame. Keep in mind this does not reduce bytes downloaded. The browser still fetches the entire file, then hides parts of it. If bandwidth matters, consider a server-side crop as a complement to CSS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1) Frame an image and hide overflow<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Simple, widely supported, great for thumbnails.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">&lt;div <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span><\/span>=<span class=\"hljs-string\">\"frame\"<\/span>&gt;\n\u00a0 <span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"photo.jpg\"<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"Example\"<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/span>\n\n.frame {\n\u00a0 <span class=\"hljs-attr\">width<\/span>: <span class=\"hljs-number\">200<\/span>px;\n\u00a0 height: <span class=\"hljs-number\">200<\/span>px;\n\u00a0 overflow: hidden;\n\u00a0 position: relative;\n}\n.frame img {\n\u00a0 <span class=\"hljs-attr\">position<\/span>: absolute;\n\u00a0 top: <span class=\"hljs-number\">-20<\/span>px; \u00a0 <span class=\"hljs-comment\">\/* adjust focal point *\/<\/span>\n\u00a0 left: <span class=\"hljs-number\">-50<\/span>px;\n\u00a0 height: <span class=\"hljs-number\">240<\/span>px; <span class=\"hljs-comment\">\/* optional scale to fill *\/<\/span>\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">2) object-fit and object-position for intrinsic images<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>object-fit: cover<\/code> to fill a fixed box while preserving aspect ratio. Adjust the focal point with <code>object-position<\/code>.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">&lt;img <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span><\/span>=<span class=\"hljs-string\">\"thumb\"<\/span> src=<span class=\"hljs-string\">\"photo.jpg\"<\/span> alt=<span class=\"hljs-string\">\"Landscape\"<\/span>&gt;\n\n.thumb {\n\u00a0 <span class=\"hljs-attr\">width<\/span>: <span class=\"hljs-number\">240<\/span>px;\n\u00a0 height: <span class=\"hljs-number\">160<\/span>px;\n\u00a0 object-fit: cover;\u00a0 \u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/* similar to background-size: cover *\/<\/span>\n\u00a0 object-position: <span class=\"hljs-number\">30<\/span>% <span class=\"hljs-number\">40<\/span>%; <span class=\"hljs-comment\">\/* nudge the crop window *\/<\/span>\n\u00a0 border-radius: <span class=\"hljs-number\">12<\/span>px;\u00a0 \u00a0 \u00a0 <span class=\"hljs-comment\">\/* optional rounded corners *\/<\/span>\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">For layout alignment details, see this guide on <a href=\"https:\/\/cloudinary.com\/guides\/image-effects\/image-align-centering-with-html-and-css\">centering images with HTML and CSS<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3) background-image with background-size and background-position<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Great for decorative images or when you need to overlay content. The element acts as the crop window. Explore techniques in <a href=\"https:\/\/cloudinary.com\/guides\/front-end-development\/6-ways-to-stretch-a-background-image-with-css\">6 ways to stretch a background image with CSS<\/a>.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"hero\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n.hero {\n\u00a0 width: 100%;\n\u00a0 height: 300px;\n\u00a0 background-image: url('banner.jpg');\n\u00a0 background-size: cover;\u00a0 \u00a0 \u00a0 \u00a0 \/* cover crops to fill *\/\n\u00a0 background-position: 60% 40%;\u00a0 \/* control focal area *\/\n\u00a0 background-repeat: no-repeat;\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">4) clip-path for geometric or custom shape crops<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use the <code>clip-path<\/code> property to reveal only the desired region. Works on any element.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">&lt;img <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span><\/span>=<span class=\"hljs-string\">\"clip\"<\/span> src=<span class=\"hljs-string\">\"photo.jpg\"<\/span> alt=<span class=\"hljs-string\">\"Subject\"<\/span>&gt;\n\n.clip {\n\u00a0 <span class=\"hljs-attr\">width<\/span>: <span class=\"hljs-number\">300<\/span>px;\n\u00a0 height: <span class=\"hljs-number\">300<\/span>px;\n\u00a0 object-fit: cover;\n\u00a0 clip-path: circle(<span class=\"hljs-number\">45<\/span>% at <span class=\"hljs-number\">50<\/span>% <span class=\"hljs-number\">50<\/span>%); <span class=\"hljs-comment\">\/* circle avatar *\/<\/span>\n}\n\n<span class=\"hljs-comment\">\/* Custom polygon *\/<\/span>\n.custom-clip {\n\u00a0 clip-path: polygon(<span class=\"hljs-number\">10<\/span>% <span class=\"hljs-number\">10<\/span>%, <span class=\"hljs-number\">90<\/span>% <span class=\"hljs-number\">10<\/span>%, <span class=\"hljs-number\">80<\/span>% <span class=\"hljs-number\">90<\/span>%, <span class=\"hljs-number\">20<\/span>% <span class=\"hljs-number\">90<\/span>%);\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">5) CSS masks for fades and soft reveals<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Masks use an image or gradient to control transparency. Requires <code>-webkit-<\/code> prefix for Safari.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">&lt;img <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span><\/span>=<span class=\"hljs-string\">\"fade-edge\"<\/span> src=<span class=\"hljs-string\">\"photo.jpg\"<\/span> alt=<span class=\"hljs-string\">\"Scenery\"<\/span>&gt;\n\n.fade-edge {\n\u00a0 <span class=\"hljs-attr\">width<\/span>: <span class=\"hljs-number\">400<\/span>px;\n\u00a0 height: <span class=\"hljs-number\">250<\/span>px;\n\u00a0 object-fit: cover;\n\u00a0 -webkit-mask-image: linear-gradient(black <span class=\"hljs-number\">70<\/span>%, transparent <span class=\"hljs-number\">100<\/span>%);\n\u00a0 mask-image: linear-gradient(black <span class=\"hljs-number\">70<\/span>%, transparent <span class=\"hljs-number\">100<\/span>%);\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">You can also layer or overlay elements while keeping control of the visible region. See ideas in <a href=\"https:\/\/cloudinary.com\/guides\/image-effects\/how-to-overlay-a-picture-on-a-picture\">how to overlay a picture on a picture<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6) Sprite-style cropping with background-position<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Show a subsection of a larger image sprite by offsetting the background.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\"><span class=\"hljs-selector-class\">.icon<\/span> {\n\u00a0 <span class=\"hljs-attribute\">width<\/span>: <span class=\"hljs-number\">32px<\/span>;\n\u00a0 <span class=\"hljs-attribute\">height<\/span>: <span class=\"hljs-number\">32px<\/span>;\n\u00a0 <span class=\"hljs-attribute\">background-image<\/span>: <span class=\"hljs-built_in\">url<\/span>(<span class=\"hljs-string\">'icons-sprite.png'<\/span>);\n\u00a0 <span class=\"hljs-attribute\">background-repeat<\/span>: no-repeat;\n\u00a0 <span class=\"hljs-attribute\">background-position<\/span>: -<span class=\"hljs-number\">96px<\/span> -<span class=\"hljs-number\">64px<\/span>; <span class=\"hljs-comment\">\/* x y offsets *\/<\/span>\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Performance, scaling, and responsive behavior<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CSS cropping hides pixels but does not save network bytes.<\/li>\n\n\n\n<li>Use <code>object-fit<\/code> or background-size to handle different aspect ratios.<\/li>\n\n\n\n<li>Combine CSS with responsive images (<code>srcset<\/code> or <code>sizes<\/code>) or transform the asset server side for best performance. For scaling guidance, see <a href=\"https:\/\/cloudinary.com\/guides\/front-end-development\/using-css-to-scale-page-elements-and-a-better-way-to-scale-your-images\">using CSS to scale page elements<\/a>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Doing the actual crop server side with Cloudinary<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to reduce bytes and deliver exactly what you show, process the crop on delivery. For example, this URL returns a 320&#215;180 crop centered on the most interesting region:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/c_fill,w_320,h_180,g_auto,f_auto\/sample.jpg\"><code>https:\/\/res.cloudinary.com\/demo\/image\/upload\/c_fill,w_320,h_180,g_auto,f_auto\/sample.jpg<\/code><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Circle avatar focused on a face:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>https:\/\/res.cloudinary.com\/demo\/image\/upload\/c_thumb,w_200,h_200,g_face,r_max,f_auto\/sample.jpg<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can then layer your CSS on top for fine positioning. For background techniques and layout tips, this practical read on <a href=\"https:\/\/cloudinary.com\/guides\/front-end-development\/6-ways-to-stretch-a-background-image-with-css\">background images in CSS<\/a> pairs well with server-side cropping.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Common pitfalls<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Using background images for content that needs alt text and SEO. Use <code>&lt;img><\/code> tags with <code>alt<\/code> text.<\/li>\n\n\n\n<li>Forgetting that clip-path affects hit testing. Only the visible region is clickable.<\/li>\n\n\n\n<li>Masks can be GPU intensive on low-end devices. Test on target hardware.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">TL;DR<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use overflow hidden, object-fit, or background-position to crop visually.<\/li>\n\n\n\n<li>Use clip-path for shapes and masks for fades.<\/li>\n\n\n\n<li>CSS cropping does not save bandwidth. For performance, crop on the server and deliver only what you need.<\/li>\n\n\n\n<li>Combine responsive images with smart server-side crops, then refine with CSS for layout polish.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Learn More<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/cloudinary.com\/tools\/png-to-webp\">PNG to WebP Converter<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/cloudinary.com\/tools\/image-upscale\">Image Upscaling and Quality Enhancement<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/cloudinary.com\/tools\/compress-png\">Compress PNG<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/cloudinary.com\/background-remover\">Background Remover<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Ready to optimize how you crop and deliver images at scale? <a href=\"https:\/\/cloudinary.com\/users\/register_free\">Create your free Cloudinary account<\/a> and start transforming, optimizing, and delivering media with minimal code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Front-end developers frequently ask how to show only a portion of an image without opening a graphics editor. In community threads, you will see variations of the same need: create square avatars, focus on a subject in a banner, mask a shape, or crop an image responsively.&nbsp; Question: How can CSS cropping techniques isolate or [&hellip;]<\/p>\n","protected":false},"author":88,"featured_media":39726,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[423],"class_list":["post-39748","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-questions"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.3 (Yoast SEO v28.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How can CSS cropping techniques isolate or hide portions of an image?<\/title>\n<meta name=\"description\" content=\"Front-end developers frequently ask how to show only a portion of an image without opening a graphics editor. In community threads, you will see\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How can CSS cropping techniques isolate or hide portions of an image?\" \/>\n<meta property=\"og:description\" content=\"Front-end developers frequently ask how to show only a portion of an image without opening a graphics editor. In community threads, you will see\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-24T11:09:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-24T11:09:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1769222068\/css_featured_image\/css_featured_image.jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"damjanantevski\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image\"},\"author\":{\"name\":\"damjanantevski\",\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/#\\\/schema\\\/person\\\/43592e43c12520a1e867d456b1e8cf7e\"},\"headline\":\"How can CSS cropping techniques isolate or hide portions of an image?\",\"datePublished\":\"2026-01-24T11:09:23+00:00\",\"dateModified\":\"2026-01-24T11:09:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image\"},\"wordCount\":598,\"publisher\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/res.cloudinary.com\\\/cloudinary-marketing\\\/images\\\/f_auto,q_auto\\\/v1769222068\\\/css_featured_image\\\/css_featured_image.jpg?_i=AA\",\"keywords\":[\"Questions\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2026\",\"copyrightHolder\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image\",\"url\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image\",\"name\":\"How can CSS cropping techniques isolate or hide portions of an image?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/res.cloudinary.com\\\/cloudinary-marketing\\\/images\\\/f_auto,q_auto\\\/v1769222068\\\/css_featured_image\\\/css_featured_image.jpg?_i=AA\",\"datePublished\":\"2026-01-24T11:09:23+00:00\",\"dateModified\":\"2026-01-24T11:09:25+00:00\",\"description\":\"Front-end developers frequently ask how to show only a portion of an image without opening a graphics editor. In community threads, you will see\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#primaryimage\",\"url\":\"https:\\\/\\\/res.cloudinary.com\\\/cloudinary-marketing\\\/images\\\/f_auto,q_auto\\\/v1769222068\\\/css_featured_image\\\/css_featured_image.jpg?_i=AA\",\"contentUrl\":\"https:\\\/\\\/res.cloudinary.com\\\/cloudinary-marketing\\\/images\\\/f_auto,q_auto\\\/v1769222068\\\/css_featured_image\\\/css_featured_image.jpg?_i=AA\",\"width\":1200,\"height\":630,\"caption\":\"CSS featured image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/questions\\\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/cloudinary.com\\\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How can CSS cropping techniques isolate or hide portions of an image?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/res.cloudinary.com\\\/cloudinary-marketing\\\/images\\\/f_auto,q_auto\\\/v1649718331\\\/Web_Assets\\\/blog\\\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\\\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\\\/\\\/res.cloudinary.com\\\/cloudinary-marketing\\\/images\\\/f_auto,q_auto\\\/v1649718331\\\/Web_Assets\\\/blog\\\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\\\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cloudinary.com\\\/blog\\\/#\\\/schema\\\/person\\\/43592e43c12520a1e867d456b1e8cf7e\",\"name\":\"damjanantevski\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b40c995531fe4d510212a06c9d4fc666d2cb8efbfebc98a94191701accf4817?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b40c995531fe4d510212a06c9d4fc666d2cb8efbfebc98a94191701accf4817?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b40c995531fe4d510212a06c9d4fc666d2cb8efbfebc98a94191701accf4817?s=96&d=mm&r=g\",\"caption\":\"damjanantevski\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How can CSS cropping techniques isolate or hide portions of an image?","description":"Front-end developers frequently ask how to show only a portion of an image without opening a graphics editor. In community threads, you will see","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image","og_locale":"en_US","og_type":"article","og_title":"How can CSS cropping techniques isolate or hide portions of an image?","og_description":"Front-end developers frequently ask how to show only a portion of an image without opening a graphics editor. In community threads, you will see","og_url":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image","og_site_name":"Cloudinary Blog","article_published_time":"2026-01-24T11:09:23+00:00","article_modified_time":"2026-01-24T11:09:25+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1769222068\/css_featured_image\/css_featured_image.jpg?_i=AA","type":"image\/jpeg"}],"author":"damjanantevski","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image"},"author":{"name":"damjanantevski","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/43592e43c12520a1e867d456b1e8cf7e"},"headline":"How can CSS cropping techniques isolate or hide portions of an image?","datePublished":"2026-01-24T11:09:23+00:00","dateModified":"2026-01-24T11:09:25+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image"},"wordCount":598,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1769222068\/css_featured_image\/css_featured_image.jpg?_i=AA","keywords":["Questions"],"inLanguage":"en-US","copyrightYear":"2026","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image","url":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image","name":"How can CSS cropping techniques isolate or hide portions of an image?","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1769222068\/css_featured_image\/css_featured_image.jpg?_i=AA","datePublished":"2026-01-24T11:09:23+00:00","dateModified":"2026-01-24T11:09:25+00:00","description":"Front-end developers frequently ask how to show only a portion of an image without opening a graphics editor. In community threads, you will see","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1769222068\/css_featured_image\/css_featured_image.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1769222068\/css_featured_image\/css_featured_image.jpg?_i=AA","width":1200,"height":630,"caption":"CSS featured image"},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog"},{"@type":"ListItem","position":2,"name":"How can CSS cropping techniques isolate or hide portions of an image?"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/43592e43c12520a1e867d456b1e8cf7e","name":"damjanantevski","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3b40c995531fe4d510212a06c9d4fc666d2cb8efbfebc98a94191701accf4817?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3b40c995531fe4d510212a06c9d4fc666d2cb8efbfebc98a94191701accf4817?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3b40c995531fe4d510212a06c9d4fc666d2cb8efbfebc98a94191701accf4817?s=96&d=mm&r=g","caption":"damjanantevski"}}]}},"parsely":{"version":"1.1.0","canonical_url":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image","meta":{"@context":"https:\/\/schema.org","@type":"NewsArticle","headline":"How can CSS cropping techniques isolate or hide portions of an image?","url":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image","mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1769222068\/css_featured_image\/css_featured_image.jpg?_i=AA&w=150&h=150&crop=1","image":{"@type":"ImageObject","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1769222068\/css_featured_image\/css_featured_image.jpg?_i=AA"},"articleSection":"Uncategorized","author":[{"@type":"Person","name":"damjanantevski"}],"creator":["damjanantevski"],"publisher":{"@type":"Organization","name":"Cloudinary Blog","logo":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA"},"keywords":["questions"],"dateCreated":"2026-01-24T11:09:23Z","datePublished":"2026-01-24T11:09:23Z","dateModified":"2026-01-24T11:09:25Z"},"rendered":"<meta name=\"parsely-title\" content=\"How can CSS cropping techniques isolate or hide portions of an image?\" \/>\n<meta name=\"parsely-link\" content=\"https:\/\/cloudinary.com\/blog\/questions\/how-can-css-cropping-techniques-isolate-or-hide-portions-of-an-image\" \/>\n<meta name=\"parsely-type\" content=\"post\" \/>\n<meta name=\"parsely-image-url\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1769222068\/css_featured_image\/css_featured_image.jpg?_i=AA&w=150&amp;h=150&amp;crop=1\" \/>\n<meta name=\"parsely-pub-date\" content=\"2026-01-24T11:09:23Z\" \/>\n<meta name=\"parsely-section\" content=\"Uncategorized\" \/>\n<meta name=\"parsely-tags\" content=\"questions\" \/>\n<meta name=\"parsely-author\" content=\"damjanantevski\" \/>","tracker_url":"https:\/\/cdn.parsely.com\/keys\/cloudinary.com\/p.js"},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1769222068\/css_featured_image\/css_featured_image.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/39748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/88"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=39748"}],"version-history":[{"count":1,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/39748\/revisions"}],"predecessor-version":[{"id":39749,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/39748\/revisions\/39749"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/39726"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=39748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=39748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=39748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}