How to use only CSS to round my div tag area's corners?

后端 未结 6 1440
感情败类
感情败类 2021-02-01 10:24

I use div tags to define areas within my web pages. I set all the obvious things like background, size, padding, etc. But it is all very square.

How can I use

6条回答
  •  我在风中等你
    2021-02-01 10:40

    If by "only CSS" you mean "without JavaScript" then you can surely add background images with round corners to your elements. You may need extra markup in this case depending on how much flexibility you need.

    Considering that you cannot use multiple background images yet, I think using a single image is the best only CSS option.

    If you can use JavaScript, then you may want to check out Nifty Corners Cube. I mention this because it works even on top of images and supports transparency.

提交回复
热议问题