<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
a{
text-decoration: none;
color:deeppink
}
div{
width: 200px;
height: 200px;
background-color: pink;
display: none;
text-align: center;
font: 50px/200px "微软雅黑";
position: absolute;
}
:target{
display: block;
}
#4{
width: 200px;
height: 200px;
display: inline-block;
}
</style>
<script type="text/javascript">
console.log("a")
</script>
</head>
<body>
<a href="#div1">div1</a>
<a href="#div2">div2</a>
<a href="#div3" >div3</a><br />
<div id="4"style="width:200px;height: 200px;display: inline-block;">
div4
</div>
<div id="div1">div1</div>
<div id="div2">div2</div>
<div id="div3">div3</div>
</body>
</html>
上面这个代码为什么div4的样式写在内联就可以打开网页默认显示div4,但是写在css就不可以默认显示div4了呢,求大神帮我解答。。初学勿喷。。
互换的青春