CSSを使用してフォーム入力に背景色を追加します
フォーム入力に背景色を追加するには、 background-colorを使用します プロパティ。
次のコードを実行して、フォームに背景色プロパティを実装してみてください
<!DOCTYPE html>
<html>
<head>
<style>
input[type=text] {
width: 100%;
padding: 10px 15px;
margin: 5px 0;
box-sizing: border-box;
background-color: gray;
}
</style>
</head>
<body>
<p>Fill the below form,</p>
<form>
<label for = "subject">Subject</label>
<input type = "text" id = "subject" name = "sub">
<label for = "student">Student</label>
<input type = "text" id = "student" name = "stu">
</form>
</body>
</html> -
CSSを使用して全幅画像にフォームを追加するにはどうすればよいですか?
以下は、CSSを使用して全幅画像にフォームを追加するためのコードです- 例 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body, html { height: 100%; margin: 0; padding: 0; fon
-
CSScaret-colorでカーソルの色を変更する
挿入カレットの色を変更するには、CSScaret-colorプロパティ 使用されます。 例 次の例は、CSSのcaret-colorプロパティを示しています。 <!DOCTYPE html> <html> <head> <style> form { padding: 2%; margin: 2%; text-align: center; } form:focus-within { box-shadow: 0 0 10px rgba(0,0,0