<?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>MEMOBALL.info &#187; HTML</title>
	<atom:link href="http://www.memoball.info/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.memoball.info</link>
	<description>All of my Memories</description>
	<lastBuildDate>Thu, 22 Jul 2010 06:17:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>การใช้ div สร้าง round-corner แบบ dynmic</title>
		<link>http://www.memoball.info/04/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-div-%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-round-corner-%e0%b9%81%e0%b8%9a%e0%b8%9a-dynmic/</link>
		<comments>http://www.memoball.info/04/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-div-%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-round-corner-%e0%b9%81%e0%b8%9a%e0%b8%9a-dynmic/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 15:01:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Round corner]]></category>

		<guid isPermaLink="false">http://memoball.nabzer.com/?p=194</guid>
		<description><![CDATA[ุวันนี้เราจะพูดกันถึงเรื่องการสร้าง round-corner ซึ่งก้คือการทำให้มุมของกล่องของเราแสดงเป็นรูปแบบโค้ง ซึ่งนิยมใช้กันกันการออกแบบเวปปัจจุับัน ซึ่งในที่นี้จะกล่าวถึงวิธีทำแบบใช้ div  ซึ่งจากที่ผมได้ลองค้นหาดูแล้วก็พบว่า ส่วนใหญ่ที่ทำการสอนกันนั้นจะ static คือแบบที่ไม่สามารถยึดหดกล่องได้แบบอิสระ เพราะการกำหนดรูปของกล่องอย่างตายตัว หรือใช้ css ของ mozilla ซึ่งจะใช้ได้เพียงบางบราวเซอร์เท่านั้น โดยสุดท้ายได้ทำการออกแบบเป็นโค้ดดังต่อไปนี้

จาก WikiBall


			
หลังจากค้นหาข้อมูลอยู่หลายครั้งในการทำ round-corner ให้กับเวปไซต์ ส่วนมาก round corner ที่ใช้กันจะเป็นแบบ static คือกำหนดความยาวรูป และกล่องมาเลย ทำให้ไม่ยืดหยุ่นในการใช้งาน แต่ถ้าเป็นแบบ dynamic ที่สามารถยืดหดกล่องได้และทำโดยใช้ div และ css จะทำได้ยากมากเพราะติดปัญหาเรื่อง cross browser โดยเฉพาะการแสดงผลใน MSIE จะมีปัญหามาก เนื่องจากไม่ค่อยแสดงผลตามแบบ w3c สักเท่าไหร่ และโดยเฉพาะเจ้า MSIE6 มีปัญหา bug ที่เกี่ยวกับ css มากอยู่พอสมควร เช่น ปัญหา [3px-jog] ซึ่งทำให้การออกแบบบางลักษณะไม่ได้





เนื้อหา


1 [...]]]></description>
			<content:encoded><![CDATA[<p>ุวันนี้เราจะพูดกันถึงเรื่องการสร้าง round-corner ซึ่งก้คือการทำให้มุมของกล่องของเราแสดงเป็นรูปแบบโค้ง ซึ่งนิยมใช้กันกันการออกแบบเวปปัจจุับัน ซึ่งในที่นี้จะกล่าวถึงวิธีทำแบบใช้ div  ซึ่งจากที่ผมได้ลองค้นหาดูแล้วก็พบว่า ส่วนใหญ่ที่ทำการสอนกันนั้นจะ static คือแบบที่ไม่สามารถยึดหดกล่องได้แบบอิสระ เพราะการกำหนดรูปของกล่องอย่างตายตัว หรือใช้ css ของ mozilla ซึ่งจะใช้ได้เพียงบางบราวเซอร์เท่านั้น โดยสุดท้ายได้ทำการออกแบบเป็นโค้ดดังต่อไปนี้<span id="more-194"></span></p>
<div id="bodyContent">
<h3 id="siteSub"><a href="http://wiki.memoball.info/index.php/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89_div_%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87_round-corner">จาก WikiBall</a></h3>
<div id="contentSub"></div>
<div id="jump-to-nav"></div>
<p>			<!-- start content --></p>
<p>หลังจากค้นหาข้อมูลอยู่หลายครั้งในการทำ round-corner ให้กับเวปไซต์ ส่วนมาก round corner ที่ใช้กันจะเป็นแบบ static คือกำหนดความยาวรูป และกล่องมาเลย ทำให้ไม่ยืดหยุ่นในการใช้งาน แต่ถ้าเป็นแบบ dynamic ที่สามารถยืดหดกล่องได้และทำโดยใช้ div และ css จะทำได้ยากมากเพราะติดปัญหาเรื่อง cross browser โดยเฉพาะการแสดงผลใน MSIE จะมีปัญหามาก เนื่องจากไม่ค่อยแสดงผลตามแบบ w3c สักเท่าไหร่ และโดยเฉพาะเจ้า MSIE6 มีปัญหา bug ที่เกี่ยวกับ css มากอยู่พอสมควร เช่น ปัญหา [<a href="http://www.positioniseverything.net/explorer/threepxtest.html" class="external text" title="http://www.positioniseverything.net/explorer/threepxtest.html" rel="nofollow">3px-jog</a>] ซึ่งทำให้การออกแบบบางลักษณะไม่ได้
</p>
<table id="toc" class="toc" summary="เนื้อหา">
<tr>
<td>
<div id="toctitle">
<h2>เนื้อหา</h2>
</div>
<ul>
<li class="toclevel-1"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89_css_.E0.B8.82.E0.B8.AD.E0.B8.87_Mozzilla" ref="toc"><span class="tocnumber">1</span> <span class="toctext">การใช้ css ของ Mozzilla</span></a></li>
<li class="toclevel-1"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89_DIV.2BCSS" ref="toc"><span class="tocnumber">2</span> <span class="toctext">การใช้ DIV+CSS</span></a>
<ul>
<li class="toclevel-2"><a href="./#HTML" ref="toc"><span class="tocnumber">2.1</span> <span class="toctext">HTML</span></a></li>
<li class="toclevel-2"><a href="./#CSS" ref="toc"><span class="tocnumber">2.2</span> <span class="toctext">CSS</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89_css_.E0.B8.82.E0.B8.AD.E0.B8.87_Mozzilla_2" ref="toc"><span class="tocnumber">3</span> <span class="toctext">การใช้ css ของ Mozzilla</span></a></li>
</ul>
</td>
</tr>
</table>
<p><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "แสดง"; var tocHideText = "ซ่อน"; showTocToggle(); } </script><br />
<a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89_css_.E0.B8.82.E0.B8.AD.E0.B8.87_Mozzilla" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> การใช้ css ของ Mozzilla </span></h2>
<ul>
<li> <b>-moz-border-radius-bottomleft</b> sets the rounding for the bottom-left curve.
</li>
<li> <b>-moz-border-radius-bottomright</b> sets the rounding for the bottom-right curve.
</li>
<li> <b>-moz-border-radius-topleft</b> sets the rounding for the top-left curve.
</li>
<li> <b>-moz-border-radius-topright</b> sets the rounding for the top-right curve.
</li>
</ul>
<p><i>ข้อดีคือ</i>
</p>
<ul>
<li> ทำง่าย
</li>
<li> ใช้ bandwidth และ connection น้อย
</li>
</ul>
<p><i>ข้อเสีย</i>
</p>
<ul>
<li> ใช้ได้ไม่ครบทุก browser แน่นอนว่า MSIE ใช้ไม่ได้แน่นอน
</li>
</ul>
<p><a href="https://developer.mozilla.org/en/CSS/-moz-border-radius" class="external free" title="https://developer.mozilla.org/en/CSS/-moz-border-radius" rel="nofollow">https://developer.mozilla.org/en/CSS/-moz-border-radius</a>
</p>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89_DIV.2BCSS" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> การใช้ DIV+CSS </span></h2>
<p><a name="HTML" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> HTML </span></h3>
<pre name="code" class="html">
&lt;div id=&quot;box&quot;&gt;
  &lt;div class=&quot;border-top&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;border-topleft&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;border-topright&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;border-left&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;border-right&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;border-bottom&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;border-bottomleft&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;border-bottomright&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;content&quot;&gt;
    /* Type your content */
  &lt;/div&gt;
&lt;/div&gt;
</pre>
<p><a name="CSS" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> CSS </span></h3>
<pre>
@charset &quot;utf-8&quot;;
/* CSS Document */

#box {
	position: relative;
	/* Replace the border image size here */
	margin: 12px 12px 12px 12px;
	/*
	 * Don't use padding here because IE6 is render incorrectly
	 * Padding shoud be in &quot;.content&quot;
	 */
}

