📖 리액트/리액트를 다루는 기술

2022. 05.02

놀러와요 버그의 숲 2022. 5. 2. 20:41
728x90
반응형
<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>replit</title>
  <link href="style.css" rel="stylesheet" type="text/css" />
</head>

<style> 

.box {
  &.red {
    //1번 경우 box이면서 red
  }
  .red {
    //2번경우 box안에서 red
  }
}

.box.red { // 1번과 동일}

.box .red { // 2번과 동일 }

.box, .red {}

</style>
<body>
  <div class="box red">
    <div class="small-box red"></div>
  </div>
  <div class="box blue"></div>
  <div class="box yellow"></div>
  <script src="script.js"></script>
</body>

</html>