Rounded skewed top shape in css
问题 I need to make a div that looks like this: With text in the middle in css. I tried looking at transforms and other 3d stuff, but I couldn't figure it out, especially without ruining the text. 回答1: You can use a skewed Y pseudo element as a background of the element. This won't affect the content : div { position: relative; display: inline-block; padding: 20px 50px; overflow: hidden; } div:before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #FFD505