2010-09-22 51 views
1

我正在升級非常舊的網站的一部分。我自己使用的一個頁面使用控件和dll,但我沒有。有一個DLL會在頁面上放置一個文本框(輸入框)。這個字段在概念上是一個標籤,但是這個人選擇使用一個文本框。無論如何,我不能改變DLL。將所有文本框(輸入字段)的背景顏色設置爲透明

在我的asp.net頁面有沒有一種方法使用dll來說這個頁面上的所有文本框應該有一個透明的背景?

這是我可以訪問的代碼。我所做的任何更改都必須在此處進行。

<asp:Content ID="Content1" ContentPlaceHolderID="bodyContent" Runat="Server"> 
<style type="text/css"> 
.heading { color:#007DC3; font-weight:300; font-size:1.5em; line-height:1.22em; margin-bottom:22px; } 
</style> 
    <cc1:wizard id="wizCtl" runat="server"></cc1:wizard> 
</asp:Content> 

謝謝!

是什麼?

<div style = "input[type='text']{ 
border: none; 
background-color: transparent; 
} 
"> 
    <cc1:wizard id="wizCtl" runat="server"></cc1:wizard> 
</div> 

它似乎沒有工作...

想這太:

<style input [type='text']{ border: none; background-color: transparent;} > 

<cc1:wizard id="wizCtl" runat="server"></cc1:wizard> 

</style> 
+0

你只是想讓文本框看起來好像它不是一個文本框,只有文本? – 2010-09-22 15:25:51

+0

好吧,它有點看起來像是文本,但背景是白色的 – kralco626 2010-09-22 16:03:19

+0

行...那麼爲什麼對這個問題進行投票呢?這是一個壞問題...?我很清楚我的情況,並且我已經更新了它對於我嘗試過的不同事物。 – kralco626 2010-09-24 11:43:52

回答

1

我可以看到你的問題。 更改您的代碼

<style type='text/css'>div.tbwrap input[type='text']{ border: none; background-color: transparent;}</style> 
<div class='tbwrap'><cc1:wizard id="wizCtl" runat="server"></cc1:wizard></div> 

你的風格標籤是有點過了,我不要了「CC1:精靈」的事情標籤應該是樣式標籤內無論是。

+0

HAHA。這工作!...但是,它把所有的文本框,甚至是那些應該是文本框的文本框都轉換爲背景=透明的。任何機會,我可以說使所有不可編輯的輸入字段有背景=透明? – kralco626 2010-09-24 12:01:55

+0

它應該只在包裝在div.tbwrap中的文本框上做到這一點? – Olical 2010-09-24 14:23:45

+0

但該向導生成了所有的文本框。這就是整個事情,我無法訪問它生成的代碼,我無法告訴它將div標籤應用於certin文本框。所以,因爲嚮導是在div標籤,所以是所有的文本框... – kralco626 2010-09-24 18:49:44

0

這是以後你在做什麼:

<style> 
    input {border:0;} 
</style> 
+0

我不希望任何與邊界有關的事情。我想將背景設置爲透明。 – kralco626 2010-09-22 15:18:58

1

試試這個

input[type='text']{ 
border: none; 
background-color: transparent; 
} 
+0

我無法設置其屬性。他們在代碼中,我不能改變。有沒有一種方法,我可以說所有的文本框設置背景顏色透明? – kralco626 2010-09-22 15:19:47

+0

如果你堅持在你的風格標籤它應該這樣做。 – Olical 2010-09-22 15:20:24

+0

如果你仍然想要邊框,那麼只需要'border:none;'出。 – Olical 2010-09-22 15:26:40

0
input[type='text'] 
{ 
    border: none; 
    background-color: transparent; 
} 
0

試試這個:

在文檔的頭部:

<style type="text/css"> 

    div#someDiv input[type='text']{ 
    background-color: transparent; 
    } 

</style> 

然後用DIV包裝你的文本框,並給它一個ID

<div id="someDiv"> 
    <cc1:wizard id="wizCtl" runat="server"></cc1:wizard> 
</div> 
0
<asp:Content ID="Content1" ContentPlaceHolderID="bodyContent" Runat="Server"> 
<style type="text/css"> 
.heading { color:#007DC3; font-weight:300; font-size:1.5em; line-height:1.22em; margin-bottom:22px; } 
input[type='text']{ 
    border: none; 
    background-color: transparent; 
} 
</style> 
<cc1:wizard id="wizCtl" runat="server"></cc1:wizard> <!-- if this does transform into a text input, check the page source just to be certain --> 
</asp:Content>