CSS does not apply to base page element with id link

I have a main page that has an associated css file. On one of the basic pages, I have a div to which I am trying to apply the style from this css file by id. However, the page has a different identifier for this element when rendering.

How to specify correct id name in css file?

Is there a way to indicate that I want the identifier of this element, as in javascript, using <% = Element.ClientID%>?

+3
source share
2 answers

class= "someClass" . , , , ,

#myContainer .someClass {
...
}
+2

CssClass . ID, .

<asp:Label id="lblTest" CssClass="label" runat="Server">Test</Label>

<div id="someid">
      <asp:Label id="lblTest" CssClass="label" runat="Server">Test</Label>
</div>
+3

Source: https://habr.com/ru/post/1737569/


All Articles