When should I use this:
header.classname
and when should I use this:
header .classname
And what is the difference between the two?
header.classnamemeans you are targeting a heading having a class like classname.
classname
header .classnamemeans you are targeting an html element with a class classnamethat is a descendant / descendant of the header
1st case:
header.hclassname { background: turquoise; }
<header class="hclassname"> Lorem Ipsum <div class="divclassname">Dolor</div> Sit Amet </header>
Second case
header .divclassname { background: skyblue; }
Use header.classnamewhen: you want to target on .classnamewhich is the item header.
.classname
header
Use header .classnamewhen: you want to target the .classnamedescendants of an element header.
, , , .
Source: https://habr.com/ru/post/1653631/More articles:React Native application continues to close on Android emulator - androidHow to stop interval from observable - rx-javaAlamofire Parse Response Data When Verification Fails - alamofireWhat is the difference between saveArg and saveArgPointee in gmock? - c ++Html5 Canvas "Composite layers" causing long frames - javascriptHow to build a dictionary of string lengths using a for loop? - pythonSyntaxError: multiple statements found when compiling a single statement - pythonКак отсортировать элементы массива ArrayList в соответствии со своими значениями ascii? - javaWhere should I use the method before loading Jqgrid and after loading the grid to lock the screen? - javascriptChange form style in Bootstrap for validation - javascriptAll Articles