如何仅使用CSS将div标签的区域弄圆? [英] How to use only CSS to round my div tag area's corners?

查看:135
本文介绍了如何仅使用CSS将div标签的区域弄圆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用div标签在网页中定义区域.我设置了所有显而易见的内容,例如背景,大小,填充等.但是它们都很方形.

如何仅使用 CSS来解决问题?

解决方案

您将使用border-radius属性.但是,只有浏览器尚未实现的CSS3才支持此功能.如果只需要它在几个浏览器中运行,则可以使用-webkit-border-radius和-moz-border-radius,这将使其分别在Safari和Firefox中运行.

如果您不反对使用图像.这是我为制作圆形边框想到的方法. >

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 only CSS to round the corners?

解决方案

You would use the border-radius property. However, this is only supported in CSS3, which no browser implements yet. If you only need it to work in a couple browsers you could use -webkit-border-radius and -moz-border-radius which would let it work in Safari and Firefox respectively.

If you are not opposed to using images. Here's s method I came up with for making rounded borders.

这篇关于如何仅使用CSS将div标签的区域弄圆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