<?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>ls /proc &#187; WebDesign</title>
	<atom:link href="http://www.lsproc.com/blog/category/webdesign/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lsproc.com/blog</link>
	<description>lsproc.com</description>
	<lastBuildDate>Fri, 21 May 2010 14:29:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Js控制输入字符数限制</title>
		<link>http://www.lsproc.com/blog/limit_textarea_length_by_js/</link>
		<comments>http://www.lsproc.com/blog/limit_textarea_length_by_js/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 06:20:47 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[WebDesign]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.lostk.com/blog/limit_textarea_length_by_js/</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/limit_textarea_length_by_js/
From: http://www.phpcake.cn/archives/26/

&#60;script type=&#34;text/javascript&#34;&#62;
function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute(&#34;maxlength&#34;)) : &#34;&#34;
if (obj.getAttribute &#38;&#38; obj.value.length&#62;mlength)
obj.value=obj.value.substring(0,mlength)
}
&#60;/script&#62; 

&#60;textarea maxlength=&#34;10&#34; onkeyup=&#34;return ismaxlength(this)&#34;&#62;&#60;/textarea&#62;
-- EOF --
Related Posts2010-04-13 -- 复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; flash10 (2)2009-01-08 -- Ajax 提交数据加号与连接符丢失 (0)2008-01-12 -- 自动等比例缩放网页中的图片 (0)]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/limit_textarea_length_by_js/">http://www.lsproc.com/blog/limit_textarea_length_by_js/</a></p>
<p>From: http://www.phpcake.cn/archives/26/</p>
<pre class="brush: javascript">
&lt;script type=&quot;text/javascript&quot;&gt;
function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute(&quot;maxlength&quot;)) : &quot;&quot;
if (obj.getAttribute &amp;&amp; obj.value.length&gt;mlength)
obj.value=obj.value.substring(0,mlength)
}
&lt;/script&gt; 

&lt;textarea maxlength=&quot;10&quot; onkeyup=&quot;return ismaxlength(this)&quot;&gt;&lt;/textarea&gt;</pre>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2010-04-13 -- <a href="http://www.lsproc.com/blog/copy_to_clipboard/" title="复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; flash10">复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; flash10</a> (2)</li><li>2009-01-08 -- <a href="http://www.lsproc.com/blog/ajax_char_lose/" title="Ajax 提交数据加号与连接符丢失">Ajax 提交数据加号与连接符丢失</a> (0)</li><li>2008-01-12 -- <a href="http://www.lsproc.com/blog/auto_resize_images/" title="自动等比例缩放网页中的图片">自动等比例缩放网页中的图片</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/limit_textarea_length_by_js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自动等比例缩放网页中的图片</title>
		<link>http://www.lsproc.com/blog/auto_resize_images/</link>
		<comments>http://www.lsproc.com/blog/auto_resize_images/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 07:34:14 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[WebDesign]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[网页设计]]></category>

		<guid isPermaLink="false">http://www.lostk.com/blog/auto_resize_images/</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/auto_resize_images/
resizeimg.js

