How to fetch the background of DIV on a bottom layer with exact position using jQuery and CSS

前端 未结 7 1588
时光取名叫无心
时光取名叫无心 2021-02-01 23:48

I\'m looking to make a page that has a background gradient that changes color every few seconds and blends between transitions. Now I want to apply this effect on the to the upp

7条回答
  •  旧时难觅i
    2021-02-02 00:04

    This might be helpful for you according to my understanding

    There is inherit to copy a certain value from a parent to its children, but there is no property the other way round (which would involve another selector to decide which style to revert).

    You will have to revert style changes manually:

    div { color: green; }
    
    form div { color: red; }
    
    form div div.content { color: green; }
    

    If you have access to the markup, you can add several classes to style precisely what you need:

    form div.sub { color: red; }
    
    form div div.content { /* remains green */ }
    

    Edit: The CSS Working Group is up to something:

    div.content {
      all: default;
    }
    

提交回复
热议问题