首页 > web前端 > H5教程 > css3 如何实现圆边框的渐变? 如图

css3 如何实现圆边框的渐变? 如图

WBOY
发布: 2016-06-07 08:44:05
原创
2303 人浏览过

回复内容:

<code class="language-css"><span class="o"><!</span><span class="nt">DOCTYPE</span> <span class="nt">html</span><span class="o">></span>
<span class="o"><</span><span class="nt">html</span><span class="o">></span>
<span class="o"><</span><span class="nt">head</span><span class="o">></span>
	<span class="o"><</span><span class="nt">meta</span> <span class="nt">charset</span><span class="o">=</span><span class="s2">"utf-8"</span> <span class="o">/></span>
	<span class="o"><</span><span class="nt">style</span><span class="o">></span>
		<span class="nt">div</span> <span class="p">{</span> <span class="k">width</span><span class="o">:</span><span class="m">100px</span><span class="p">;</span> <span class="k">height</span><span class="o">:</span><span class="m">100px</span><span class="p">;</span> <span class="o">-</span><span class="n">webkit</span><span class="o">-</span><span class="n">transform</span><span class="o">:</span><span class="n">rotate</span><span class="p">(</span><span class="m">90</span><span class="n">deg</span><span class="p">);}</span>
		<span class="nt">div</span><span class="nd">:before</span> <span class="p">{</span><span class="k">content</span><span class="o">:</span><span class="s2">""</span><span class="p">;</span> <span class="k">display</span><span class="o">:</span><span class="k">block</span><span class="p">;</span> <span class="k">width</span><span class="o">:</span><span class="m">100px</span><span class="p">;</span><span class="k">height</span><span class="o">:</span><span class="m">50px</span><span class="p">;</span> <span class="k">margin-top</span><span class="o">:</span><span class="m">10px</span><span class="p">;</span> <span class="k">padding</span><span class="o">:</span><span class="m">10px</span><span class="p">;</span> <span class="k">padding-bottom</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="n">box</span><span class="o">-</span><span class="n">sizing</span><span class="o">:</span><span class="k">border</span><span class="o">-</span><span class="n">box</span><span class="p">;</span>
			<span class="k">border-top</span><span class="o">-</span><span class="k">left</span><span class="o">-</span><span class="n">radius</span><span class="o">:</span><span class="m">50px</span><span class="p">;</span>
			<span class="k">border-top</span><span class="o">-</span><span class="k">right</span><span class="o">-</span><span class="n">radius</span><span class="o">:</span><span class="m">50px</span><span class="p">;</span>
			<span class="k">background</span><span class="o">:-</span><span class="n">webkit</span><span class="o">-</span><span class="n">gradient</span><span class="p">(</span>
				<span class="n">linear</span><span class="o">,</span>
				<span class="k">left</span> <span class="k">top</span><span class="o">,</span>
				<span class="k">right</span> <span class="k">top</span><span class="o">,</span>
				<span class="k">color</span><span class="o">-</span><span class="n">stop</span><span class="p">(</span><span class="m">0</span><span class="o">,</span><span class="m">#fff</span><span class="p">)</span><span class="o">,</span>
				<span class="k">color</span><span class="o">-</span><span class="n">stop</span><span class="p">(</span><span class="m">1</span><span class="o">,</span><span class="m">#fff</span><span class="p">)</span>
			<span class="p">)</span><span class="o">,-</span><span class="n">webkit</span><span class="o">-</span><span class="n">gradient</span><span class="p">(</span>
				<span class="n">linear</span><span class="o">,</span>
				<span class="k">left</span> <span class="k">top</span><span class="o">,</span>
				<span class="k">right</span> <span class="k">top</span><span class="o">,</span>
				<span class="k">color</span><span class="o">-</span><span class="n">stop</span><span class="p">(</span><span class="m">0</span><span class="o">,</span><span class="m">#077df8</span><span class="p">)</span><span class="o">,</span>
				<span class="k">color</span><span class="o">-</span><span class="n">stop</span><span class="p">(</span><span class="m">1</span><span class="o">,</span><span class="m">#74baff</span><span class="p">)</span>
			<span class="p">);</span>
			<span class="k">background</span><span class="o">-</span><span class="k">clip</span><span class="o">:</span><span class="k">content</span><span class="o">-</span><span class="n">box</span><span class="o">,</span><span class="k">padding</span><span class="o">-</span><span class="n">box</span><span class="p">;</span>
		<span class="p">}</span>
		<span class="nt">div</span><span class="nd">:after</span> <span class="p">{</span><span class="k">content</span><span class="o">:</span><span class="s2">""</span><span class="p">;</span> <span class="k">display</span><span class="o">:</span><span class="k">block</span><span class="p">;</span> <span class="k">width</span><span class="o">:</span><span class="m">100px</span><span class="p">;</span><span class="k">height</span><span class="o">:</span><span class="m">50px</span><span class="p">;</span> <span class="k">padding</span><span class="o">:</span><span class="m">10px</span><span class="p">;</span> <span class="k">padding-top</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="n">box</span><span class="o">-</span><span class="n">sizing</span><span class="o">:</span><span class="k">border</span><span class="o">-</span><span class="n">box</span><span class="p">;</span>
			<span class="k">border-bottom</span><span class="o">-</span><span class="k">left</span><span class="o">-</span><span class="n">radius</span><span class="o">:</span><span class="m">50px</span><span class="p">;</span>
			<span class="k">border-bottom</span><span class="o">-</span><span class="k">right</span><span class="o">-</span><span class="n">radius</span><span class="o">:</span><span class="m">50px</span><span class="p">;</span>
			<span class="k">background</span><span class="o">:-</span><span class="n">webkit</span><span class="o">-</span><span class="n">gradient</span><span class="p">(</span>
				<span class="n">linear</span><span class="o">,</span>
				<span class="k">left</span> <span class="k">top</span><span class="o">,</span>
				<span class="k">right</span> <span class="k">top</span><span class="o">,</span>
				<span class="k">color</span><span class="o">-</span><span class="n">stop</span><span class="p">(</span><span class="m">0</span><span class="o">,</span><span class="m">#fff</span><span class="p">)</span><span class="o">,</span>
				<span class="k">color</span><span class="o">-</span><span class="n">stop</span><span class="p">(</span><span class="m">1</span><span class="o">,</span><span class="m">#fff</span><span class="p">)</span>
			<span class="p">)</span><span class="o">,-</span><span class="n">webkit</span><span class="o">-</span><span class="n">gradient</span><span class="p">(</span>
				<span class="n">linear</span><span class="o">,</span>
				<span class="k">left</span> <span class="k">top</span><span class="o">,</span>
				<span class="k">right</span> <span class="k">top</span><span class="o">,</span>
				<span class="k">color</span><span class="o">-</span><span class="n">stop</span><span class="p">(</span><span class="m">0</span><span class="o">,</span><span class="m">#fff</span><span class="p">)</span><span class="o">,</span>
				<span class="k">color</span><span class="o">-</span><span class="n">stop</span><span class="p">(</span><span class="m">1</span><span class="o">,</span><span class="m">#74baff</span><span class="p">)</span>
			<span class="p">);</span>
			<span class="k">background</span><span class="o">-</span><span class="k">clip</span><span class="o">:</span><span class="k">content</span><span class="o">-</span><span class="n">box</span><span class="o">,</span><span class="k">padding</span><span class="o">-</span><span class="n">box</span><span class="p">;</span>
		<span class="p">}</span>
	<span class="o"></</span><span class="nt">style</span><span class="o">></span>
<span class="o"></</span><span class="nt">head</span><span class="o">></span>
<span class="o"><</span><span class="nt">body</span><span class="o">></span>
	<span class="o"><</span><span class="nt">div</span><span class="o">></</span><span class="nt">div</span><span class="o">></span>
<span class="o"></</span><span class="nt">body</span><span class="o">></span>
<span class="o"></</span><span class="nt">html</span><span class="o">></span>
</code>
登录后复制
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板