<style type = "text / css"> body {color: # 0f0; font-weight: normal; } div> span {color: # f00; } </ style> <! - then through the conditional comments we include instructions for IE6 and less, they love it -> <! - [if lte IE 6]> <style type = "text / css"> div span {color: # f00; } / * rules similar to those for child selectors * / div * span {color: # 0f0; } / * reset to default values * / </ style> <! [endif] -> <div> <span> the text of this span is red, because located directly on the div tag </ span> </ div> <div> <p> <span> for this span the text is green, because inside the div it is nested in another tag </ span> </ p> </ div>
Source: https://habr.com/ru/post/40316/
All Articles