使用 jQuery 实现圆角(图像)
我想使用单个图像(上图)将圆角应用于多个块。我知道有可用的角插件,但我需要使用图像以获得最大兼容性。所以,据我所知,唯一的方法是在块周围创建包装器以应用角图像:
<div class="wrapper-4"> <!-- top-left corner -->
<div class="wrapper-3"> <!-- top-right corner -->
<div class="wrapper-2"> <!-- bottom-left corner -->
<div class="wrapper-1"> <!-- bottom-right corner -->
<div class="content"> <!-- Content Block -->
I feel squeezed!
</div>
</div>
</div>
</div>
</div>
我知道丑陋,但我猜这是唯一的方法,使用 jQuery 创建包装器将使它不那么难看。因此,我需要帮助的是了解如何使用滑动门方法围绕这些 DIV 和图像(上图)创建 CSS,以便角落能够很好地显示出来,尤其是在 IE 中。我使用滑动门方法创建了按钮,但从未尝试过。
感谢任何帮助。谢谢!
I'd like to apply rounded corners to several blocks using the single image (above). I know there're corners plugins available but I need to use images for max compatibility. So, as I know, the only way is to create wrappers around the blocks to apply the corner images:
<div class="wrapper-4"> <!-- top-left corner -->
<div class="wrapper-3"> <!-- top-right corner -->
<div class="wrapper-2"> <!-- bottom-left corner -->
<div class="wrapper-1"> <!-- bottom-right corner -->
<div class="content"> <!-- Content Block -->
I feel squeezed!
</div>
</div>
</div>
</div>
</div>
Ugly I know, but its the only way I guess, using jQuery to create the wrappers will make it less ugly I guess. So what I need help with is to understand how exactly will the CSS will be created around these DIVs and image (above) using the sliding doors method so the corners would show up well, especially in IE. I've created buttons using the sliding doors method, but never tried this.
Appreciate any help. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要继续使用您知道的方式,您可以尝试以下操作:
To continue using the way you know you could try something like:
有一个 JQuery 插件可能会有所帮助: http://plugins.jquery.com/project/corners< /a>
但是,我不确定这是否适用于元素底部的渐变。
There's a JQuery Plugin for that that may help: http://plugins.jquery.com/project/corners
However, I'm not sure whether that will work for the gradient to the bottom of the element.