网页设计html+css基础知识汇总

来源:互联网 发布:域名投资人 编辑:程序博客网 时间:2024/06/05 07:58
html+css(回顾)
一、记他主要记7种html标记
1、字符标记,就是那种大于小于还有商业符号的标记,要用html里面的字符标记表示
2、格式标记
换行换段落--br/p/div
居中 center
水平线 hr
预格式 pre
有序 ol
列表的儿子 li
无序 ul
dl dt dd商业的列表
3、文本标记
hn-6种标题
font(size大小 color颜色 face字体)字体的格式
加粗 b/strong
倾斜 i/em/cite
下标 sub
上标 sup
smaller 小字体
larger 大字体
u 下划线
4.图像标记
 img src="图像的路径" width宽度 height高度 border 边框 alt加载不出来的显示内容 title放上去的显示内容
5超链接标记
a href(加路径) name(锚点)
6表格标记
 table(width height align border frame rules cellspacing cellpadding) caption(表格的标题/align) tr(bgcolor/width/height/align/valign行) th(表头) td(单元格)
7表单标记
form(action="提交给服务器"){
input各种文本域密码框(type=text/password/sumbit/reset/button/radio/checkbox)  name(提交给服务器时候的名字/默认get方式) value(当前的值) size(宽度)
textArea(rows-行 cols-列)
select(name){
option(value)--选择项
                    }
                          }
二、css记他主要记3种使用CSS的方法,3种CSS选择器,6种常用的CSS属性
3种使用方式---内链式---<body style="bgcolor:red"></body>
      嵌入式---通常在head标签里面定义--<head>
                                                       <style type="text/css">
                                                       ...
                                                       </style>
                                                       </head>
      引入式-比较常用的一种,可以另写一个html文档,然后引入
3种CSS选择器
   html选择器--<head>
                            <style type="text/css">
                            <!--在此定义body的背景颜色-->
    body{background:rgba(255,0,0,0.4);}
                            </style>
                            </head>
类选择器--在给body定义了一个类名(class)的基础上
  <head>
                          <style type="text/css">
                          <!--在此定义body内容的字体大小-->
   .class{font-size:20px;}
                          </style>
                          </head>
id选择器--在给body定义了一个id(class)的基础上
   <head>
                          <style type="text/css">
                          <!--在此定义body内容的字体大小-->
   #class{font-size:20px;}
                          </style>
                          </head>
三种选择器的优先级为:id>class>html
6种常用的CSS属性
1.颜色属性 color--#ff0000=#f00=rgb(255,0,0)=rgba(255,0,0,0)
2.字体属性 font-size(大小px)  font-family(字体) font-weight(加粗bold/bolder/lighter/normal) font-style
3.背景属性 background-color    background-image(url())   background-repeat(重复方式repeat/no-repeat/repeat-x)   background-position(上下左右)
4.文本属性 text-align(left/center/right)    line-height(%/px/inherit)    text-indent(%/px/inherit)   letter-spacing(px)  word-spacing(px) direction
5.列表属性 list-style-type(cirle/square/none)   list-style-image(url())  list-style-position(inside/outside)
6.边框属性 border-width(px)  border-style(solid/dashed/dotted/double) border-color()
0 0