HTML CSS ::BEFORE 위치 질문드립니다. 채택완료
</p>
<p><ul class="pd">
<li>
테스트
<ul>
<li>ㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱ</li>
<li>ㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴ</li></p>
<p> <li>ㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷ</li>
</ul>
</li></p>
<p></ul></p>
<p>
</p>
<p>.pd { counter-reset: colorcircle 0; }
.pd > li { position: relative; list-style: none; padding-left: 3rem; }
.pd > li+li { margin-top: 1.2rem }
.pd > li::before { position: absolute; top: 50%; left: 0.5rem; transform: translateY(-50%); counter-increment: colorcircle 1; content: counter(colorcircle); color: #fff; font-size: 1.5rem; z-index: 1; }
.pd > li::after { content: ''; position: absolute; top: 50%; left: 0; transform: translateY(-50%); display: inline-block; background-color: #f54; border-radius: 50%; width: 1.1em; height: 1.2em; }</p>
<p>
[캡처 사진]
http://sir.kr/data/editor/2405/237506203_1716432148.2561.jpg" width="100%" />
before, after 로 구성한 카운터 넘버링의 위치가
전체 중앙에 자리잡는데 이것을, 맨 위 텍스트에 위치를 못시키나요??
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
채택된 답변
+20 포인트
1년 전
</p>
<p><style>
.pd { counter-reset: colorcircle 0; }
.pd > li { position: relative; list-style: none; padding-left: 3rem; }
.pd > li+li { margin-top: 1.2rem }
.pd > li::before { position: absolute; top: 50%; left: 0.5rem; transform: translateY(-50%); counter-increment: colorcircle 1; content: counter(colorcircle); color: #fff; font-size: 1.5rem; z-index: 1; }
.pd > li::after { content: ''; position: absolute; top: 50%; left: 0; transform: translateY(-50%); display: inline-block; background-color: #f54; border-radius: 50%; width: 1.1em; height: 1.2em; }</p>
<p> </p>
<p>.pd > li::before, .pd > li::after {
top: calc(1.5rem * 0.5);
}
</style></p>
<p> </p>
<p><ul class="pd">
<li>
테스트
<ul>
<li>ㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱㄱ</li>
<li>ㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴㄴ</li>
<li>ㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷㄷ</li>
</ul>
</li>
</ul>
</p>
<p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인전체 질문 목록
채택
채택
채택
답변대기
채택
채택
채택
답변대기
답변대기
답변대기
채택
채택
채택
채택
채택
채택
채택
답변대기