Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to get a diamond shape without cutting the image?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #175494
    NielsIm
    Participant

    Dear CSS-Tricks members,

    Today at work there was a discussion about creating an image in a diamond shape without cutting the image! This is because the image must be changed in the CMS by the customer.

    Created a simple jsfiddle to show you guys the problem. http://jsfiddle.net/gFtm2/4/

    I really hope there is a way to get the job done, with CSS ofcourse!

    Thanks,

    Niels

    #175496
    nixnerd
    Participant

    I don’t know how you plan to make an image a non-square AND not crop the image?

    Unless I don’t understand, this defies logic and physics.

    #175497
    Paulie_D
    Member

    I think he means without actually amending the image.

    #175498
    NielsIm
    Participant

    I don’t know either, that’s why I came here. To ask the community of CSS-Tricks if there was a way in CSS to ‘hide’ the corners in the way I created them in my jsfiddle example.

    #175500
    Paulie_D
    Member

    Here’s one way…note the image has to be larger than the containing div.

    http://codepen.io/Paulie-D/pen/cplje

    #175501
    NielsIm
    Participant

    Thank you Paulie_D. That was already really helpfull. If there are other ways to get this done I would love to hear, or what the best way is to do this!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.