<!DOCTYPE html>
<style>
div::first-line {
  background: orange;
}
</style>
<body>
  <div>
    First line.<br>
    Second line.
  </div>
  <div>
    First line in 1st block box.<br>
    Second line.
  </div>
  <div>
    First line in 2nd block box.<br>
    Second line.<br>
    First line after block-in-inline is not ::first-line.<br>
    Second line.
  </div>
</body>
