日志内容

2005-12-28HTML4标签的默认样式列表

TAG:CSS 代码分享
html, address,
blockquote,
body, dd, div,
dl, dt, fieldset, form,
frame, frameset,
h1, h2, h3, h4,
h5, h6, noframes,
ol, p, ul, center,
dir, hr, menu, pre   { display: block }
li              { display: list-item }
head            { display: none }
table           { display: table }
tr              { display: table-row }
thead           { display: table-header-group }
tbody           { display: table-row-group }
tfoot           { display: table-footer-group }
col             { display: table-column }
colgroup        { display: table-column-group }
td, th          { display: table-cell; }
caption         { display: table-caption }
th              { font-weight: bolder; text-align: center }
caption         { text-align: center }
body            { margin: 8px; line-height: 1.12 }
h1              { font-size: 2em; margin: .67em 0 }
h2              { font-size: 1.5em; margin: .75em 0 }
h3              { font-size: 1.17em; margin: .83em 0 }
h4, p,
blockquote, ul,
fieldset, form,
ol, dl, dir,
menu            { margin: 1.12em 0 }
h5              { font-size: .83em; margin: 1.5em 0 }
h6              { font-size: .75em; margin: 1.67em 0 }
h1, h2, h3, h4,
h5, h6, b,
strong          { font-weight: bolder }
blockquote      { margin-left: 40px; margin-right: 40px }
i, cite, em,
var, address    { font-style: italic }
pre, tt, code,
kbd, samp       { font-family: monospace }
pre             { white-space: pre }
button, textarea,
input, object,
select          { display:inline-block; }
big             { font-size: 1.17em }
small, sub, sup { font-size: .83em }
sub             { vertical-align: sub }
sup             { vertical-align: super }
table           { border-spacing: 2px; }
thead, tbody,
tfoot           { vertical-align: middle }
td, th          { vertical-align: inherit }
s, strike, del  { text-decoration: line-through }
hr              { border: 1px inset }
ol, ul, dir,
menu, dd        { margin-left: 40px }
ol              { list-style-type: decimal }
ol ul, ul ol,
ul ul, ol ol    { margin-top: 0; margin-bottom: 0 }
u, ins          { text-decoration: underline }
br:before       { content: "\A" }
:before, :after { white-space: pre-line }
center          { text-align: center }
abbr, acronym   { font-variant: small-caps; letter-spacing: 0.1em }
:link, :visited { text-decoration: underline }
:focus          { outline: thin dotted invert }
/* Begin bidirectionality settings (do not change) */
BDO[DIR="ltr"]  { direction: ltr; unicode-bidi: bidi-override }
BDO[DIR="rtl"]  { direction: rtl; unicode-bidi: bidi-override }
*[DIR="ltr"]    { direction: ltr; unicode-bidi: embed }
*[DIR="rtl"]    { direction: rtl; unicode-bidi: embed }

@media print {
  h1            { page-break-before: always }
  h1, h2, h3,
  h4, h5, h6    { page-break-after: avoid }
  ul, ol, dl    { page-break-before: avoid }
}

2005-12-03[转]动态加载CSS的三种方法

TAG:代码分享 CSS

如果你有很多关联的CSS文件要一起加载,或者想动态的加载不同的CSS文件,那么下面的方法你一定对你有帮助。
第一种:一般用在外部CSS文件中加载必须的文件
1: @import url(style.css);
2: /*只能用在CSS文件中或者style标签中*/

第二种:简单的在页面中加载一个外部CSS文件
1: document.createStyleSheet(cssFile); 

第三种:用createElement方法创建CSS的Link标签
1:  var head = document.getElementsByTagName('HEAD').item(0);
2:  var style = document.createElement('link');
3:  style.href = 'style.css';
4:  style.rel = 'stylesheet'
5:  style.type = 'text/css';
6:  head.appendChild(style);


2005-11-28[原]关于使用CSS居中(包括水平/垂直)

TAG:CSS 代码分享 原创

