들여쓰기를 설정하려면 textIndent 재산.
예시
다음 코드를 실행하여 JavaScript로 텍스트의 첫 번째 줄 들여쓰기를 반환할 수 있습니다.
<!DOCTYPE html>
<html>
<body>
<div id = "myText">
This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text.
</div>
<br>
<button onclick = "display()">Set Text Indent</button>
<script>
function display() {
document.getElementById("myText").style.textIndent = "50px";
}
</script>
</body>
</html>