0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

19.擬似クラス

Posted at
index.html
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="utf8">
    <title>はじめてのCSS</title>
    <meta name="description" content="初めてCSSを勉強するサイトです。">
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <ul>
        <li><a href="https://google.com" target="new">Google</p></li>
        <li><a href="https://www.yahoo.co.jp" target="new">Yahoo</p></li>
        <li><a href="https://www.apple.com" target="new">Apple</p></li>
    </ul>
    <h2>習い事ランキング</h2>
    <ol>
        <li>プログラミング</li>
        <li>水泳</li>
        <li>サッカー</li>
    </ol>
    
    <h2>学校の授業</h2>
    <ul>
        <li>国語</li>
        <li>算数</li>
        <li>理科</li>
        <li>社会</li>
    </ul>
</body>
</html>

style.css
ol li:first-child {
  color: red;
}

ul li:last-child {
  color: blue;
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?