css一级导航文字不显示怎么回事

html-css010

css一级导航文字不显示怎么回事,第1张

网页与css本身就是分离的。css的作用是来规范的描述网页如何显示,显示成什么样子。所以说网页中的文字是不会显示到css中的。css中写的全是,样式属性来规范网页显示的。之所以引入css到网页,就是为了html代码与布局样式尽量的分离,为网站改版提供了大大的方便。

假设上面div的class为two,下面div的class为one。

1、下面的div文字的颜色设置成transparent。

.one{

color:transparent

}

2、给上面的div设置背景色。

.two{

background-color: fff

}

扩展资料:

两个div重合的方法:

父级元素绝对定位,子级元素相对定位。通过left、right、top、bottom实现子级在父级内任意定位

假设父级元素的class为con,子级元素的class为two。

.con{

position: relative

}

.two{

position: absolute

top:0

}

你把CSS作如下改动就行:

<style type="text/css">

#Layer1 {

left:198px

top:50px

width:294px

height:141px

z-index:1

position: absolute

background-color: #FF00FF

}

#Layer2 {

width:100px

height:100px

z-index:2

margin: -50px 0px 0px -50px

background-color: #FFFF00

}

</style>

改为:

<style type="text/css">

#Layer1 {

left:198px

top:50px

width:294px

height:141px

position: absolute

background-color: #FF00FF

}

#Layer2 {

width:100px

height:100px

margin: 0px

background-color: #FFFF00

}

</style>

这样就行,margin 是设置内补丁的.另外Z-index是设层的位置顺序.建议你多试验,多看效果.