I am new to web programming and need some help. I am using this CSS code to control look of a label dynamically. how can I change the value of the attribute "width"from code behind dynamically?Also I need to flash the label text. Please find my code below
**strong text**
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<style type="text/css">
.bar {
position: relative;
width: 250px;
height: 25px;
text-align: center;
line-height: 25px;
background: #003458;
background: linear-gradient(to bottom, #005478 0%,#003747 100%);
color: white;
}
.bar:before {
position: absolute;
display: block;
top: 0;
left: 0;
bottom: 0;
width: 40%;**** this value needs to be changed from code behind.
content: '';
background: rgba(0, 255, 0, 0.1);
}
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label18" runat= "server" CssClass="bar">20%</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
Solutions would be appreciated.
Thank you in advance!
:beforeselector you are inserting content in the client side and server has no idea about it. I don't think you can change it from server.