<!DOCTYPE html>
<body>
  <p>First</p>
  <p>
    <style scoped>
      :scope { color: green }
    </style>
    <div>
      <style scoped>
        :scope { border: 2px solid black }
      </style>
      Second
    </div>
  </p>
  <p>Third</p>
</body>