• 카테고리

    질문 & 답변
  • 세부 분야

    웹 개발

  • 해결 여부

    해결됨

질문이 있습니다!

21.02.02 11:35 작성 조회수 112

0

복습하던 중에요.

<input type="checkbox" id="modal-switch">
<lable for="modal-switch"> // input을 위해 label이 존재 (왜? 인풋창을 설명하기 위해 이해를 돕기위해서)
	<span>modal 열고 닫기</span>
</label>
<style>
	.test {
		color: dodgerblue;
	}
	#modal-switch:checked ~.test {
		color: crimson;
	}
</style> // 원래는 html 상에 style 태그를 하면 좋지 않다. 잠시 테스트 할 때 편의상 사용한다.
<p class="test">TEST</p>
<p class="test">TEST</p>
<p class="test">TEST</p>
<div class="modal">
	<div clas="dialog">
		Lorem, ipsum dolor sit amet consectetur adipisicing elit. Repellat
	  labore, consectetur nihil commodi corrupti quasi accusantium autem!
		Illo consectetur ea sequi quo voluptatum nulla beatae vero at maiores
	  blanditiis. Aliquam vitae ex dicta praesentium nemo itaque soluta
	  corrupti voluptates quo!
	</div>
</div>

input과 label 태그 중간에 style 태그를 넣어주셨는데

가운데에 넣어주신 이유가 있을까요?

label 아래에 p태그가 이어져야 할 것 같은데 

갑자기 style이 들어온 느낌이라 

위로 올리던지 아래로 내리던지 위치는 상관없고

설명하시느라 중간에 넣으신건가요?

답변 1

답변을 작성해보세요.

1

아아 네, 설명중에 임시로 넣은 것이라서 중간에 넣었습니다.
정석은 아닙니다-ㅎㅎ