È¥³ýHTML¸ñʽ ½ØÈ¡×Ö·û´®
//½ØÈ¡²¿·ÖÄÚÈÝ·½·¨
public static string strvalue(string value, int length)
{
string strValue = NoHTML(value);// È¥³ýHTML±ê¼Ç
if (strValue.Length > length)
{
return strValue.Substring(0, length) + "...";
}
else
{
return strValue;
}
}
#region »Ø³µ,¿Õ¸ñ¹ýÂË
/**/
/// <summary>
/// È¥³ýHTML±ê¼Ç
/// </summary>
/// <param name="NoHTML">°üÀ¨HTMLµÄÔ´Âë </param>
/// <returns>ÒѾȥ³ýºóµÄÎÄ×Ö</returns>
public static string NoHTML(string Htmlstring)
{
//ɾ³ý½Å±¾
Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "",
RegexOpti
Ïà¹ØÎĵµ£º
HTML±í¸ñºÜÈÝÒ×ÉÏÊÖ£¬Ò»¶Ñtr¼Ótd¾Í¿ÉÒÔÏÔʾһÕűí¸ñÁË¡£¸´ÔÓÒ»µã¾ÍÊÇÔÙ¼ÓÉÏth£¬colgroup£¬tbody£¬tfooter£¬captionÖ®Àà¡£ÕâЩHTMLÀïÃæµÄ¸÷ÖÖÔªËØµÄÈ·¼ÓÇ¿Á˱í¸ñµÄʵÓÃÐÔºÍÓïÒ廯£¬µ«table±¾Éí¾ÍÓкܴóѧÎÊŶ£¬±Ï¾¹ÊÇÕû¸ö±í¸ñµÄ¸ù°¡£¡
½ñÌìÏÂÃæÒª×ܽá°üº¬¶Ôtable±¾ÉíµÄÊôÐÔ¹éÄɺÍtableרÓõÄCSS±È½Ï£º
attributes VS CSS ......
¾²Ì¬½á¹¹
£¼html£¾
£¼head£¾
£¼title£¾±êÌ⣼title£¾
£¼/head£¾
£¼body£¾..........ÎļþÄÚÈÝ..........
£¼/body£¾
£¼/html£¾
1.Îļþ±êÌâ
£¼title£¾..........£¼/title£¾
2.Îļþ¸üÐÂ--£¼meta£¾
¡¡¡¾1¡¿10Ãëºó×Ô¶¯¸üÐÂÒ»´Î
¡¡¡¡£¼meta http-equiv="refresh" content=10£¾
¡¡¡¾2¡¿10Ãëáá×Ô¶¯Á¬½áµ½ÁíÒ»Îļþ
¡¡¡¡ ......
Ê×ÏÈдһ¸öÒ³Ãæ£¬ÉÏÃæÒª·ÅÒ»¸öButton
<html>
<head>
<title></title>
</head>
<body>
<input id="Button1" type="button" value="button" />
</body>
</html>
½«Æä±£´ ......
<html:html>±êÇ©ÓÐÒ»¸ö lang ÊôÐÔ£¬ÓÃÓÚÏÔʾÓû§Ê¹ÓõÄÓïÑÔ£º
<html:html lang="true">
Èç¹û¿Í»§ä¯ÀÀÆ÷ʹÓÃÖÐÎÄ£¬ÄÇôÒÔÉÏ´úÂëÔÚÔËÐÐʱ½«±»½âÎöΪÆÕͨµÄ HTML ´úÂ룺
<html lang="zh-CN">
½âÊÍ£ºµ± lang ÊôÐÔΪ "true ......