window.onload = function() {

    for (var index = 0; index &#60; document.images.length; index++) {

        var widthRestriction = 400;
        var heightRestriction = 400;
        var rate = document.images[index].width / document.images[index].height;

  [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/auto_resize_images/">http://www.lsproc.com/blog/auto_resize_images/</a></p>
<p>resizeimg.js</p>
<pre class="brush: javascript">
window.onload = function() {

    for (var index = 0; index &lt; document.images.length; index++) {

        var widthRestriction = 400;
        var heightRestriction = 400;
        var rate = document.images[index].width / document.images[index].height;

        if (document.images[index].width &gt; widthRestriction) {
            document.images[index].width = widthRestriction;
            document.images[index].height = widthRestriction / rate;
        } else if (document.images[index].height &gt; heightRestriction) {
            document.images[index].height = heightRestriction;
            document.images[index].width = heightRestriction * rate;
        }

        document.images[index].onclick = function() {window.open(this.src)};
        document.images[index].title = document.images[index].title + &#039; 点击在新窗口中查看原图&#039;;
    }
}
</pre>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2010-04-13 -- <a href="http://www.lsproc.com/blog/copy_to_clipboard/" title="复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; flash10">复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; flash10</a> (2)</li><li>2009-01-08 -- <a href="http://www.lsproc.com/blog/ajax_char_lose/" title="Ajax 提交数据加号与连接符丢失">Ajax 提交数据加号与连接符丢失</a> (0)</li><li>2008-01-23 -- <a href="http://www.lsproc.com/blog/limit_textarea_length_by_js/" title="Js控制输入字符数限制">Js控制输入字符数限制</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/auto_resize_images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于定义a:visited后a:hover不起作用</title>
		<link>http://www.lsproc.com/blog/anchor_pseudo_classes/</link>
		<comments>http://www.lsproc.com/blog/anchor_pseudo_classes/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 07:04:00 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[WebDesign]]></category>
		<category><![CDATA[a:hover]]></category>
		<category><![CDATA[a:visited]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.lostk.com/blog/webdesign/anchor_pseudo_classes/</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/anchor_pseudo_classes/
在CSS中，定义了被访问过的链接的颜色（a:visited），结果当链接被访问过后，该链接的颜色不再改变，即定义鼠标在超级链接上的颜色（a:hover）不起作用了。我找到这里：
锚点伪类 Anchor Pseudo-classes
A link that is active, visited, unvisited, or when you mouse over a link can all be displayed in different ways in a CSS-supporting browser:
当一个连接处于 活动，被访问，未访问或是当你鼠标移动到上面的时候都可以给它以不同的方式来表现，前提是浏览器支持CSS:
a:link {color: #FF0000}     /* unvisited link */
a:visited {color: #00FF00}  /* visited link */
a:hover {color: #FF00FF}   /* mouse over link [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/anchor_pseudo_classes/">http://www.lsproc.com/blog/anchor_pseudo_classes/</a></p>
<p>在CSS中，定义了被访问过的链接的颜色（a:visited），结果当链接被访问过后，该链接的颜色不再改变，即定义鼠标在超级链接上的颜色（a:hover）不起作用了。我找到<a href="http://www.52css.com/article.asp?id=53">这里</a>：</p>
<p>锚点伪类 Anchor Pseudo-classes<br />
A link that is active, visited, unvisited, or when you mouse over a link can all be displayed in different ways in a CSS-supporting browser:<br />
当一个连接处于 活动，被访问，未访问或是当你鼠标移动到上面的时候都可以给它以不同的方式来表现，前提是浏览器支持CSS:</p>
<pre class="brush: css">a:link {color: #FF0000}     /* unvisited link */
a:visited {color: #00FF00}  /* visited link */
a:hover {color: #FF00FF}   /* mouse over link */
a:active {color: #0000FF}   /* selected link */</pre>
<p>Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective!!<br />
<strong>注意 a:hover 必须在a:link和 a:visited后出现，要有顺序才能正常显示效果！</strong></p>
<p>Note: a:active MUST come after a:hover in the CSS definition in order to be effective!!<br />
<strong>注意： CSS中a:active必须出现在a:hover定义后才能有效果！</strong></p>
<p>无意之间发现的问题，对 css 还是缺乏了解。
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2006-10-23 -- <a href="http://www.lsproc.com/blog/css-shorthand-guide/" title="css简写用法说明">css简写用法说明</a> (0)</li><li>2006-03-01 -- <a href="http://www.lsproc.com/blog/web-design-tips/" title="Web设计札记">Web设计札记</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/anchor_pseudo_classes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTML or XHTML, 关于web标准</title>
		<link>http://www.lsproc.com/blog/html_or_xhtml/</link>
		<comments>http://www.lsproc.com/blog/html_or_xhtml/#comments</comments>
		<pubDate>Sun, 13 May 2007 14:53:18 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[WebDesign]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web标准]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.lostk.com/blog/webdesign/html_or_xhtml/</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/html_or_xhtml/
results of HTML 5 text, editor, name questions,
HTML5 is now also hosted by the W3C,
W3C XHTML 2.0 与 WHATWG HTML 5 的比较,
The next-generation HTML, HTML新变数, JJgod
old9 Says:
唉……说什么好呢……XHTML初衷倒是好的，不过用在WEB上太牵强。
对照现在对HTML5的宣传，回过头看看以前标准推广时关于XHTML的论调是有些怪怪的，但我感觉XHTML还是HTML并不是WEB标准的重点（可能更多是三方分离？），况且XHTML和HTML之间的争论，从WEB标准推广一开始就没有停止过，HTML4的支持者也有不少，只是可能XHTML 的鼓吹者更多一点罢了（也许有商业因素？不清楚）。再加上普通开发者对这些新东西也没有什么辨识力，业界领袖都说XHTML，那就XHTML喽，还在用 HTML？落伍啦！这些其实都是导致现在对XHTML盲目崇拜的原因，新技术总是会有盲目崇拜者的，这不，众多业界大牛开始挺HTML5，于是就都 HTML5了……
其实我觉得轰轰烈烈的标准化运动带给我们WEB开发者的，倒不是HTML还是XHTML还是HTML5的问题，重要的还是一个宝贵的改变过程。在这个过程中至少我们对HTML，对CSS，对JavaScript都有了前所未有的重视——我们开始考虑结构表现分离，开始斟酌HTML语义，开始研究 CSS管理，开始重新审视JavaScript，开始深入可访问性和用户体验……总之是对WEB前端心里有了底，不再是隐藏在DW，PS那些所见即所得软件外表下不忍卒读的混乱代码和copy/paste来的JS特效。而至于最终是XHTML还是HTML5还是别的什么，都已经不那么重要了。
唉，一家之言，不知道jjgod是不是对WEB标准本身失去了信心，希望不是吧，毕竟你也是国内的领跑者哇，呵呵。如果只是对宣传手段不齿，那就是我多虑了……
jjgod Says: 
我主要的意思是，标准这种东西，朝令夕改真是很糟糕的，以前尽管我自己对这几个问题也有过思考，但主要还是跟着国外的思路走，很多“fancy words”自己也不想想就抄下来了，这是不对的，改个名字，目的不是要批评谁，而是希望多写点原创的东西、实用的东西，也就是说“advocacy”不再是重点，在我自己观点不成熟的时候。
你说的没错，从提招聘 Web 设计师就必须掌握 Dreamweaver 到终于开始关注 Accessibility、Usablity，这是很大的进步，但目前国内跟风的事情还是做了不少，也许是时候考虑一下，不要老外说风就是雨，我们有很多出色的设计师，相信以后的路能走得更好。
-- EOF --
Related Posts2006-03-01 -- 使用DIV之后,什么时候使用TABLE? (1)2010-04-13 -- 复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/html_or_xhtml/">http://www.lsproc.com/blog/html_or_xhtml/</a></p>
<p><a href="http://lists.w3.org/Archives/Public/public-html/2007May/0909.html#start909">results of HTML 5 text, editor, name questions</a>,<br />
<a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2007-May/011228.html">HTML5 is now also hosted by the W3C</a>,<br />
<a href="http://www.jluvip.com/blog/article.asp?id=352">W3C XHTML 2.0 与 WHATWG HTML 5 的比较</a>,<br />
<a href="http://www.junchenwu.com/2007/05/the_next_generation_html.html">The next-generation HTML</a>, <a href="http://realazy.org/blog/2007/05/04/browsers-will-treat-all-versions-of-html-as-html5/">HTML新变数</a>, <a href="http://blog.jjgod.org/2007/05/04/changing-the-title/">JJgod</a></p>
<p><a href="http://old9.blogsome.com/">old9</a> Says:</p>
<blockquote><p>唉……说什么好呢……XHTML初衷倒是好的，不过用在WEB上太牵强。</p>
<p>对照现在对HTML5的宣传，回过头看看以前标准推广时关于XHTML的论调是有些怪怪的，但我感觉XHTML还是HTML并不是WEB标准的重点（可能更多是三方分离？），况且XHTML和HTML之间的争论，从WEB标准推广一开始就没有停止过，HTML4的支持者也有不少，只是可能XHTML 的鼓吹者更多一点罢了（也许有商业因素？不清楚）。再加上普通开发者对这些新东西也没有什么辨识力，业界领袖都说XHTML，那就XHTML喽，还在用 HTML？落伍啦！这些其实都是导致现在对XHTML盲目崇拜的原因，新技术总是会有盲目崇拜者的，这不，众多业界大牛开始挺HTML5，于是就都 HTML5了……</p>
<p>其实我觉得轰轰烈烈的标准化运动带给我们WEB开发者的，倒不是HTML还是XHTML还是HTML5的问题，重要的还是一个宝贵的改变过程。在这个过程中至少我们对HTML，对CSS，对JavaScript都有了前所未有的重视——我们开始考虑结构表现分离，开始斟酌HTML语义，开始研究 CSS管理，开始重新审视JavaScript，开始深入可访问性和用户体验……总之是对WEB前端心里有了底，不再是隐藏在DW，PS那些所见即所得软件外表下不忍卒读的混乱代码和copy/paste来的JS特效。而至于最终是XHTML还是HTML5还是别的什么，都已经不那么重要了。</p>
<p>唉，一家之言，不知道jjgod是不是对WEB标准本身失去了信心，希望不是吧，毕竟你也是国内的领跑者哇，呵呵。如果只是对宣传手段不齿，那就是我多虑了……</p></blockquote>
<p><a href="http://jjgod.3322.org/">jjgod</a> Says: </p>
<blockquote><p>我主要的意思是，标准这种东西，朝令夕改真是很糟糕的，以前尽管我自己对这几个问题也有过思考，但主要还是跟着国外的思路走，很多“fancy words”自己也不想想就抄下来了，这是不对的，改个名字，目的不是要批评谁，而是希望多写点原创的东西、实用的东西，也就是说“advocacy”不再是重点，在我自己观点不成熟的时候。</p>
<p>你说的没错，从提招聘 Web 设计师就必须掌握 Dreamweaver 到终于开始关注 Accessibility、Usablity，这是很大的进步，但目前国内跟风的事情还是做了不少，也许是时候考虑一下，不要老外说风就是雨，我们有很多出色的设计师，相信以后的路能走得更好。</p></blockquote>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2006-03-01 -- <a href="http://www.lsproc.com/blog/div-and-table-tags/" title="使用DIV之后,什么时候使用TABLE?">使用DIV之后,什么时候使用TABLE?</a> (1)</li><li>2010-04-13 -- <a href="http://www.lsproc.com/blog/copy_to_clipboard/" title="复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; flash10">复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; flash10</a> (2)</li><li>2007-06-25 -- <a href="http://www.lsproc.com/blog/draw_by_html_table/" title="用 HTML 表格绘画 （强人）">用 HTML 表格绘画 （强人）</a> (0)</li><li>2006-03-01 -- <a href="http://www.lsproc.com/blog/web-design-tips/" title="Web设计札记">Web设计札记</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/html_or_xhtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>css简写用法说明</title>
		<link>http://www.lsproc.com/blog/css-shorthand-guide/</link>
		<comments>http://www.lsproc.com/blog/css-shorthand-guide/#comments</comments>
		<pubDate>Mon, 23 Oct 2006 01:51:28 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[WebDesign]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.lostk.com/blog/words/css-shorthand-guide/</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/css-shorthand-guide/
转自：http://my.donews.com/htmlor/2006/10/16/css_shorthand_guide/
font
简写：
font:italic small-caps bold 12px/1.5em arial,verdana;
等效于：
font-style:italic;
font-variant:small-caps;
font-weight:bold;
font-size:12px;
line-height:1.5em;
font-family:arial,verdana;
顺序：font-style &#124; font-variant &#124; font-weight &#124; font-size &#124; line-height &#124; font-family
（注：简写时，font-size和line-height只能通过斜杠/组成一个值，不能分开写。）
background
简写：
background:#fff url(bg.gif) no-repeat fixed left top;
等效于：
background-color:#fff;
background-image:url(bg.gif);
background-repeat:no-repeat;
background-attachment:fixed;
background-position:left top;
顺序：background-color &#124; background-image &#124; background-repeat &#124; background-attachment &#124; background-position
margin &#038; padding
简写：
margin:1px 0 2em -20px;
等效于：
margin-top:1px;
margin-right:0;
margin-bottom:2em;
margin-left:-20px;
顺序：margin-top &#124; margin-right &#124; margin-bottom &#124; margin-left
padding的简写和margin完全一样。
border
简写：
border:1px solid #000;
等效于：
border-width:1px;
border-style:solid;
border-color:#000;
顺序：border-width &#124; border-style &#124; border-color
这三句也是简写，等于是把四边的样式合而为一了。（关于四边的问题，下文有详细说明）
border-top / border-right / border-bottom / border-left
简写：

border-top:1px solid [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/css-shorthand-guide/">http://www.lsproc.com/blog/css-shorthand-guide/</a></p>
<p>转自：<a href="http://my.donews.com/htmlor/2006/10/16/css_shorthand_guide/">http://my.donews.com/htmlor/2006/10/16/css_shorthand_guide/</a></p>
<p><strong>font</strong></p>
<p>简写：</p>
<pre class="brush: css">font:italic small-caps bold 12px/1.5em arial,verdana;</pre>
<p>等效于：</p>
<pre class="brush: css">font-style:italic;
font-variant:small-caps;
font-weight:bold;
font-size:12px;
line-height:1.5em;
font-family:arial,verdana;</pre>
<p>顺序：font-style | font-variant | font-weight | font-size | line-height | font-family</p>
<p>（注：简写时，font-size和line-height只能通过斜杠/组成一个值，不能分开写。）</p>
<p><strong>background</strong></p>
<p>简写：</p>
<pre class="brush: css">background:#fff url(bg.gif) no-repeat fixed left top;</pre>
<p>等效于：</p>
<pre class="brush: css">background-color:#fff;
background-image:url(bg.gif);
background-repeat:no-repeat;
background-attachment:fixed;
background-position:left top;</pre>
<p>顺序：background-color | background-image | background-repeat | background-attachment | background-position</p>
<p><span id="more-41"></span><strong>margin &#038; padding</strong></p>
<p>简写：</p>
<pre class="brush: css">margin:1px 0 2em -20px;</pre>
<p>等效于：</p>
<pre class="brush: css">margin-top:1px;
margin-right:0;
margin-bottom:2em;
margin-left:-20px;</pre>
<p>顺序：margin-top | margin-right | margin-bottom | margin-left</p>
<p>padding的简写和margin完全一样。</p>
<p><strong>border</strong></p>
<p>简写：</p>
<pre class="brush: css">border:1px solid #000;</pre>
<p>等效于：</p>
<pre class="brush: css">border-width:1px;
border-style:solid;
border-color:#000;</pre>
<p>顺序：border-width | border-style | border-color</p>
<p>这三句也是简写，等于是把四边的样式合而为一了。（关于四边的问题，下文有详细说明）</p>
<p><strong>border-top / border-right / border-bottom / border-left</strong></p>
<p>简写：</p>
<pre class="brush: css">
border-top:1px solid #000;</pre>
<p>等效于：</p>
<pre class="brush: css">border-top-width:1px;
border-top-style:solid;
border-top-color:#000;</pre>
<p>（和border一样）</p>
<p><strong>list-style</strong></p>
<p>简写：</p>
<pre class="brush: css">list-style:square outside url(bullet.gif);</pre>
<p>等效于：</p>
<pre class="brush: css">list-style-type:square;
list-style-position:outside;
list-style-image:url(bullet.gif);</pre>
<p>顺序：list-style-type | list-style-position | list-style-image</p>
<p><strong>关于四边</strong></p>
<p>有很多样式都涉及到了四边的问题，这里统一说明。</p>
<p>四边的简写一般如下：</p>
<pre class="brush: css">padding:1px 2px 3px 4px;</pre>
<p>等效于：</p>
<pre class="brush: css">padding-top:1px;
padding-right:2px;
padding-bottom:3px;
padding-left:4px;</pre>
<p>顺序：top | right | bottom | left</p>
<p>不论是边框宽度，还是边框颜色、边距等，只要css样式涉及四边，顺序通通都是“上右下左”（顺时针方向）。</p>
<p>如果四边的值省略一个，只写三个：</p>
<pre class="brush: css">padding:1px 2px 3px;</pre>
<p>则等效于：</p>
<pre class="brush: css">padding-top:1px;
padding-right:2px;
padding-bottom:3px;
padding-left:2px;</pre>
<p>（省略的“左”值等于“右”）</p>
<p>如果四边的值省略两个：</p>
<pre class="brush: css">padding:1px 2px;</pre>
<p>则等效于：</p>
<pre class="brush: css">padding-top:1px;
padding-right:2px;
padding-bottom:1px;
padding-left:2px;</pre>
<p>（省略的“下”值等于“上”）</p>
<p>如果只有一个值：</p>
<pre class="brush: css">padding:1px;</pre>
<p>则等效于：</p>
<pre class="brush: css">padding-top:1px;
padding-right:1px;
padding-bottom:1px;
padding-left:1px;</pre>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2007-06-05 -- <a href="http://www.lsproc.com/blog/anchor_pseudo_classes/" title="关于定义a:visited后a:hover不起作用">关于定义a:visited后a:hover不起作用</a> (3)</li><li>2006-03-01 -- <a href="http://www.lsproc.com/blog/web-design-tips/" title="Web设计札记">Web设计札记</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/css-shorthand-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>汉字截取的方法</title>
		<link>http://www.lsproc.com/blog/intercept-chinese-char/</link>
		<comments>http://www.lsproc.com/blog/intercept-chinese-char/#comments</comments>
		<pubDate>Wed, 01 Mar 2006 09:55:25 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[WebDesign]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[汉字]]></category>

		<guid isPermaLink="false">http://lost.yi.org/blog/?p=12</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/intercept-chinese-char/
原来有人提出了一个方法：

$len = 19;
$text = &#34;here is the text!&#34;;
echo strlen($text)&#60; =$len ? $text : (substr($text,0,$len).chr(0).&#34;....&#34;);

在 SaBlog 的程序里发现了另一种方法：

function csubstr ($text, $limit) {
    $s = &#039;;
    for($i=0;$i&#60; $limit-3;$i++) {
        $s .= ord($text[$i])&#62;127 ? $text[$i].$text[++$i] : $text[$i];
    }
    [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/intercept-chinese-char/">http://www.lsproc.com/blog/intercept-chinese-char/</a></p>
<p>原来有人提出了一个方法：</p>
<pre class="brush: php">
$len = 19;
$text = &quot;here is the text!&quot;;
echo strlen($text)&lt; =$len ? $text : (substr($text,0,$len).chr(0).&quot;....&quot;);
</pre>
<p>在 SaBlog 的程序里发现了另一种方法：</p>
<pre class="brush: php">
function csubstr ($text, $limit) {
    $s = &#039;;
    for($i=0;$i&lt; $limit-3;$i++) {
        $s .= ord($text[$i])&gt;127 ? $text[$i].$text[++$i] : $text[$i];
    }
    return $s;
}
</pre>
<p>以上仅适用于 gb2312 编码，如果是UTF-8 的话需要把第4行改为</p>
<pre class="brush: php">
$s .= ord($text[$i])&gt;127 ? $text[$i].$text[++$i].$text[++$i] : $text[$i];
</pre>
<p>UTF-8 中的汉字是 3 个字节。
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2007-11-08 -- <a href="http://www.lsproc.com/blog/get_randnum_chinese_string/" title="生成随机汉字字符串 (UTF8)">生成随机汉字字符串 (UTF8)</a> (0)</li><li>2010-05-21 -- <a href="http://www.lsproc.com/blog/nginx_php_pathinfo_securit/" title="Nginx/PHP 文件类型错误解析漏洞：fix_pathinfo">Nginx/PHP 文件类型错误解析漏洞：fix_pathinfo</a> (2)</li><li>2010-04-12 -- <a href="http://www.lsproc.com/blog/nginx_userid_decode/" title="nginx userid 模块客户端 cookie 解码">nginx userid 模块客户端 cookie 解码</a> (0)</li><li>2010-03-08 -- <a href="http://www.lsproc.com/blog/use_ob_flush_on_nginx_fastcgi/" title="nginx+factcgi 下使用 ob_flush">nginx+factcgi 下使用 ob_flush</a> (0)</li><li>2008-06-15 -- <a href="http://www.lsproc.com/blog/lighttpd_phpfastcgi_config/" title="lighttpd + PHP(fastcgi) 配置">lighttpd + PHP(fastcgi) 配置</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/intercept-chinese-char/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>使用DIV之后,什么时候使用TABLE?</title>
		<link>http://www.lsproc.com/blog/div-and-table-tags/</link>
		<comments>http://www.lsproc.com/blog/div-and-table-tags/#comments</comments>
		<pubDate>Wed, 01 Mar 2006 08:58:17 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[WebDesign]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[web标准]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://lost.yi.org/blog/?p=11</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/div-and-table-tags/
关于表格
使用WEB标准之后,并不是说排除表格的使用,表格并不是鸡肋,而正好相反是一道大餐,之所以在很多关于CSS布局的文章中常提到”为什么使用表格排版是不明智的”这句话,可能是大家对他的理解有误,这里注意一点”使用表格排版”是”不明智”的.指的是我们使用了很多年的,用表格来排版是不明智的,表格归根截底是一种显示”数据”的方式,大家可以想象一下EXCEL,表格就是起这个使用的,有的时候信息使用表格显示让我们能清晰易读,所以才使用表格,比如公司员工联系表,产品与型号对应表等.
那么所谓表格大餐呢,其实意见上升到了一个层次,也就是说你如果能像专业市场分析公司那样,灵活使用表格来显示客户数据和调查数据等消息的时候,那才是真正利用了表格的优势.
所以,关于那句使用以久的话,应该改为”使用表格作为网页排版,布局页面元素是不合理的,表格是用来显示数据的”.
关于其它元素
我这里按我的使用经验,把XHTML标准中的一些元素,分为三大类:     
第一类是我称之为辅助布局设计元素:这里我指的是DIV,SPAN等,这类元素的主要功能是用来布局整个页面的,灵活使用这些元素的各种属性,可以让你的页面表现丰富多彩.
第二类我称为结构化元素或叫信息元素:这里指的是TABLE,UL,PRE,CODE类元素是一种信息显示与整理方式,比如TABLE很明显就是用来显示表格信息的,UL是用来显示列化信息的,当需要用表格或列表的时候,用这二种方式来显示是明智的
第三类指的是A,meta这样的,完全是为了实现一些功能,如填上关键字的META keyword,还有做链接的A.

那么正确的符合标准的设计思路是:
使用DIV等布局元素来制作页面的设计布局,定位,色块,图片等
使用TABLE,UL等这样的元素来显示页面中需要展示数据
当然,DIV也起整理数据的作用,使用DIV的ID属性可以很方便的将一个DIV作为一个你名命的数据块

所以使用WEB标准来制作网站,实际是一个信息合理化整合的一个过程,什么地方该用什么元素还是照用不误,别把表格当布局工具就行.
-- EOF --
Related Posts2007-05-13 -- HTML or XHTML, 关于web标准 (0)2010-04-13 -- 复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; flash10 (2)2007-06-25 -- 用 HTML 表格绘画 （强人） (0)]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/div-and-table-tags/">http://www.lsproc.com/blog/div-and-table-tags/</a></p>
<p>关于表格</p>
<p>使用WEB标准之后,并不是说排除表格的使用,表格并不是鸡肋,而正好相反是一道大餐,之所以在很多关于CSS布局的文章中常提到”为什么使用表格排版是不明智的”这句话,可能是大家对他的理解有误,这里注意一点”使用表格排版”是”不明智”的.指的是我们使用了很多年的,用表格来排版是不明智的,表格归根截底是一种显示”数据”的方式,大家可以想象一下EXCEL,表格就是起这个使用的,有的时候信息使用表格显示让我们能清晰易读,所以才使用表格,比如公司员工联系表,产品与型号对应表等.</p>
<p>那么所谓表格大餐呢,其实意见上升到了一个层次,也就是说你如果能像专业市场分析公司那样,灵活使用表格来显示客户数据和调查数据等消息的时候,那才是真正利用了表格的优势.</p>
<p>所以,关于那句使用以久的话,应该改为”使用表格作为网页排版,布局页面元素是不合理的,表格是用来显示数据的”.</p>
<p>关于其它元素</p>
<p>我这里按我的使用经验,把XHTML标准中的一些元素,分为三大类:     </p>
<p>第一类是我称之为辅助布局设计元素:这里我指的是DIV,SPAN等,这类元素的主要功能是用来布局整个页面的,灵活使用这些元素的各种属性,可以让你的页面表现丰富多彩.</p>
<p>第二类我称为结构化元素或叫信息元素:这里指的是TABLE,UL,PRE,CODE类元素是一种信息显示与整理方式,比如TABLE很明显就是用来显示表格信息的,UL是用来显示列化信息的,当需要用表格或列表的时候,用这二种方式来显示是明智的</p>
<p>第三类指的是A,meta这样的,完全是为了实现一些功能,如填上关键字的META keyword,还有做链接的A.</p>
<blockquote><p>
那么正确的符合标准的设计思路是:<br />
使用DIV等布局元素来制作页面的设计布局,定位,色块,图片等<br />
使用TABLE,UL等这样的元素来显示页面中需要展示数据<br />
当然,DIV也起整理数据的作用,使用DIV的ID属性可以很方便的将一个DIV作为一个你名命的数据块
</p></blockquote>
<p>所以使用WEB标准来制作网站,实际是一个信息合理化整合的一个过程,什么地方该用什么元素还是照用不误,别把表格当布局工具就行.</p>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2007-05-13 -- <a href="http://www.lsproc.com/blog/html_or_xhtml/" title="HTML or XHTML, 关于web标准">HTML or XHTML, 关于web标准</a> (0)</li><li>2010-04-13 -- <a href="http://www.lsproc.com/blog/copy_to_clipboard/" title="复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; flash10">复制到剪切板 &#8211; 兼容 ie, firefox, chrome &#038; flash10</a> (2)</li><li>2007-06-25 -- <a href="http://www.lsproc.com/blog/draw_by_html_table/" title="用 HTML 表格绘画 （强人）">用 HTML 表格绘画 （强人）</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/div-and-table-tags/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web设计札记</title>
		<link>http://www.lsproc.com/blog/web-design-tips/</link>
		<comments>http://www.lsproc.com/blog/web-design-tips/#comments</comments>
		<pubDate>Wed, 01 Mar 2006 08:40:22 +0000</pubDate>
		<dc:creator>lostsnow</dc:creator>
				<category><![CDATA[WebDesign]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ie]]></category>

		<guid isPermaLink="false">http://lost.yi.org/blog/?p=10</guid>
		<description><![CDATA[转载时请标明文章原始出处和作者信息, 作者: lostsnow.http://www.lsproc.com/blog/web-design-tips/

IE中处理空白字符的问题

按通常的理解，HTML文档中的空白字符如空格、回车、制表符等都应当被忽略，但IE处理这些字符时有可能会出现一些问题，尤其是和&#60;img&#62;标签相关的时候。
比如下面一段代码：

&#60;div&#62;
&#60;img src=&#34;banner.png&#34; /&#62;
&#60;/div&#62;

在IE中的图片下方多出了不应有的空白，原因是&#60;img&#62;和&#60;div&#62;之间的回车被IE理解为空格，并在页面上显示出来。解决方法很简单：

&#60;div&#62;&#60;img src=&#34;banner.png&#34; /&#62;&#60;/div&#62;

现在就正常了。
在Firefox中不存在上述问题。

表单元素命名的细节问题

提交按钮的名字不要用简单的"submit"，这个名字会让form对象的submit()方法失效。因为按钮在&#60;form&#62;之后出现，forms[0].submit就成了一个对象，导致forms[0].submit()失去作用。
同样的道理，在给其他表单元素命名是不要使用可能引起混淆的名字。
IE5.x和IE6.0对元素宽度的计算方法不一样，设计网页时要格外小心。

IE5.x中一个元素的实际宽度 = margin*2 + width，其中 width = border*2 + padding*2 + 内部空间，留给实际内容的只有 width - border*2 - padding*2。
IE6.0中一个元素的实际宽度 = margin*2 + border*2 + padding*2 + width，实际内容的宽度就是 width。
页面内容居中方法两则

其一：body 中定义 text-align:center，页面内容都放进一个 &#60;div id="all"&#62; 当中，定义 #all 为 width: 760px; margin: 0 auto; text-align: left。
其二：仍然把页面内容都放进 &#60;div id="all"&#62; 里面，定义 #all 为 width: 760px; position: absolute; [...]]]></description>
			<content:encoded><![CDATA[<p>转载时请标明文章原始出处和作者信息, 作者: <a href="http://www.lsproc.com/blog/">lostsnow</a>.<br /><a href="http://www.lsproc.com/blog/web-design-tips/">http://www.lsproc.com/blog/web-design-tips/</a></p>
<blockquote>
<p>IE中处理空白字符的问题</p>
</blockquote>
<p>按通常的理解，HTML文档中的空白字符如空格、回车、制表符等都应当被忽略，但IE处理这些字符时有可能会出现一些问题，尤其是和&lt;img&gt;标签相关的时候。</p>
<p>比如下面一段代码：</p>
<pre class="brush: html">
&lt;div&gt;
&lt;img src=&quot;banner.png&quot; /&gt;
&lt;/div&gt;
</pre>
<p>在IE中的图片下方多出了不应有的空白，原因是&lt;img&gt;和&lt;div&gt;之间的回车被IE理解为空格，并在页面上显示出来。解决方法很简单：</p>
<pre class="brush: html">
&lt;div&gt;&lt;img src=&quot;banner.png&quot; /&gt;&lt;/div&gt;
</pre>
<p>现在就正常了。</p>
<p>在Firefox中不存在上述问题。</p>
<p><span id="more-10"></span></p>
<blockquote><p>表单元素命名的细节问题
</p></blockquote>
<p>提交按钮的名字不要用简单的"submit"，这个名字会让form对象的submit()方法失效。因为按钮在&lt;form&gt;之后出现，forms[0].submit就成了一个对象，导致forms[0].submit()失去作用。</p>
<p>同样的道理，在给其他表单元素命名是不要使用可能引起混淆的名字。</p>
<blockquote><p>IE5.x和IE6.0对元素宽度的计算方法不一样，设计网页时要格外小心。
</p></blockquote>
<p>IE5.x中一个元素的实际宽度 = margin*2 + width，其中 width = border*2 + padding*2 + 内部空间，留给实际内容的只有 width - border*2 - padding*2。</p>
<p>IE6.0中一个元素的实际宽度 = margin*2 + border*2 + padding*2 + width，实际内容的宽度就是 width。</p>
<blockquote><p>页面内容居中方法两则
</p></blockquote>
<p>其一：body 中定义 text-align:center，页面内容都放进一个 &lt;div id="all"&gt; 当中，定义 #all 为 width: 760px; margin: 0 auto; text-align: left。</p>
<p>其二：仍然把页面内容都放进 &lt;div id="all"&gt; 里面，定义 #all 为 width: 760px; position: absolute; left: 50%; margin-left: -380px。</p>
<blockquote><p>
CSS中属性的继承
</p></blockquote>
<p>body中的字体属性不能继承给 form 中的 input、textarea 等元素。你需要重新定义它们的外观。</p>
<p>IE 中另有一个继承的 bug，即 table 元素不能从 body 中继承字体属性，同样需要另外定义。</p>
<p>-- EOF --</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>2010-01-26 -- <a href="http://www.lsproc.com/blog/firefox_crashes_again_and_again/" title="firefox crashes again and again">firefox crashes again and again</a> (0)</li><li>2007-07-16 -- <a href="http://www.lsproc.com/blog/install_tor_under_ubuntu/" title="Ubuntu 下安装 Tor">Ubuntu 下安装 Tor</a> (0)</li><li>2007-06-25 -- <a href="http://www.lsproc.com/blog/draw_by_html_table/" title="用 HTML 表格绘画 （强人）">用 HTML 表格绘画 （强人）</a> (0)</li><li>2007-06-05 -- <a href="http://www.lsproc.com/blog/anchor_pseudo_classes/" title="关于定义a:visited后a:hover不起作用">关于定义a:visited后a:hover不起作用</a> (3)</li><li>2007-05-13 -- <a href="http://www.lsproc.com/blog/html_or_xhtml/" title="HTML or XHTML, 关于web标准">HTML or XHTML, 关于web标准</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.lsproc.com/blog/web-design-tips/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
