css+div基础

css的语法特点:
1.在文档中引入样式表要使用<style>标记,并放在<head>
2.语法:样式表{
[属性:属性值]; [属性:属性值];
}
例如<style type="text/css">
<!--
.classstyle1{ font-family:仿宋; font-size:12pt; }
-->
3.属性值没有用引号包围起来的。


CLASS和ID类型的样式表
1.为class指定样式的语法是在类名前加(.)点号,然后将样式定义写在大括号内。
例如: .classstyle1{color:blue;}
2.ID指定样式的方法是用#号代替点号。

<style type="TEXT/CSS">
<!--
.classstyle1{
font-family:仿宋;
font-size:12pt;
}
.classstyle2{
font-family:华文楷体;
font-size:15pt;
font-style:italic;
}
#idstyle{
font-family:隶书;
font-size:19pt;
color:blue;
}
-->
</style>

<p class="classstyle1">段落一classstyle1效果</p>.
<p id="idstyle">段落二idstyle效果</p>
<p >在一行中<span class="classstyle2">使用样式可以使用<span>标记。classstyle2效果</span></p>
<div class="classstyle">段落三classstyle1效果</div


javascript
1.打开google网站: window.open("http://www.google.com")
2.在html文档显示hello : document.write("hello");
3.弹出窗口 : alert("sdfd");
4.强制类型转换函数
例如:parseInt("6.12")=6
parseFloat("6.12")=6.12
eval("1+1")=2,eval("1<2")=true--------------------evel函数将字符串强制转换为表达式并返回结果
5.typeof:查询数值当前类型: typeof("test"+3)="string",typeof(null)="object"
6.11中内置对象:array,string,date,math,boolean,number,function,global,error,regexp,object
7.字符串对象:自动创建和手工创建。
var sr="hello world"; 用完就丢弃
var str=new String("hello world");全局有效
8.汉字,字母长度都为1
9.三种对话框:alert(str),confirm(str),prompt(str,value)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值