Archive for the ‘笔记’ Category

WordPress更换域名方法

Wednesday, August 20th, 2008

今天博客换了域名,但附件仍然绑着原来的域名,需要改数据库,才能替换掉!

上次换过一次目录,对这些有点经验了,方法如下:

1、备份数据库,必备工作(不怕一万 就怕万一)。

2、查询数据库,我的只有wp_options,wp_posts 这两个表存在原来的域名。

3、表wp_options 字段值option_value和表wp_posts 字段值post_content、post_excerpt、guid存在原来的域名,原域名大多在表wp_posts字段值post_content、guid中。

4、执行SQL语句 update 表的名字 set 字段名 = replace(字段名,’旧数据’,'新数据’) 把原来域名替换掉就可以了。

WordPress程序更换目录、域名及主机都可能出现附件地址出错,改下数据库就搞定了!

IE与Firefox对width的不同解释及解决办法

Tuesday, August 19th, 2008

图片中:CSS ‘width’ 指的是标准CSS中所指的width的宽度,在firefox,opera等中的宽度就是这个宽度。它只包含容器中内容的宽度。

而Internet Explorer ‘width’则是指整个容器的宽度,包括内容,padding ,border。

所谓的CSS的宽度的加法减法就指这里不同浏览器对width解析得到的不同结果。

Firefox中是加法:容器占的宽度=内容宽度+padding宽度+border宽度

IE中是减法:内容宽度=您定义的容器宽度(Internet Explorer ‘width’)-padding宽度-border宽度

大家区分的时候重点是分清:内容宽度和容器所占宽度这两个的不同

由于以上差别的存在,必然造成定义的一个容器宽度在不同浏览器中显示出不同的效果来。解决办法主要有两种:

一种是写hack
一种是采取在当前容器中再增加一个div的方法来解决。

写hack:
给不同的浏览器写一个不同的width: div.aa{width:100px; *width:120px;}Firefox等浏览器只能认出前一个width来,因此它会认为这个div容器的宽度是100px,而IE6等浏览器则两个都能认出来,但是根据优先级,写在后面的会被采纳,因此IE6会认为这个div容器的宽度是120px;

增加一个div或者其它容器的方法:
div结构是:
<div class=”aa”><div>内容放在这里</div></div>
CSS代码是:
.aa{width:120px;}
.aa div{padding:10px;}
将padding border与width分开来写,分到不同的div里面,既不用做加法,也不用做减法,外面的div直接采用我们给它指定的宽度。

ie-firefox

XHTML1.0中允许使用的HTML元素

Thursday, August 7th, 2008

<!–…–> Defines a comment
<!DOCTYPE>  Defines the document type
<a> Defines an anchor
<abbr> Defines an abbreviation
<acronym> Defines an acronym
<address> Defines an address element
<applet> Deprecated. Defines an applet
<area> Defines an area inside an image map
<b> Defines bold text
<base> Defines a base URL for all the links in a page
<basefont> Deprecated. Defines a base font
<bdo> Defines the direction of text display
<big> Defines big text
<blockquote> Defines a long quotation
<body> Defines the body element
<br> Inserts a single line break
<button> Defines a push button
<caption> Defines a table caption
<center> Deprecated. Defines centered text
<cite> Defines a citation
<code> Defines computer code text
<col> Defines attributes for table columns
<colgroup> Defines groups of table columns
<dd> Defines a definition description
<del> Defines deleted text
<dir> Deprecated. Defines a directory list
<div> Defines a section in a document
<dfn> Defines a definition term 
<dl> Defines a definition list
<dt> Defines a definition term
<em> Defines emphasized text
<fieldset> Defines a fieldset 
<font> Deprecated. Defines text font, size, and color
<form> Defines a form 
<frame> Defines a sub window (a frame)
<frameset> Defines a set of frames
<h1> to <h6> Defines header 1 to header
<head> Defines information about the document
<hr> Defines a horizontal rule 
<html> Defines an html document 
<i> Defines italic text
<iframe> Defines an inline sub window (frame) 
<img> Defines an image
<input> Defines an input field
<ins> Defines inserted text
<isindex> Deprecated. Defines a single-line input field
<kbd> Defines keyboard text 
<label> Defines a label for a form control
<legend> Defines a title in a fieldset
<li> Defines a list item
<link> Defines a resource reference
<map> Defines an image map
<menu> Deprecated. Defines a menu list
<meta> Defines meta information
<noframes> Defines a noframe section 
<noscript> Defines a noscript section 
<object> Defines an embedded object
<ol> Defines an ordered list
<optgroup> Defines an option group
<option> Defines an option in a drop-down list
<p> Defines a paragraph
<param> Defines a parameter for an object
<pre> Defines preformatted text
<q> Defines a short quotation
<s> Deprecated. Defines strikethrough text
<samp> Defines sample computer code
<script> Defines a script
<select> Defines a selectable list
<small> Defines small text
<span> Defines a section in a document
<strike> Deprecated. Defines strikethrough text
<strong> Defines strong text
<style> Defines a style definition
<sub> Defines subscripted text
<sup> Defines superscripted text
<table> Defines a table
<tbody> Defines a table body 
<td> Defines a table cell
<textarea> Defines a text area 
<tfoot> Defines a table footer 
<th> Defines a table header 
<thead> Defines a table header
<title> Defines the document title
<tr> Defines a table row
<tt> Defines teletype text 
<u> Deprecated. Defines underlined text
<ul> Defines an unordered list 
<var> Defines a variable
<xmp> Deprecated. Defines preformatted text

CSS网页布局开发小技巧

Tuesday, August 5th, 2008

在CSS网页布局开发中,会有很多小技巧,新手朋友往往对此很不熟悉。在某一两个小问题上,或许纠缠很长时间才能搞明白,虽然在的文档中,多次提及过这方面的内容,但依然有很多朋友在这些问题上犯错。我们今天看看这些CSS技巧,认真读一读,或许您并不能完全理解,您可以再进行搜索,扩展您所想要得到的知识,相信您会有很多收获!

一、ul标签在Mozilla中默认是有padding值的,而在IE中只有margin有值。 Read more»

常用CSS缩写语法总结

Tuesday, August 5th, 2008

使用缩写可以帮助减少你CSS文件的大小,更加容易阅读。css缩写的主要规则如下:

颜色

16进制的色彩值,如果每两位的值相同,可以缩写一半,例如:
#000000可以缩写为#000;#336699可以缩写为#369;

盒尺寸

通常有下面四种书写方法: Read more»