You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何去除SVG社交图标圆角?求CSS或SVG代码修改方案

Fixing the Rounded Corners on Your SVG Social Icon

Hey there! Let's break down why your SVG has those slight rounded corners and how to turn it into a perfect square icon.

Why the Rounded Corners Exist

Looking at your SVG code, the root cause is the <rect> element at the top:

<rect height="512" rx="64" ry="64" width="512" fill="#0083be"/>

The rx and ry attributes are SVG's way of defining border radius for rectangles. Setting them to 64 gives the background that subtle rounded edge you're seeing.

Two Ways to Make It Square

You’ve got two solid options here—pick whichever fits your workflow better:

1. Edit the SVG Code Directly (Most Reliable)

This is the simplest approach if you want a permanent square icon. Just change the rx and ry values in the <rect> tag to 0:

<svg height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg">
  <rect height="512" rx="0" ry="0" width="512" fill="#0083be"/>
  <g fill="#fff">
    <path d="M61.05316483 178.66808913h85.76013915v257.9625333H61.05316483zM104.5127998 54.28063176c-29.34185723 0-48.512575 19.29035996-48.512575 44.5737057 0 24.75194797 18.5880448 44.57370568 47.37675114 44.57370568h.55470467c29.9027771 0 48.5156826-19.8217577 48.5156826-44.5737057-.55470467-25.28334572-18.6113517-44.57370568-47.9345634-44.57370568zM357.27944394 172.60209055c-45.4904445 0-65.8669069 25.01764686-77.27642064 42.58951v-36.52349588h-85.73838603c1.13737765 24.1972433 0 257.9625333 0 257.9625333h85.73683224V292.56591023c0-7.7114826.55470468-15.4198576 2.82790618-20.93116706 6.1872101-15.39965828 20.30498783-31.35246744 43.9925865-31.35246744 31.01218643 0 43.43632805 23.66429176 43.43632805 58.3278955v138.02046672h85.74149362v-147.9305687c0-79.2373094-42.30516557-116.0979787-98.7203399-116.0979787z"/>
  </g>
</svg>

Save this modified code, and your icon will be perfectly square everywhere you use it.

2. Use CSS to Override the Radius (Great for Dynamic Changes)

If you need to keep the original SVG but want to display it as a square in your web project, CSS can help.

  • If your SVG is inline in your HTML (not embedded via an <img> tag), add this CSS:
/* Target the rect element inside your SVG */
svg rect {
  rx: 0 !important;
  ry: 0 !important;
}

The !important ensures it overrides the inline rx/ry attributes in the SVG.

  • Important Note: If you’re using the SVG as an <img> source (e.g., <img src="your-icon.svg">), CSS can’t modify the internal elements of the SVG file. In this case, editing the SVG code directly is your only viable option.

Which Option Should You Pick?

  • Go with editing the SVG code if you want a permanent square icon—this avoids style conflicts and works in all contexts.
  • Use CSS if you need to toggle between rounded and square versions dynamically (like on hover or based on user settings).

内容的提问来源于stack exchange,提问作者Henry

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 20:57:49