if文で判定結果を出力するCSSの記述 ※if文の判定結果を出力する3パターン(.txt1、.txt2、.txt3)を用意しました。必要に応じて変更して下さい。 <style> body { font-size: 18px; text-align: center; } h1,h2{ text-align: center; font-size: 22px; line-height: 1.6em; padding-top: 20px; } h2{ font-size: 20px; padding-bottom: 30px; } div{ padding-bottom: 20px; } .txt1{ color: #007FFF; } .txt2{ color: #FF4D4D; } .txt3{ color: #FF9326; } </style> 変数がundefinedの場合のif文で判定
![JavaScriptで変数がundefinedの場合のif文で判定する方法|DAD UNION – エンジニア同盟](https://cdn-ak-scissors.b.st-hatena.com/image/square/4c44249e924dd9428e3308154672468bb966c398/height=288;version=1;width=512/https%3A%2F%2Fdad-union.com%2Fwp-content%2Fuploads%2F2022%2F09%2Fpic20220915.jpg)