在 CSS3 border-radius 普及前,jQuery Corner 外掛透過動態生成多層 <div> 模擬圓角。本文示範基本用法,並指出背景顏色在 IE 下渲染異常的已知問題。
jquery.corners.min.js。.roundedd)。$('.roundedd').corners()。<!DOCTYPE html>
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<title>jQuery Corners</title>
<script src="jquery.js"></script>
<script src="jquery.corners.min.js"></script>
<script>$(function(){ $('.roundedd').corners(); });</script>
<style>
.roundedd { background-color:#eeeeee; padding:20px; }
</style>
</head>
<body>
<div class="roundedd">class="rounded {10px}"</div>
</body>
</html>
若 background-color 使用關鍵字(red、yellow)在 IE 下圓角不顯示;建議改用十六進位(#ff0000、#ffff00)或 RGB 表示法。
.roundedd { border-radius: 10px; background:#eee; }
所有現代瀏覽器(含 IE9+)完整支援,無需任何 JS 库,效能極佳。