如何用css制作这个形状?

发布于 2024-12-12 20:58:18 字数 1459 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

喜爱皱眉﹌ 2024-12-19 20:58:18

它是一个圆角矩形和一个三角形(或一个旋转的正方形)。要在“CSS”中实现它需要一些技巧。我建议你使用背景图片。

It's a rounded rectangle and a triangle (or a rotated square). To make it in "CSS" would require some hacks. I suggest you use a background image.

意犹 2024-12-19 20:58:18

纯粹用 CSS 模仿 iPhone 设计几乎是不可能的。然而:

我发现了 iWebKit,它是由一个在这项任务上花费了大量时间的人编写的。他用边框图像制作了导航按钮。
您可以在 http://snippetspace.com/ 上查看。我想它是免费下载的。
查看演示代码,您可以轻松了解按钮的工作原理。
iWebKit 仅适用于 webkit 浏览器,但不需要做很多工作就能适应其他浏览器(只需在 CSS 中显示 -webkit 的位置添加 -moz 或 -o 行即可)。

Mimicking the iPhone design purely in CSS is nearly impossible. However:

I found iWebKit, written by a guy who spent a lot of time on just that task. He did the navigation buttons with border images.
You can take a look at it at http://snippetspace.com/ . It's free to download, I think.
Looking at the demo code, you can easily see how the buttons work.
iWebKit is only for webkit browsers, but it does not take a lot of work to adapt to other browsers (just add -moz or -o lines where it says -webkit in the CSS).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文