An image inside this stylishly framed photo with rounded corners

.a { clip-path: polygon(10% 0, 100% 0%, 100% 100%, 10% 100%,10% 60%, 0% 50%, 10% 40%); }       
.a { position: relative; width: 500px; height: 500px; background:url("https://cdn.pixabay.com/photo/2020/02/16/07/55/thailand-4852830_960_720.jpg"); border-radius: 15px;
<div class="a"></div>

I am faced with a challenge in creating 4 borders instead of just 2. Despite the limitation of clip-path not being supported in IE9, what alternative methods can I use to achieve the desired look?

Answer №1

For an added touch, I suggest incorporating another masking layer along with the clip-path property using mask

.a {
  --w: 30px; /*wdith of arrow*/
  --r: 25px; /*radius*/


  width: 500px;
  height: 200px;
  background: url("https://cdn.pixabay.com/photo/2020/02/16/07/55/thailand-4852830_960_720.jpg");
  border-radius: var(--r); /* Remove this if you want to keep only the left radius */
  padding-left:var(--w);
  clip-path: polygon(var(--w) 0, 100% 0%, 100% 100%, var(--w) 100%, var(--w) 60%, 0% 50%, var(--w) 40%);
   /* From chrome and webkit browser */
  -webkit-mask:
    linear-gradient(#fff,#fff),
    radial-gradient(farthest-side at bottom right,transparent 98%,#fff 100%) top    left/var(--r) var(--r) content-box content-box,
    radial-gradient(farthest-side at top    right,transparent 98%,#fff 100%) bottom left/var(--r) var(--r) content-box content-box;
  -webkit-mask-repeat:no-repeat;
  -webkit-mask-composite:source-out,source-over;
  /* For firefox and browsers that implement the new mask Specification*/
  mask:
    radial-gradient(farthest-side at bottom right,transparent 98%,#fff 100%) top    left/var(--r) var(--r) content-box content-box,
    radial-gradient(farthest-side at top    right,transparent 98%,#fff 100%) bottom left/var(--r) var(--r) content-box content-box,
    linear-gradient(#fff,#fff);
  mask-repeat:no-repeat;
  mask-composite:exclude;
}
<div class="a">

</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Expansive image coverage

My footer design includes a rounded left image, a repeating middle section, and a rounded right image. How can I ensure that it scales perfectly responsively without overlapping? Ideally, the solution would involve adjusting the width of the middle section ...

Building a Table Using HTML and CSS

I'm currently tackling this school assignment and have hit a roadblock with two issues. The HTML Validation error I'm encountering is regarding a table row that is 5 columns wide, exceeding the established count by the first row (4). From line 7 ...

After transitioning my Image Modal from an ID to a Class, it appears to not be functioning properly

I recently implemented an image modal on my website using the ID attribute, but it didn't seem to work as expected. After changing the id to a class, now the image modal is not functioning at all and I'm struggling to figure out what went wrong. ...

Tips on placing an li element into a designated DIV

Just starting out with jquery and working on a slider project. Here's what I have so far: <ul> <li> <img src="image.jpg"><p>description of the current image</p></li> <li> <img src="image.jpg"> ...

Methods for updating the value of a `<select>` element in an AngularJS controller

Within my HTML code, I have a select element with options ranging from 1 to 10: <select id="selVal" ng-model="product.quantity" ng-options="o as o for o in quantityValues" ng-change="updateDelta(product.quantity, {{product.quantity}}, product.selec ...

Incorporating a clickable button over a video

I've exhausted all available resources trying to figure this out and have hit a dead end. My goal is to place a button on top of the video, but my lack of CSS expertise is hindering me. Can someone please help me identify what I'm doing wrong wit ...

Using jQuery to insert a new string into the .css file

I'm currently working on a jQuery function to make my font size responsive to changes in width. While I am aware of other options like Media Query, I prefer a solution that offers smoother transitions. Using vw or vh units is not the approach I want t ...

Is there a way to create a duplicate form without any pre-filled text when clicking the "next" button using JavaScript?

This form contains the details that I would like to display on the page again when clicking the "Add Another Module" button. <div> <form class="in-line" id="module_info"></form> <div style="display: flex;"> < ...

Connecting Peers in Windows Store App using HTML/JS

I am curious to find out if anyone has successfully created a peer-to-peer app for the Windows Store using HTML5 and JavaScript. I want client A of the app to be able to establish a connection with and send data to client B through either a TCP or UDP sock ...

Upload button allowing multiple values to be uploaded as a single file

I'm currently facing an issue with my list of values and upload buttons. The file upload functionality is working correctly, but the problem arises when I try to upload a file for any item in the list - it always uploads for the first item only. Here ...

Grid is failing to adjust its size to accommodate the width of the items

Is there a way to adjust the width of each grid box based on the content nested inside? For instance, in the case of the second testimonial where the item has a max-width of 500px, but the grid box remains unchanged. I attempted to set widths and max-wid ...

Creating a Website Optimized for Mobile Devices

As a beginner web developer, I am in the process of creating a mobile-friendly website system. Currently, I am utilizing Bootstrap for responsiveness, PHP5, MySQL, and occasionally Ajax/JQuery. Recently, I came across JQuery Mobile. While I have been usin ...

Problem with Agile Carousel and thumbnail component

I have incorporated the Agile Carousel plugin into my website to create multiple slideshows. The first slideshow at the top is working fine, but I am experiencing an issue with the carousel in the "About" section at the bottom. While I have successfully se ...

Interactive radio button selection with dynamic image swapping feature

I'm currently working on creating a radio list with three options: Salad Spaghetti Ice cream This is how I coded it: <div id="radiobuttons"> <label><input name="vf" type="radio" value="0" checked/>Salad</label> < ...

The simple method of adjusting text opacity using CSS hover doesn't function as expected

I attempted to create divs in which hovering over one side would cause the opposite text to disappear. The functionality works flawlessly when hovering over the left text, as the right text disappears as intended. However, it is not working in the reverse ...

Cut an image using CSS while maintaining its original quality

I am currently working on an upload page where users can upload images. Here is the link to the page: MyPage. However, I would like to implement image cropping functionality that displays more of the image rather than just a small portion as it does now. A ...

Unable to refresh the fullcalendar section following an ajax post click

Currently developing a calendar using fullcalendar. I have created an ajax button that retrieves events from another php page. The first click on the ajax button works fine, displaying a nice month calendar with events. However, my issue arises when I cl ...

Encountering issues with CSS Modules in Next.JS app while using app/about/layout.tsx

Currently, I am delving into the world of Next.js and encountering some challenges with locally scoped CSS modules. In my project, I have an about directory which contains a layout component. Strangely, the styles applied to the layout component are not b ...

Discovering the mean value from a data set in a spreadsheet

I have been tasked with creating an HTML page for a car dealership using JQuery and Bootstrap 5. The goal is to utilize Bootstrap 5 to accomplish the following: Set up a table with appropriate form input elements that allow users to input four (4) quarter ...

Reducing the Distance Between Columns in Bootstrap 4

I am currently working on embedding two websites onto my own website. The idea is to showcase these websites side by side within a custom-sized iframe that adjusts responsively based on the viewport size. To achieve this, I am utilizing Bootstrap 4's ...