How do I add a skewed shadow effect to this image?

Please take a moment to view the following image.

click here for image description

https://i.sstatic.net/utBgB.png

I attempted the code below, but unfortunately it did not produce the desired result.

    z-index: -1;
content: "";
box-shadow: 86px 0 17px rgba(0,0,0,0.33);
-webkit-transform: skew(-36deg);
-moz-transform: skew(-36deg);
-ms-transform: skew(-36deg);
-o-transform: skew(-36deg);
transform: skew(-36deg);
-webkit-transform-origin: 0% 100%;
-moz-transform-origin: 0% 100%;
-ms-transform-origin: 0% 100%;
-o-transform-origin: 0% 100%;
transform-origin: 0% 100%;

Please also refer to the second image linked below

click here for image description

https://i.sstatic.net/LUqhi.png Any assistance would be greatly appreciated.

Thank you.

Answer №1

Utilize a pseudoclass and apply a rotation to create a shadow effect. Take a look at this code snippet.

img {
  max-width: 100%;
  border-radius: 120px;
}
.image-wrapper {
  position: relative;
  width: 250px;
  transform: rotate(20deg);
  transform-origin: 0% 100%;
}
.image-wrapper:before{
   z-index: -1;
  content: '';
  position: absolute;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 120px;
  transform: rotate(25deg);
  transform-origin: 70% 70%;
}
<div class="image-wrapper">
  <img src="http://www.petsworld.in/blog/wp-content/uploads/2014/09/cat.jpg" alt="">
  </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

Display stylish Instagram-like dots in the slick slider

Currently, I am utilizing the slick slider to display numerous slider items. Additionally, I want to include dots to indicate the position of the items. However, there are too many dots visible at once, and I wish to display them similarly to how Instagram ...

Creating a Dynamic 4-Column Website Design with HTML and CSS Div Elements

I am struggling with creating a simple website layout. Here are some images of the design I'm trying to achieve, along with my code. https://i.sstatic.net/lbhvG.png https://i.sstatic.net/wc8wr.png My question is whether each column (4 in total) shou ...

What's the best way to add animation to the send icon while hovering over the button?

<div class="text-center"> <button [disabled]="btnStatus" class="btn btn-secondary buttonSend" type="submit"> <div [hidden]="btnStatus"> Send Message&nbsp;&nbs ...

The background image will expand to fill any available space

I'm currently working on rendering divs with a background image CSS property. The images have fixed sizes, and I want to display them in a grid layout. However, the divs with background images stretch when there is extra space available, which is not ...

Changing the text link color on IOS can be achieved by modifying the CSS properties

Recently, I encountered an issue with the text link color of my website. While I had set the link color to red for desktop view, it inexplicably changed to blue when viewed on an iPhone. Even after trying to use !important, the problem persisted. Can som ...

Is it advisable to restrict ajax requests?

Is using ajax requests more resource-intensive than a traditional page load? Consider a basic menu with standard links where clicking a link takes you to a new page. By using ajax, I can avoid this default behavior and instead fetch the linked page' ...

What is the best way to attach every sibling element to its adjacent sibling using jQuery?

I've been working with divs in Wordpress, where each div contains a ul element. <div class="list-item"> <div class="elimore_trim"> Lorem ipsum </div> <ul class="hyrra-forrad-size-list"> <li>Rent 1< ...

What's the most lightweight jQuery dialog that isn't modal?

Check out this example: http://jqueryui.com/demos/dialog/ However, I find it to be too extensive for my needs. It consists of a total of 2 thousand lines of code. What I'm looking for is a solution that can fit in a single file with less than 1 th ...

How can I place a Pure CSS Menu within a Div Container?

I've been experimenting with the Pure CSS menu found on this site: http://csswizardry.com/2011/02/creating-a-pure-css-dropdown-menu/ It's working well, but I'm facing an issue where I want to place this menu inside another div container. H ...

Text displayed in a pop-up when hovering

I'm in search of suggestions for creating a text pop-up that displays when the mouse hovers over specific text. After researching numerous websites, I haven't found exactly what I need. Currently, I have a table with headers at the top and I woul ...

Foundation 6: Conceal the Top Bar upon Clicking a Link

I'm currently working with Foundation 6 on a single-page website. Utilizing the Top Bar feature to navigate users to different sections of the site. However, I have run into an issue with the mobile version. When clicking a link from the collapsed Top ...

What are the various form actions available on an HTML webpage?

I have been working with this code to insert data into a table in an Oracle database 10g. The table is named REGISTER, so I created a register.html page and added the JSP file accordingly. I also created a validation page, but I am not sure where to add it ...

How can I add an image to a canvas using a button?

Having trouble with my studies and looking to create a custom shirt website. Posted below is the beginner code I have: If anyone knows how to upload an image onto a shirt canvas using a button, as well as change the shirt color with another button, please ...

What is the process for transferring information from HTML to Python and then receiving the output in HTML?

I am completely unfamiliar with the connection between HTML and Python, so I am reaching out for some assistance. I hope that someone here can lend me a hand. Currently, my HTML is hosted on an Apache server, and I access the website using the address "". ...

Converting a Rails array into a jQuery selector

I'm currently working on implementing AJAX functionality for the delete action in my controller, following the steps outlined in Railscast 136 - jQuery AJAX revised While it successfully deletes the element I select, it doesn't actually disappea ...

rely on a fresh event starting at one

Despite my limited knowledge in javascript, I managed to create a simple js calendar that I am quite proud of. However, I have been facing a challenge for the past few days. You can view my calendar here: https://jsfiddle.net/ck3nsemz/ The issue I'm ...

Guide on transforming Div content to json format with the use of jquery

I am trying to figure out how to call the div id "con" when the export button is clicked in my HTML code. I want it to display JSON data in the console. If anyone has any suggestions or solutions, please help! <html> <div id ="con"> < ...

Parsing of the module failed due to an unexpected character appearing when trying to insert a TTF file into the stylesheet

As a newcomer to Angular, I recently completed the tutorial and am now working on my first app. While trying to add an OTF file, everything went smoothly. However, when I made a change to my app.component.css file and included this code snippet: @font-fa ...

CORS error causing Jquery ajax request to fail

I'm having an issue with my calendar and PHP file interaction. When I click on a day, I want to display the content from my PHP file, but I keep getting a 403 error message stating: "No 'Access-Control-Allow-Origin' header is present on the ...

Inflexible lists refusing to wrap

I have a straightforward requirement: I need a list <ul /> containing items <div />s of the same fixed size. These items should be displayed from left to right, filling up all available space before wrapping onto the next line. Below is the ba ...