今天有网友问到用CSS的text-align: center属性在FF中不起作用的问题,找了一下网上的资料,整理了一下:
水平居中的问题可以用以下方法解决:
先看一下body的CSS样式:
---------------------------------------------
body{ margin:0;padding:0;text-align:center;}
---------------------------------------------
这里的body把margin与padding设置为0,这样就把body内容与浏览器边缘亲密接触。然后text-align:center 把body的内容全部居中。
在需要水平居中的DIV层添加以下属性:
-------------------------------------------
margin-left: auto;
margin-right: auto;
-------------------------------------------
也可写成:
-------------------------------------------
margin:0 auto;
-------------------------------------------
这样在FF中就可以居中了,在IE中别忘了在开头加上DTD哦,不然可是不起作用的:
-------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
------------------------------------------------------------

如何使图片在DIV 中垂直居中

用背景的方法。举例:
----------------------------------------------------------
body{BACKGROUND: #FFF url(http://www.blogbus.com/images/site/blogbus_logo.gif)  no-repeat center;}
----------------------------------------------------------
关键就是最后的center,这个参数定义图片的位置。还可以写成“top left”(左上角)或者"bottom right"等,也可以直接写数值"50 30"

如何使文本在DIV中垂直居中

果是文字,便不能用背景方法,可以用增高行距的办法变通实现垂直居中,完整代码如下:
------------------------------------------------------
<html>
<head>
<style>
body{TEXT-ALIGN: center;}
#center{ MARGIN-RIGHT: auto;
MARGIN-LEFT: auto;
height:200px;
background:#F00;
width:400px;
vertical-align:middle;
line-height:200px;
}
</style>
</head>
<body>
<div id="center"><p>test content</p></div>
</body>
</html>
--------------------------------------------------------
说明:
vertical-align:middle;表示行内垂直居中,我们将行距增加到和整个DIV一样高line-height:200px;然后插入文字,就垂直居中了。
不过这个方法还不是最好的方法,目前也只能先用用咯。


2005-11-24去掉网页链接上点击时的虚线

TAG:代码分享 CSS

也许你会觉得当点击时焦点出现的虚线很不好看,那就让我们把它去掉吧!

一,在<a>标签中加入onFocus="this.blur()"语句:
-----------------------------------------------------------
<a href="#" onFocus="this.blur()">try</a>
-----------------------------------------------------------

二,在<a>标签中加入hidefocus:
-----------------------------------------------------------
<a href="###" hidefocus>link</a>
-----------------------------------------------------------

三,如果连接太多,可以用外部链接 .HTC 文件。
如,blur.htc 文件内容如下:
----------------------------------------------------------
<public:attach event="onfocus" onevent="makeblur()"/>
<script language="javascript">
function makeblur(){
this.blur();
}
</script>
-----------------------------------------------------------
在 CSS 中加入如下代码:
-----------------------------------------------------------
A { behavior:url(blur.htc); }
-----------------------------------------------------------

四,使用CSS样式,可加入代码:
-----------------------------------------------------------
a {blr:expression(this.onFocus=this.blur())}
-----------------------------------------------------------
这样,站内所有的文章都实现了无虚线效果了。


2005-11-23IE5.5的新窗口

TAG:代码分享 JScript

很不一样的窗口哦!(~o~)
不过要IE5.5+或以上的浏览器才可以看到效果。

--------------------------------------------------------
<script language="JScript">
var oPopup = window.createPopup();
var oPopupBody = oPopup.document.body;
oPopupBody.style.border = "0px none"
oPopupBody.bgColor='#c0c0c0'
oPopupBody.innerHTML = "<img src='http://www.blogbus.com/images/site/blogbus_logo.gif'>"
oPopup.show(600,30,88,32)
</script>


分页 共9页 第一页 上一页 1 2 3 4 5 6 7 8 9 下一页 最后一页
订阅>>使用RSS邮天下订阅>>Google订阅s

Q我 GTalk联系

Recent Articles

Recent Comments

Recommend

Archive

广 州
The WeatherPixie

Search Engine Optimization

CSS森林:30247792
(精神正常者慎入!)

访问统计:

011 本BLOG[原]部分的内容采用创作共用授权,请尊重劳动成果,谢谢。
Copyright © 2006 风的影子. All rights reserved.   FORESt.blOGbUS.COM  BLOGBUS.COM