初心者向けjQuery入門

初心者向けjQuery入門講座です

未分類

疑似クラスと疑似要素

投稿日:2017年8月2日 更新日:

疑似クラスと疑似要素

疑似クラス

疑似クラスとは疑似的に処理をセレクタに追加するものです。
:をつけます。
疑似クラス一覧
:active
:any
:checked
:default
:dir()
:disabled
:empty
:enabled
:first
:first-child
:first-of-type
:fullscreen
:focus
:hover
:indeterminate
:in-range
:invalid
:lang()
:last-child
:last-of-type
:left
:link
:not()
:nth-child()
:nth-last-child()
:nth-last-of-type()
:nth-of-type()
:only-child

疑似要素

疑似要素はセレクタに追加するものは同じですが名前と書き方が違います。
::をふたつつけます。

疑似要素一覧
::after
::before
::first-letter
::first-line
::selection
::backdrop

あんまり無づかしく考えず個別に処理を覚えて使えるようにしときましょう。

スポンサードリンク




スポンサードリンク




-未分類
-

執筆者:


comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

jQuery attrとremoveAttr属性の取得と設定と削除

jQuery attrとremoveAttr属性の取得と設定と削除 attrはattributeの略ですね。 英語で属性という意味です。 jQuery attr属性の設定する サンプル $(&#822 …

no image

jQuery showとhideで要素を表示と非表示する方法

jQuery showとhideで要素を表示と非表示する方法 jQuery show 要素を表示する方法 showの英語の意味は見せるです。 サンプル $(“セレクタ”).sh …

no image

jQuery mouseoverとmouseoutマウスイベントの方法

Query mouseoverとmouseoutマウスイベントの方法 Query mouseoverマウスを乗せた時のイベントの方法 mouseoverはマウスを要素に乗せた時に発生するイベントです。 …

no image

jQuery 子孫セレクタとユニバーサルセレクタと複数

jQuery 子孫セレクタとユニバーサルセレクタと複数 jQuery 子孫セレクタ 子孫セレクタとは 要素には親要素と子要素があります。 ulだと子はliですね。 それとdivの中にp要素を入れ子にし …

no image

jQuery:notセレクタの使い方

jQuery jQuery:notセレクタの使い方 jQuery jQuery:notセレクタの使い方 :notセレクタは条件を指定した以外の要素を指定します。 :not(h2) 使用方法はセレクタに …