2
有一個例外文本導致這樣的:查找和環繞文字在另一個標籤
<span class='sException'>Exception throwed. Please check details:
Message:String was not recognized as a valid DateTime.
Stack: at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style) at ...
</span>
我想換一些文本(消息:,堆棧:它們之間和文本)使用CSS。所以我想這樣做的結果:
<span class='sException'>Exception throwed. Please check details:
<b>Message:</b><span class='sMessage'>String was not recognized as a valid DateTime.</span>
<b>Stack:</b><span class='stack'> at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style) at ... </span>
</span>
有沒有辦法用css做到這一點?
類似的東西:
.sException{ text-align:left; border:1px solid red; }
.sException[find text like 'Message:']{ display:block; font-weight:bold; text-indet:20px; }
.sException[find text after 'Message:']{ display:block; font-weight:normal; text-indet:30px; }
.sException[find text like 'Stack:']{ display:block; font-weight:bold; text-indet:20px; }
.sException[find text after 'Stack:']{ display:block; font-weight:normal; text-indet:30px; }
你的意思是使用jQuery? – 2010-07-28 06:21:55
通過CSS實現? – Reigel 2010-07-28 06:22:36
其實我更喜歡用css來解決這個問題,但我不相信我可以。這就是爲什麼我添加jQuery,因爲我認爲答案將在jQuery中。 – uzay95 2010-07-28 06:26:06