小编ben*_*one的帖子

CSS Helper类的使用

我今天尝试使用“帮助类样式”编写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之类的帮助器类?

css abstraction helper

2
推荐指数
1
解决办法
1030
查看次数

Javascript中的HTML字符串换行符

我试图用jQuery输出html.

$('body').append('
<div>
  <div>
    <div></div>
  </div>
</div>
');
Run Code Online (Sandbox Code Playgroud)

我希望以这种方式缩进代码以提高可读性.它适用于PHP但不适用于JS,任何想法?我使用notepad ++作为编辑器.

javascript indentation

1
推荐指数
1
解决办法
4192
查看次数

改变textarea的价值

我写这个脚本来改变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 &amp;&amp; UIComposer.focusInstance(&quot;c4d981e9a2c98b0483252333&quot;);" 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)

javascript

1
推荐指数
2
解决办法
3万
查看次数

标签 统计

javascript ×2

abstraction ×1

css ×1

helper ×1

indentation ×1