這是我的網站標題用2樣式表包括:我怎樣才能爲外部CSS文件添加額外的元素樣式?
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="//code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
此代碼是在jQuery的ui.css文件:
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
border: 1px solid #999999;
background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
font-weight: normal;
color: #212121;
}
我還從jquery.com使用外部樣式表:
//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css
現在我需要改變的不透明度屬性UI狀態懸停,而無需下載CSS文件和手動編輯到:
.ui-state-hover{
opacity:0.1;
}
所以在我的style.css內部文件I補充說:
.ui-state-hover{
opacity:0.1;
}
但是,它不工作...
我如何添加額外的樣式規則,而無需下載,編輯文件手動和上傳?我應該只使用內部樣式表嗎?
它不工作,因爲在庫中的定義更加具體的* *。 http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/ – techfoobar
.ui-state-hover {opacity:0.1!important;} – zozo
我的建議是,你下載所有這些CSS&JS文件Coz未來都無法預測。 – Anup