>웹 프론트엔드 >HTML 튜토리얼 >css如何设置<p>和<a>才能达到自己要求_html/css_WEB-ITnose

css如何设置<p>和<a>才能达到自己要求_html/css_WEB-ITnose

WBOY
WBOY원래의
2016-06-24 11:51:101188검색

第一:如何让“用户管理”这四个字上下居中?
第二:当鼠标放上去时,绿色怎么才能完全覆盖掉红色?

<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>leftwindow</title><style type="text/css">  #baseInfoManager{ width:180px; height:200px;}#baseInfoManager p{ height:50px;  text-indent:20px; background:#ff0000; }#baseInfoManager p a{   display:block;   height:50px;   width:180px;   text-decoration:none;    font-family:Arial, Helvetica, sans-serif;   font-size:12px;}#baseInfoManager p a:hover{  width:180px;  height:30px;  color:#000;   text-decoration:none;   background:#00ff00;}</style></head><body > <div id="baseInfoManager"> <p id="btn"><a href="#">用户管理</a></p> </div></body></html>


回复讨论(解决方案)

<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>leftwindow</title><style type="text/css">  #baseInfoManager{ width:180px; height:200px;}#baseInfoManager p{ height:50px;   text-indent:20px; background:#ff0000;  }#baseInfoManager p a{   display:block;   height:100%;   width:100%;   text-decoration:none;   line-height:50px;   font-family:Arial, Helvetica, sans-serif;   font-size:12px;}#baseInfoManager p a:hover{   height:100%;   width:100%;  color:#000;   text-decoration:none;   background:#00ff00;}</style></head><body > <div id="baseInfoManager"> <p id="btn"><a href="#">用户管理</a></p> </div> </body></html>

测试了一下,还是不行;

<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>leftwindow</title><style type="text/css">  #baseInfoManager{ width:180px; height:200px;}#baseInfoManager p{ height:50px;   text-indent:20px; background:#ff0000;  }#baseInfoManager p a{   display:block;   height:100%;   width:100%;   text-decoration:none;   line-height:50px;   font-family:Arial, Helvetica, sans-serif;   font-size:12px;}#baseInfoManager p a:hover{   height:100%;   width:100%;  color:#000;   text-decoration:none;   background:#00ff00;}</style></head><body > <div id="baseInfoManager"> <p id="btn"><a href="#">用户管理</a></p> </div> </body></html>


好了,谢谢!
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.