javaweb css基础知识

                     css基础知识

css其实是一种层叠样式表,我们在web中会使用在html页面嵌入css样式的方法来进行网页的布局。
首先我们需要将css与html进行关联,具体的代码如下:

<head>
	<link rel="stylesheet" type="text/css" href="path"/>
</head>

css选择器

1、id选择器:

#name{...}

name具有唯一性,只能使用一次

2、class选择器:

.name{...}

这个是我们的主要使用的选择器,可以组合用。

3、tag选择器:

tagName{..}

tag必须为同名标签,同名标签自动响应。

class有很多的样式可以使用,具体的样式有:
文字样式
font
font-weight:bold
font-size:int px;
文本样式
color:
line-height:
text-indent:
text-decoration:
letter-spacing:
text-align:
text-overflow:
white-space:
user-select:
列表样式
list-style-type
list-style-image
list-style-positon
盒子模型
width:
height:
弹性盒子

猜你喜欢

转载自blog.csdn.net/RacardoMlu/article/details/107004572