0

宝石の繭で作ったレールのリンクの位置を調整したいのですが、私の情報源では次のようになっています。

    <div class="fields">
    <a href="#" class="add_fields" data-association="answer" data-template="    &lt;div class=&quot;nested-fields&quot;&gt;
            &lt;label for=&quot;question_answers_attributes_new_answers_answer&quot;&gt;Answer&lt;/label&gt;
          &lt;input id=&quot;question_answers_attributes_new_answers_text&quot; name=&quot;question[answers_attributes][new_answers][text]&quot; size=&quot;30&quot; type=&quot;text&quot; /&gt;
            &lt;input id=&quot;question_answers_attributes_new_answers__destroy&quot; name=&quot;question[answers_attributes][new_answers][_destroy]&quot; type=&quot;hidden&quot; /&gt;&lt;a href=&quot;#&quot; class=&quot;remove_fields dynamic&quot;&gt;Remove&lt;/a&gt;
    &lt;/div&gt;

">Add Answer</a>
    </div>

CSSで「回答の追加」リンクを呼び出す方法を知っている人はいますか?私は試した:div.fields.add_fields a { css: code; }

しかし、それは何もしなかったようです...

よろしく、Thijs

4

1 に答える 1

1

これは簡単な css の質問です。単に

a.add_fields {}

aclass ですべてを選択しadd_fieldsます。ただ

.add_fields {}

通常でも十分です。

しかし、本当に厳密にしたい場合は、次のように書くことができます:

.fields a.add_fields {}

つまり、 class を持つものと、 classを持つ要素を.fieldsネストしたものです。a.add_fields

直接の子でなければならないと述べることさえできます:

.fields > a.add_fields {}

お役に立てれば。

于 2011-09-26T07:43:04.430 に答える