CSS first knowledge


Introduction :

css指层叠样式表(Cascading Style Sheets)
增强控制网页样式,并且将样式与网页分离的一种标记语言

Block-shaped element : A row alone, width and height attributes can be set
                     Example: <div> <p> <h1> <li> <dl> <a>
                     ( Note: The block-shaped element without any style is<div> ) In-
line element : You cannot set the width and height attributes
                     Example:<i> <em> <sub> <sup> <u> <font> <span>

Comment: /* */
          Role: Code debugging; code description

Grammar format :

 [选择器 == 选择符]
 选择器{
 		属性1:属性值1;
 		属性2:属性值2;
 }

**Three ways to import CSS from HTML:

1. 内嵌样式  作用:只适用于一个HTML页面,独一无二
			<style type="text/css">
        	选择器{
     
     
        		属性:属性值;
        	}
    		</style>
2. 外链样式   作用:可以同时作用于多个文件
			 <link rel="文档与被连接文档间的关系" type="文档类型" href="被连接的文档路径">
3.  行内样式  作用:使用更方便,直接写在标签里面就可以,但是这样就不能凸显css的特点. css样式与网页分离
			 <标签名 style="css样式"></标签名>

Guess you like

Origin blog.csdn.net/ZZZ___jh/article/details/108578411