<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_星空竹月</title><subtitle type="text">学习ASPNET</subtitle><id>http://feed.cnblogs.com/blog/u/27302/rss</id><updated>2011-03-28T16:19:52Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><generator>CNBlogs BlogServer</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/27302/rss"/><entry><id>http://www.cnblogs.com/cnyyl/archive/2011/03/29/1998282.html</id><title type="text">Div中文字竖直居中的问题</title><summary type="text">有时候很需要使用CSS将Div中的文字在竖直方向和水平方向居中，今天查阅了一些资料，发现其实实现方法也不时很难。CSS 中Div文字居中有两种情况，一种是Div文字水平居中，另外一种是Div文字竖直居中。 一、首先说一下Div文字竖直居中。1.单行文字设置div的高度与文字的行高一样就可以了,即 line-height 和 height 的数值是一样的就可以了,最后给div一个 over-flow: hidden ,让超出的部分隐藏.这种方法支持块级和内联极元素以及所有的浏览器,不过只能显示一行,而且IE中不支持&amp;lt; img &amp;gt;等的居中,之所以要用 overflow: hidden </summary><published>2011-03-28T16:20:00Z</published><updated>2011-03-28T16:20:00Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><link rel="alternate" href="http://www.cnblogs.com/cnyyl/archive/2011/03/29/1998282.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/archive/2011/03/29/1998282.html"/><content type="html">&lt;p&gt;有时候很需要使用&lt;strong&gt;&lt;a title="CSS专题" href="http://it.dengchao.org/category/web/css/" target="_blank" rel="external"&gt;CSS&lt;/a&gt;&lt;/strong&gt;将&lt;strong&gt;Div&lt;/strong&gt;中的文字在竖直方向和水平方向&lt;strong&gt;居中&lt;/strong&gt;，今天查阅了一些资料，发现其实实现方法也不时很难。&lt;/p&gt;&#xD;
&lt;p&gt;CSS 中Div文字居中有两种情况，一种是&lt;strong&gt;Div文字水平居中&lt;/strong&gt;，另外一种是&lt;strong&gt;Div文字竖直居中&lt;/strong&gt;。&lt;span id="more-636426"&gt; &lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;一、首先说一下Div文字竖直居中。&lt;/strong&gt;&lt;br /&gt;1.单行文字&lt;br /&gt;设置div的高度与文字的行高一样就可以了,即 line-height 和 height 的数值是一样的就可以了,最后给div一个 over-flow: hidden ,让超出的部分隐藏.&lt;br /&gt;这种方法支持块级和内联极元素以及所有的浏览器,不过只能显示一行,而且IE中不支持&amp;lt; img &amp;gt;等的居中,之所以要用 overflow: hidden ,是因为当用户放大字体时,字会超出div的范围.&lt;br /&gt;插入代码：&lt;/p&gt;&#xD;
&lt;div &gt;&#xD;
&lt;div &gt;&lt;pre  style="font-family: monospace"&gt;div&lt;span style="color: rgb(0,170,0)"&gt;{&lt;/span&gt; &#xD;
&lt;span style="font-weight: bold; color: rgb(0,0,0)"&gt;height&lt;/span&gt;&lt;span style="color: rgb(0,170,0)"&gt;:&lt;/span&gt; &lt;span style="color: rgb(153,51,51)"&gt;20px&lt;/span&gt;&lt;span style="color: rgb(0,170,0)"&gt;;&lt;/span&gt; &#xD;
&lt;span style="font-weight: bold; color: rgb(0,0,0)"&gt;line-height&lt;/span&gt;&lt;span style="color: rgb(0,170,0)"&gt;:&lt;/span&gt; &lt;span style="color: rgb(153,51,51)"&gt;20px&lt;/span&gt;&lt;span style="color: rgb(0,170,0)"&gt;;&lt;/span&gt; &#xD;
&lt;span style="font-weight: bold; color: rgb(0,0,0)"&gt;overflow&lt;/span&gt;&lt;span style="color: rgb(0,170,0)"&gt;:&lt;/span&gt; &lt;span style="color: rgb(153,51,51)"&gt;hidden&lt;/span&gt;&lt;span style="color: rgb(0,170,0)"&gt;;&lt;/span&gt; &#xD;
&lt;span style="color: rgb(0,170,0)"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xD;
&lt;p&gt;2.多行文字&lt;br /&gt;设定一样的 padding-bottom 和 padding-top&lt;br /&gt;插入代码：&lt;/p&gt;&#xD;
&lt;div &gt;&#xD;
&lt;div &gt;&lt;pre  style="font-family: monospace"&gt;div&lt;span style="color: rgb(0,170,0)"&gt;{&lt;/span&gt; &#xD;
&lt;span style="font-weight: bold; color: rgb(0,0,0)"&gt;padding-top&lt;/span&gt;&lt;span style="color: rgb(0,170,0)"&gt;:&lt;/span&gt; &lt;span style="color: rgb(153,51,51)"&gt;20px&lt;/span&gt;&lt;span style="color: rgb(0,170,0)"&gt;;&lt;/span&gt; &#xD;
&lt;span style="font-weight: bold; color: rgb(0,0,0)"&gt;padding-bottom&lt;/span&gt;&lt;span style="color: rgb(0,170,0)"&gt;:&lt;/span&gt; &lt;span style="color: rgb(153,51,51)"&gt;20px&lt;/span&gt;&lt;span style="color: rgb(0,170,0)"&gt;;&lt;/span&gt; &#xD;
&lt;span style="color: rgb(0,170,0)"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xD;
&lt;p&gt;这种方法同时支持块级和内联极元素以及非文本内容,包括图片等等,也支持所有浏览器,不足的就是不能固定高度。&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;二、再来说一下Div文字水平居中。&lt;/strong&gt;&lt;br /&gt;水平居中是很基本的：&lt;br /&gt;align=&amp;#8221;center&amp;#8221;&lt;br /&gt;就可以实现。&lt;/p&gt;&#xD;
&lt;p&gt;好了，以上就是我如何实现CSS Div文字水平居中和竖直居中方法。&lt;/p&gt;&lt;img src="http://www.cnblogs.com/cnyyl/aggbug/1998282.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/cnyyl/archive/2011/03/29/1998282.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/cnyyl/archive/2009/08/20/1550940.html</id><title type="text">ASP入门基础教程-VBScript概述及基本元素</title><summary type="text">1、VBScript简介 　　VBScript是一种脚本语言，也是ASP的默认语言，可以在HTML文件中直接嵌入VBScript脚本，从而扩展HTML，使它不仅仅是一种页面格式语言。带有VBScript脚本的网页可以对用户的操作作出反应。　　2、HTML页面中添加VBScript代码　　VBSript脚本作为HTML文档的一部分页存在。也就是说，这些代码必须放在HTML文档中才能执行。脚本代码可以...</summary><published>2009-08-20T10:45:00Z</published><updated>2009-08-20T10:45:00Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><link rel="alternate" href="http://www.cnblogs.com/cnyyl/archive/2009/08/20/1550940.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/archive/2009/08/20/1550940.html"/></entry><entry><id>http://www.cnblogs.com/cnyyl/archive/2007/10/16/926633.html</id><title type="text">第一次安装sql2000挂起无法安装的问题</title><summary type="text">关于：以前的某个程序安装已在安装计算机上创建挂起的文件操作 解决办法 以前装过sql server，后来删掉。现在重装，却出现&amp;#8220;以前的某个程序安装已在安装计算机上创建挂起的文件操作。运行安装程序之前必须重新启动计算机&amp;#8221;错误。无法进行下去。 步骤是： 1）添加/删除程序中彻底删除sql server。 2）将没有删除的sql server目录也删除掉。 3）打开注册表编辑器，...</summary><published>2007-10-16T13:15:00Z</published><updated>2007-10-16T13:15:00Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><link rel="alternate" href="http://www.cnblogs.com/cnyyl/archive/2007/10/16/926633.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/archive/2007/10/16/926633.html"/></entry><entry><id>http://www.cnblogs.com/cnyyl/archive/2007/09/22/902046.html</id><title type="text">asp.net(c#)成条形码[转]</title><summary type="text">usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.We...</summary><published>2007-09-21T16:00:00Z</published><updated>2007-09-21T16:00:00Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><link rel="alternate" href="http://www.cnblogs.com/cnyyl/archive/2007/09/22/902046.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/archive/2007/09/22/902046.html"/></entry><entry><id>http://www.cnblogs.com/cnyyl/archive/2007/09/20/900631.html</id><title type="text">关于文章列表如何直接显示文章类别名的问题</title><summary type="text">星空竹月 22:21:20王老师，有空吗？请教一个问题，呵呵我有两个表，一个是文章表article,一个是文章分类表type，在文章表里面有一个字段是typeId,每次用DataList显示文章列表的时候总是要在嵌套另一个空间把分类名typeName读取出来。有没有办法只用一个DataList读取typeName,或者在数据库里面设置呢？tie 22:22:26你用连接可以直接实现的把星空竹月 2...</summary><published>2007-09-20T14:44:00Z</published><updated>2007-09-20T14:44:00Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><link rel="alternate" href="http://www.cnblogs.com/cnyyl/archive/2007/09/20/900631.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/archive/2007/09/20/900631.html"/></entry><entry><id>http://www.cnblogs.com/cnyyl/archive/2007/09/18/897679.html</id><title type="text">Page_PreInit在网页传值的应用</title><summary type="text">以前，我页面接收传值和保持Session会话都是在Page_Load事件里面操作的，今天又把天轰川的那个教程拿来看了一下，发现原来Page_PreInit跟Page_Load的不回传条件的效果是一样的，所以我把以前放在Page_Load的接收传值方式放到了Page_PreInit事件里面了，这样看起来代码也清晰多了。部分代码如下：intSubId=0;stringSessionName;prote...</summary><published>2007-09-18T13:18:00Z</published><updated>2007-09-18T13:18:00Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><link rel="alternate" href="http://www.cnblogs.com/cnyyl/archive/2007/09/18/897679.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/archive/2007/09/18/897679.html"/></entry><entry><id>http://www.cnblogs.com/cnyyl/archive/2007/09/16/894946.html</id><title type="text">利用.net的强大功能发送email</title><summary type="text">主要的代码如下: using System.Web.Mail;字串9字串6MailMessage myMail = new MailMessage(); 字串4myMail.To = "ast03@mails.tsinghua.edu.cn"; //接受方的电子邮件地址 字串2myMail.From = "youyouyou@mails.tsinghua.edu.cn"; //发送方的电子邮件地址...</summary><published>2007-09-16T11:04:00Z</published><updated>2007-09-16T11:04:00Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><link rel="alternate" href="http://www.cnblogs.com/cnyyl/archive/2007/09/16/894946.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/archive/2007/09/16/894946.html"/></entry><entry><id>http://www.cnblogs.com/cnyyl/archive/2007/09/13/892152.html</id><title type="text">在页面和Datalist控件中判断是否为今天</title><summary type="text">研究了一天，查了很多资料，终于搞明白了，呵呵前台代码：&amp;lt;%@PageLanguage="C#"AutoEventWireup="true"CodeFile="ifnow.aspx.cs"Inherits="TEST_ifnow"%&amp;gt;&amp;lt;!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/...</summary><published>2007-09-13T13:36:00Z</published><updated>2007-09-13T13:36:00Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><link rel="alternate" href="http://www.cnblogs.com/cnyyl/archive/2007/09/13/892152.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/archive/2007/09/13/892152.html"/></entry><entry><id>http://www.cnblogs.com/cnyyl/archive/2007/09/10/888072.html</id><title type="text">如何在asp.net中关闭B页面时，自动刷新A页面？ </title><summary type="text">前提条件：B页面是由A页面打开的。方法：在A页面的前台代码中加入以下代码：&amp;lt;script language="javascript"&amp;gt;function DownDvasp(htmlurl){varnewwin=window.open(htmlurl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scroll...</summary><published>2007-09-10T01:53:00Z</published><updated>2007-09-10T01:53:00Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><link rel="alternate" href="http://www.cnblogs.com/cnyyl/archive/2007/09/10/888072.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/archive/2007/09/10/888072.html"/></entry><entry><id>http://www.cnblogs.com/cnyyl/archive/2007/09/10/888049.html</id><title type="text">ASP.net(c#)做返回上一页效果(后退)--代码</title><summary type="text">usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls...</summary><published>2007-09-10T01:36:00Z</published><updated>2007-09-10T01:36:00Z</updated><author><name>星空竹月</name><uri>http://www.cnblogs.com/cnyyl/</uri></author><link rel="alternate" href="http://www.cnblogs.com/cnyyl/archive/2007/09/10/888049.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/cnyyl/archive/2007/09/10/888049.html"/></entry></feed>
