利用css的样式对文本进行隐藏和显示等操作

建站知识 2021-07-03 08:15www.168986.cn长沙网站建设

复制代码
代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://.w3./TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<!--文本的显示和隐藏 -->
<style type="text/css">
#div_2{
display: inline;
}
#span_1{
/ display:block; /
visibility: hidden;
}
</style>
</head>
<body>
<div>div1</div>
<div id="div_2">div2</div>
<span id="span_1">span1</span>
<span>span2</span>
</body>
</html>

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by