在文字控件中为文本应用css样式 [英] applying css styles for the text inside the literal control

查看:107
本文介绍了在文字控件中为文本应用css样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在中继器的文字控件中绑定了一些值...

< asp:文字ID ="lit_eng_title" runat ="server" Text =''<%#DataBinder.Eval(Container,"Dataitem.name_e")%>''>


但是我需要对文本应用css ...我不知道如何为文字添加css类...请帮助我

I have binded some values in the literal control inside my repeater...

<asp:Literal ID="lit_eng_title" runat="server" Text=''<%# DataBinder.Eval(Container,"Dataitem.name_e")%>''>


But i need to apply css for the text......i dono how to add css class for the literal...please help me

推荐答案

尝试添加CSS ...
在访问ID时用ID制作一个隐藏列,并应生成ID,然后继续进行操作....
try to add css...
make one hidden column with ID while accessing it the ID should be generated and procesw to be move on....


在这里使用直接div或span而不是Literal.
Use direct div or span instead of Literal here.
<span class="myClass"><![CDATA[<%# DataBinder.Eval(Container,"Dataitem.name_e")%>]]></span>


这篇关于在文字控件中为文本应用css样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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