Cómo eliminar la clase css

I have a piece of code that is wrapped in a css class, the problem is that there is one particular line there that needs to be in the <span> but does not need the css class. How can I tell it to not take that css? for that line

<span id="myPrice" class="Price" runat="server">  
    <uc:CustomMessage ID="mPrice" MessageKey="myMsg" runat="server" /> //does not need css
    <span ><asp:Literal ID="litPrice" runat="server" /></span>

So as you can see the second line, we dont want the css applied to it.. but it needs to be within that "myPrice" span.

¿Hay una manera de lograr esto?


preguntado el 08 de noviembre de 11 a las 16:11

3 Respuestas

From a design standpoint it would be better to move the styling to the inner <span> instead, but if that's not possible you could probably exclude it like this:

.Price:not(input[type="button"]) { color:red; }

The above excludes buttons, but you can replace this with whatever element you need. Here's a more detailed reference:


respondido 08 nov., 11:20

Give your user control its own CSS class, and specify rules that undo the effect of Price.

<uc:CustomMessage CssClass="noStyles" ID="mPrice" MessageKey="myMsg" runat="server" />

Then, have a rule called noStyles that undoes any effects of Price.

respondido 08 nov., 11:20

Can you apply the css rule just to the first line ?

#myPrice #mPrice { your rule }

respondido 08 nov., 11:20

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.