#box .content {
	padding: 4px;
}

.border-top,
.border-bottom,
.border-topleft,
.border-left,
.border-bottomleft,
.border-topright,
.border-right,
.border-bottomright {
	position: absolute;
}

.border-top,
.border-bottom {
	left: 0px;
}

.border-topleft,
.border-left,
.border-bottomleft {
	left: -12px;
	width: 12px;
}

.border-topright,
.border-right,
.border-bottomright {
	right: -12px;
	width:  12px;
}
.border-top,
.border-topleft,
.border-topright {
	top:   -12px;
	height: 12px;
}

.border-bottom,
.border-bottomleft,
.border-bottomright {
	bottom: -12px;
	height:  12px;
}

.border-top, .border-bottom {
	width: 100%;
}
.border-left, .border-right {
	top: 0px;
	bottom: 0px;
	height: 100%;
	/* IE6 fix the 100% bug */
	_height: expression(eval(this.parentNode.clientHeight) + &quot;px&quot;);
}

/* replace the border images link here */
.border-top         { background: URL(../images/greenHorizontal.gif) repeat-x top; }
.border-topleft     { background: URL(../images/greenCorner.gif) no-repeat left top; }
.border-topright    { background: URL(../images/greenCorner.gif) no-repeat right top; }
.border-left        { background: URL(../images/greenVertical.gif) repeat-y left; }
.border-right       { background: URL(../images/greenVertical.gif) repeat-y right; }
.border-bottom      { background: URL(../images/greenHorizontal.gif) repeat-x bottom; }
.border-bottomleft  { background: URL(../images/greenCorner.gif) no-repeat left bottom; }
.border-bottomright { background: URL(../images/greenCorner.gif) no-repeat right bottom; }
</pre>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89_css_.E0.B8.82.E0.B8.AD.E0.B8.87_Mozzilla_2" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> การใช้ css ของ Mozzilla </span></h2>
<ul>
<li> <b>-moz-border-radius-bottomleft</b> sets the rounding for the bottom-left curve.
</li>
<li> <b>-moz-border-radius-bottomright</b> sets the rounding for the bottom-right curve.
</li>
<li> <b>-moz-border-radius-topleft</b> sets the rounding for the top-left curve.
</li>
<li> <b>-moz-border-radius-topright</b> sets the rounding for the top-right curve.
</li>
</ul>
<p><i>ข้อดีคือ</i>
</p>
<ul>
<li> ใช้ได้ทุก browser
</li>
</ul>
<p><i>ข้อเสีย</i>
</p>
<ul>
<li> เขียน css ยุ่งยาก
</li>
<li> ต้องเปิด connection เพื่อโหลดรูปเพิ่มอีก 3 รูป
</li>
</ul>
<p><!--<br />
NewPP limit report<br />
Preprocessor node count: 12/1000000<br />
Post-expand include size: 0/2097152 bytes<br />
Template argument size: 0/2097152 bytes<br />
Expensive parser function count: 0/100<br />
--></p>
<p><!-- Saved in parser cache with key memoball_wiki:pcache:idhash:25-0!1!0!!th!2!edit=0 and timestamp 20090825115814 --></p>
<div class="printfooter">
<h5>รับข้อมูลจาก (Reference) : </h5>
<p>จาก WikiBall : <a href="http://wiki.memoball.info/index.php/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89_div_%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87_round-corner">http://wiki.memoball.info/index.php/การใช้_div_สร้าง_round-corner</a></div>
<div id='catlinks' class='catlinks'>
<div id="mw-normal-catlinks"><a href="http://wiki.memoball.info//index.php/%E0%B8%9E%E0%B8%B4%E0%B9%80%E0%B8%A8%E0%B8%A9:Categories" title="พิเศษ:Categories">หมวดหมู่</a>:&#32;<span dir='ltr'><a href="http://wiki.memoball.info//index.php?title=%E0%B8%AB%E0%B8%A1%E0%B8%A7%E0%B8%94%E0%B8%AB%E0%B8%A1%E0%B8%B9%E0%B9%88:CSS&amp;action=edit&amp;redlink=1" class="new" title="หมวดหมู่:CSS (ยังไม่ได้สร้าง)">CSS</a></span> | <span dir='ltr'><a href="http://wiki.memoball.info//index.php?title=%E0%B8%AB%E0%B8%A1%E0%B8%A7%E0%B8%94%E0%B8%AB%E0%B8%A1%E0%B8%B9%E0%B9%88:HTML&amp;action=edit&amp;redlink=1" class="new" title="หมวดหมู่:HTML (ยังไม่ได้สร้าง)">HTML</a></span></div>
</div>
<p>			<!-- end content --></p>
<div class="visualClear"></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.memoball.info/04/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-div-%e0%b8%aa%e0%b8%a3%e0%b9%89%e0%b8%b2%e0%b8%87-round-corner-%e0%b9%81%e0%b8%9a%e0%b8%9a-dynmic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
