2014-03-12 37 views
0

我想讓CSS更改彈出,基本上是一個Cookie策略居中的div,然後是「接受」按鈕。我正在使用DNN CMS,彈出窗口是一個模塊,因此無法更改div或類名稱。如何設計一個類型=「按鈕」的輸入?

對於'接受'按鈕,CSS工作正常,但它影響了評論表的輸入。我如何編寫CSS以便CSS隻影響該div中的「接受」按鈕?

順便說一下,'接受'按鈕是一個類型=「按鈕」的輸入。

HTML的 '接受' 按鈕

<input name="CookieConsent_CloseLink" id="View_CookieConsent_sal_CloseLink" value="Accept" type="button"> 

CSS的 '接受' 按鈕

#View_CookieConsent_sal_CloseLink button, input { 
font-family: 'Oswald', arial, sans-serif; 
text-transform: uppercase; 
font-size: 14px; 
padding: 5px; 
position: absolute; 
left: 40%; 
margin-top: 10px; 
margin-bottom: 10px; 
} 

HTML的 '接受' 按鈕

<input name="txtYourName" value="Anonymous" id="txtYourName" class="NormalTextBox" style="width: 100%" type="text"> 
+0

那邊有其他的按鈕嗎?否則,'input [type = button] {/ * properties * /}'會起作用。如果存在,'input [name = CookieConsent_CloseLink]'更具體。或者如果你知道它不會改變,你可以使用這個ID。 – Jon

+0

您可以通過屬性輸入來定位輸入[type = button] – Huangism

+0

謝謝。 input [type =「button]解決了我的問題。 – user3097331

回答

4
input[type="button"] { 
    font-family: 'Oswald', arial, sans-serif; 
    text-transform: uppercase; 
    font-size: 14px; 
    padding: 5px; 
    position: absolute; 
    left: 40%; 
    margin-top: 10px; 
    margin-bottom: 10px; 
} 
0

我以爲你只是想針對與類型的第一個接受按鈕=按鈕

#View_CookieConsent_sal_CloseLink { 
.... 
} 

應該工作

當你做#View_CookieConsent_sal_CloseLink按鈕

,你該ID的內部目標的按鈕。您還可以通過屬性

input[type=button] { .... } 
0

代替#View_CookieConsent_sal_CloseLink按鈕,輸入

使用本#txtYourName,#View_CookieConsent_sal_CloseLink

所以CSS將ID txtYourName 和餅乾開火按鈕與ID View_CookieConsent_sal_CloseLink

好運

相關問題