How to ignore CSS style from parent field?

I am trying to put some code in a full Html page where I set inside a frame. I feel obligated to use all this content in a box, because innet text has its own page and its own style.

I am looking for a way not to inherit a style from LayoutPage. I cannot link to the page because I need to use Razor to set some values ​​through the model.

What can I do to override all styles within a frame?

@model Contoso.Core.Exercises.TimesTables.Exercise1 <frame> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- Generated by WebWorksheet version 3.5.1 on 31/05/2013 www.webworksheet.com --> <html><head><meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <title>Times Tables</title> <script type='text/javascript'> var wwsRelease = 'http://webworksheet.com/release/030501'; var iterations = 3; var imageFolder = 'wwsImages'; var displayZeroes = true; var dbConnection = ''; var dbQueryScript = ''; var firstInput = 'iB54'; var datePickerAuto = ''; var datePickerImg = ''; var activeBorder = '2px solid black'; var activeBackground = 'transparent'; var lastBtnClick = ''; var protectPage = false; var webQueries = new Array(); </script> <script type='text/javascript' src='http://webworksheet.com/release/030501/webworksheet.js'></script> <style type='text/css'> @@media all { Body {overflow:auto;} A {text-decoration:none; cursor:pointer; color:inherit;} 
+4
source share
4 answers

Give different styles for the child for the same css property. how

.parent {

  background-color: green; 

}

.parent.child {

  background-color: red; 

}

+2
source

You can use the keyword !important; . For instance:

 text-decoration:none!important; 
0
source

If you use a class to give css to this particular tag, you can simply specify the class name as empty or another class that you want to use:

 document.getElementById("tagid").className = ""; 

OR

 document.getElementById("tagid").className = "class2"; 

And if you can use JQuery , then it is very simple to remove the parent class as follows:

 <script>$("tagid").removeClass("oldclass");</script> 

For more information on jQuery, click here .

0
source

For me, I could not recognize the .userLink class. Then I realized that it is under the DIV with id = # nav3, which in CSS already has the style defined for # div3 a . From Jazmin's answer above, I tried this and it has a class again.

 #nav3 .userLink { font-size: 0.8em; color: blue; } 
0
source

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


All Articles