如何不继承?或者如何重置继承的宽度到之前的值? (css) [英] how to not inherit? or how to reset inherited width to the value before? (css)

查看:100
本文介绍了如何不继承?或者如何重置继承的宽度到之前的值? (css)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了谢谢插件,但我的测试网站上的按钮很奇怪。

I installed Thank you plugin but the button on my test site looks strange.

我找到了为什么。因为它继承 #commentform textarea {width:45%; } 从我的主题。如果我从css删除的宽度按钮看起来确定。任何想法如何我可以解决这个问题?当然,我不想删除#commentform textarea的宽度。我可以做一些关于css级别的按钮吗?像 width:not-inherit; width:reset; 我想说,如果没有 #commentform textarea

I found out why. Because it inherits #commentform textarea { width: 45%; } from my theme. If I remove the width from css the button looks ok. Any idea how I can fix that? Of course I do not want to remove width for #commentform textarea. Can I do something about that on css level of the button? Something like width:not-inherit; width:reset; I'd say that the width of the button wouldn't be declared at all if there was no #commentform textarea

推荐答案

尝试输入

width: auto;

。这应该解决这种情况。

on the button. That should fix it in this case.

这篇关于如何不继承?或者如何重置继承的宽度到之前的值? (css)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