Is it possible to have a non-rectangular div?

前端 未结 10 1915
滥情空心
滥情空心 2021-01-11 14:26

I need to shape ONE div tag in the following shape:

Is it possible to make it cross browser? I don\'t necessarily need rounded

10条回答
  •  时光说笑
    2021-01-11 14:51

    two options that I can think of:

    1) give the div a background image and use CSS pseudo class :hover to change the background image to one that indicates a hover state

    2) put three div's inside a wrapper, and position them so so you have one in the upper left hand corner, and then two stacked on top of each other, so that you can simulate the top half of a larger div missing the upper left half border. I don't think CSS alonw can target all the divs in order to change their borders, so will probably have to use JS to execute the hover behavior, by applying an event handler to all three divs.

提交回复
热议问题