CSSでの:first-child疑似クラスの使用
次のコードを実行して、:first-child疑似クラス-
の使用法を理解することができます。<html>
<head>
<style>
div > p:first-child
{
text-indent: 25px;
}
</style>
</head>
<body>
<div>
<p>First paragraph in div. This paragraph will be indented</p>
<p>Second paragraph in div. This paragraph will not be indented</p>
</div>
<p>But it will not match the paragraph in this HTML:</p>
<div>
<h3>Heading</h3>
<p>The first paragraph inside the div. This paragraph will not be effected.</p>
</div>
</body>
</html> -
CSSの使用法align-contentプロパティflex-startvalue
align-contentを使用します 値がflex-startのプロパティ 最初にフレックスラインを設定します。 例 次のコードを実行して、 flex-startを実装してみてください。 値- <!DOCTYPE html> <html> <head> <style> .mycontainer { display: flex;
-
CSSの:first-child疑似クラス
CSS:first-child pseudo-classは、他の要素の最初の子要素である要素を選択します。 構文 以下は構文です- :first-child{ /*declarations*/ } 例 CSSの最初の子の疑似クラスの例を見てみましょう- <!DOCTYPE html> <html> <head> <style> table { margin: auto; padding: 10px; border: hsl(54, 100%