恢复默认的CSS属性 [英] restore default css attributes

查看:64
本文介绍了恢复默认的CSS属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个可在多个网站上使用的组件.

i'm writing a component that is to be used across multiple websites.

每个网站都有自己的样式表,并以不同的方式显示某些内容.

each website has it's own stylesheets and displays certain things differently.

我所有的html都包裹在一个具有ID的div中:

all of my html is wrapped within a div with an id:

<div id="myComponent">...</div>

但是,我的组件在所有站点中看起来都是一致的.

my component however is to look consistent across all of the sites.

这很好,因为我将样式应用于组件中的大多数属性.

this is fine as i apply styling to most of the attributes in my component.

div#myComponent p {font-size:11px;} etc

但是我遇到了一个网站,该网站删除了所有输入字段的边框

however i've come across a site that removes the border from all input fields

input {border: medium none;}

我需要对该组件中的输入字段取消应用"此指令,并且最好将浏览器的默认样式用于输入,因为 input type ="text" 的边框样式将需要不同于 input type ="button" .

i need to 'un-apply' this directive for the input fields within my component, and preferrably use the browser's default styling for inputs, as the border style for input type="text" will need be different to input type="button".

您将如何实现这一目标?

how would you achieve this?

推荐答案

您需要重新定义它.

https://developer.mozilla.org/en/Common_CSS_Questions#Restoring_the_default_property_value

这篇关于恢复默认的CSS属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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