hsla()CSS関数の使用法
Hue-Saturation-Lightnessモデル(HSL)を使用して色を定義するには、hsla()CSSメソッドを使用します。
次のコードを実行して、CSSでhsla()関数を実装してみてください
例
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
background-color:hsl(0,100%,50%);
}
h2 {
background-color:hsl(192,89%,48%);
}
p {
background-color:hsla(290,100%,50%,0.3);
}
</style>
</head>
<body>
<h1>Red Background</h1>
<h2>Blue Background</h2>
<p>This is demo text!</p>
</body>
</html> -
CSSのrotate()関数
CSSのrotate()関数は要素を回転させます。このパラメータは、回転の角度を設定します。値には、度、ラジアンなどがあります。 例 <!DOCTYPE html> <html> <head> <style> #demo1 {background-color: hsla(140, 100%, 50%, 0.8);} #demo2 {background-color: hsla(130, 100%, 50%, 0.6);} #demo3 {background-color: hsla(190, 100%, 50%, 0.4);} #demo4 {b
-
CSS rgba()関数
rgba()は、赤、緑、青、およびアルファのRGBAカラー値を定義します。アルファは色の不透明度、つまり0.0から1.0の間の数値です。ここで、1.0は完全に不透明になります。 例 rgba()関数を実装する例を見てみましょう- <!DOCTYPE html> <html> <head> <style> #demo1 {background-color: hsla(140, 100%, 50%, 0.8);} #demo2 {background-color: hsla(130, 100%, 50%, 0.6);} #demo3 {backgr