
html/css中p:hover定义宽度之后不让原来的p宽度受影响?
<html><head><style>.p{width:450px}.p:hover{backgroung:#f58239;color:#FFF;}</style></h...
<html>
<head>
<style>
.p{width:450px}
.p:hover{backgroung:#f58239;color:#FFF;}
</style>
</head>
<body>
<p>credited with a batch of high calibre designers and a huge team of professional construction workers offering the general customers with</p>
</body>
</html>
我想在.p:hover中定义一个宽度,但原来的P定义的450PX要不受到影响
我想要的效果是当鼠标点击到这段文字的时候,背景颜色可以放大一圈,但是p段落里面的文字不受到影响。 展开
<head>
<style>
.p{width:450px}
.p:hover{backgroung:#f58239;color:#FFF;}
</style>
</head>
<body>
<p>credited with a batch of high calibre designers and a huge team of professional construction workers offering the general customers with</p>
</body>
</html>
我想在.p:hover中定义一个宽度,但原来的P定义的450PX要不受到影响
我想要的效果是当鼠标点击到这段文字的时候,背景颜色可以放大一圈,但是p段落里面的文字不受到影响。 展开
3个回答
展开全部
.p:hover{backgroung:#f58239;color:#FFF;padding:10px;margin:-10px;}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询