🔲 Grid Pattern Generator

📐 工作原理與說明
單元格邊長 = size(下限 5,預設 30),線寬 = lw(下限 1);方格用橫豎兩層 linear-gradient 疊加、background-size = size × size;虛線改用內聯 SVG 的 stroke-dasharray 畫橫豎雙向斷續線段(虛線週期整除單元格邊長以保持跨瓦片連續),不再依賴只沿單軸重複的 repeating-linear-gradient;點陣用 radial-gradient(線色 lw px, transparent lw+1 px);斜線與十字改為 45° / −45° 的 linear-gradient 組合
按固定間距重複繪製方格或網格線(線寬與顏色可調)生成背景圖案並複製 CSS 程式碼;用於工程圖底圖、網頁紋理與印刷稿。

Generate square or ruled grid backgrounds with adjustable spacing and line colour for engineering layouts, web textures and print.

📚 深度解析:網格圖案

💡 常見使用場景

  • 原型底格。
  • 工程圖背景。
  • 紋理。
生成 8px 網格

輸入:格 8px、線 #E5E7EB。

處理:linear 雙向平鋪。

輸出:background 程式碼與預覽。結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。

❓ 常見問題(FAQ)

雙層網格怎麼畫?
用兩個背景層分別畫主/次格距。結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。
生成的程式碼/圖片能直接用嗎?
可直接複製使用,建議粘到專案後在瀏覽器實測微調;本工具只生成不託管。
會儲存或上傳我的內容嗎?
結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。

Formula & Standard References

Item Formula / Note Source / Standard
Pattern tiling the SVG pattern tile size sets the grid pitch W3C SVG 1.1
Major and minor grid major lines thicken at integer multiples of the minor pitch Design practice
Stroke alignment odd stroke widths need a half-pixel offset to stay crisp Rasterization practice
⚠️ 使用說明與注意事項