Latest web development tutorials

HTML DOM 스타일 속성을 인용

스타일 객체 참조 스타일 개체

정의 및 사용

따옴표는 속성 집합을 인용 또는 포함 된 참조의 유형을 반환합니다.

문법

따옴표 속성 설정 :

Object.style.quotes="none|string string string string|inherit"

위로 속성을 인용한다 :

Object.style.quotes

描述
none 默认。规定 "content" 属性的 "open-quote" 和 "close-quote" 的值不会产生任何引号。
string string string string 规定要使用的引号。前两个值规定第一级引用嵌套,后两个值规定下一级引号嵌套。
inherit quotes 属性的值从父元素继承。


브라우저 지원

Internet ExplorerFirefoxOperaGoogle ChromeSafari

모든 주요 브라우저는 인터넷 익스플로러와 사파리뿐만 아니라, 따옴표 속성을 지원합니다.


따옴표를 변경 :

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(){
    document.getElementById("q1").style.quotes="'<' '>' '[start]' '[end]'";
}
</script>
</head>
<body>

<q id="q1">这是一个<q>引号元素</q> 在其他的引号元素内。</q>
<br>
<button type="button" onclick="displayResult()">修改引号标记</button>
<p><b>注意:</b> 这个例子在IE和Safari不工作。</p>

</body>
</html>

»시도


스타일 객체 참조 스타일 개체