我今天尝试使用“帮助类样式”编写CSS,Twitter上的许多开发人员表示这是一种不良做法。
这是一个例子:
<span class="et-margin-top-30 et-width-400 et-display-inline">
<p class="et-common-frame-shadow et-inner-img-shadow">
<img class="et-common-frame-img" src="img3.jpg"/>
</p>
<h3 class="et-margin-top-10 et-fontsize-26 et-fontweight-bold">foo</h3>
<p class="et-margin-top-10">bar</p>
</span>
Run Code Online (Sandbox Code Playgroud)
为什么这是一个不好的做法?谁能告诉?我们什么时候应该使用.clear之类的帮助器类?
我试图用jQuery输出html.
$('body').append('
<div>
<div>
<div></div>
</div>
</div>
');
Run Code Online (Sandbox Code Playgroud)
我希望以这种方式缩进代码以提高可读性.它适用于PHP但不适用于JS,任何想法?我使用notepad ++作为编辑器.
我写这个脚本来改变textarea的值,但我没有这样做.我的代码出了什么问题?
<html>
<head>
<script type="text/javascript">
document.getElementsByName("status").innerHTML = "hi";
document.getElementsByName("status").title= "hi";
document.getElementsByName("status").placeholder= "hi";
</script>
</head>
<body>
<textarea placeholder="What's on your mind?" onfocus="window.UIComposer && UIComposer.focusInstance("c4d981e9a2c98b0483252333");" name="status" id="c4d981e9a2c98b0483252333_input" title="What's on your mind?" class="DOMControl_placeholder UIComposer_TextArea">What's on your mind?</textarea>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)