Compiling contracts whose inherited contracts using a lower or higher compiler

The case like

pragma solidity ^0.7.0;

contract A {}

pragma solidity >=0.7.0 <0.8.4;

contract B is A {}

will the case work on remix?

You will be able to compile using any Solidity version that matches all available pragmas. in this particular case you will be able to use any version ^0.7.0, but not 0.8.

@frangio thanks for replying, but in this case, contract A is from the other project’s contracts, and I would like to integrate it into my own project which is contract B. In that case, I can’t change the version of contract A, but if possible, it has better to keep contract B at 0.8.