You can point the div element to the runat = "server" tag and access it in code (this is HtmlGenericControl.
You can get / set the Style property for the div control via ".Style.Value".
<div id="Foo" runat="server"></div>
CodeBehind example:
string myStyle = Foo.Style.Value;
Foo.Style.Value = "padding: 0px;";
source
share