<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>calc | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/tag/calc/feed/" rel="self" type="application/rss+xml" />
	<link>https://sdt.hameba.tw</link>
	<description>由Steven, Der, Ted 三位高級打字員所組成，是三位工程師(攻城獅)所維護的技術分享平台，或許偶爾會分享一些日常，有任何問題或是錯誤的部分，歡迎留言告訴我們！</description>
	<lastBuildDate>Thu, 27 Feb 2020 16:33:37 +0800</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.3</generator>

<image>
	<url>https://sdt.hameba.tw/wp-content/uploads/2020/02/hameba_favicon-150x150.png</url>
	<title>calc | SDT 攻城獅區</title>
	<link>https://sdt.hameba.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>CSS3 可以用 calc() 方式做數值運算</title>
		<link>https://sdt.hameba.tw/487/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css3-%25e5%258f%25af%25e4%25bb%25a5%25e7%2594%25a8-calc-%25e6%2596%25b9%25e5%25bc%258f%25e5%2581%259a%25e6%2595%25b8%25e5%2580%25bc%25e9%2581%258b%25e7%25ae%2597</link>
				<comments>https://sdt.hameba.tw/487/#respond</comments>
				<pubDate>Sat, 25 Jan 2020 10:14:59 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[calc]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=487</guid>
				<description><![CDATA[<p>屬於前端工程師一定要會的function calc()， calc() 是作用於屬性設定是數值的時候可以進行加 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/487/" class="more-link">閱讀全文<span class="screen-reader-text">〈CSS3 可以用 calc() 方式做數值運算〉</span></a></p>
The post <a href="https://sdt.hameba.tw/487/">CSS3 可以用 calc() 方式做數值運算</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>屬於前端工程師一定要會的function calc()，</p>
<p>calc() 是作用於屬性設定是數值的時候可以進行加減乘除的運算，</p>
<p><span id="more-487"></span></p>
<p><img class="alignnone size-large wp-image-488" src="https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-25-下午6.10.47-1024x276.png" alt="CSS3 calc function" width="840" height="226" srcset="https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-25-下午6.10.47-1024x276.png?v=1579947073 1024w, https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-25-下午6.10.47-300x81.png?v=1579947073 300w, https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-25-下午6.10.47-768x207.png?v=1579947073 768w, https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-25-下午6.10.47-1536x414.png?v=1579947073 1536w, https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-25-下午6.10.47-1200x323.png?v=1579947073 1200w, https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-25-下午6.10.47.png?v=1579947073 1944w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></p>
<p>有時使用width:100% 但因為視窗大小其實在某些計算上 有時產生1px差異，</p>
<p>造成版面的block 有誤差，</p>
<p>所以可以使用width:calc(<span style="color: #ff0000">100% &#8211; 1px</span>)，此種方式來減少誤差，</p>
<p>最重要的關鍵是，加減乘除符號與前後數值一定要空白，如果直接使用無空白，</p>
<p>寫成這樣width:calc(<span style="color: #ff0000">100%-1px</span>)，在瀏覽器上將會無效數值。</p>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://www.w3schools.com/cssref/func_calc.asp" target="_blank" rel="noopener noreferrer">https://www.w3schools.com/cssref/func_calc.asp</a></p>The post <a href="https://sdt.hameba.tw/487/">CSS3 可以用 calc() 方式做數值運算</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/487/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
