By GokiSoft.com| 23:37 05/06/2020|
Học HTML5 - CSS3

[Share Code] - Hướng dẫn tạo form gửi mail html5/css - Javascript BT1567

Hướng dẫn chữa bài tập

Examination & Test + Ôn tập HTML/CSS/JS - Lập Trình HTML5/CSS/JS



#custom.js


function showHelp() {
	var helpTag = document.getElementById('help')
	helpTag.style.display = 'block';

	var mainTag = document.getElementById('main')
	mainTag.style.display = 'none';
}

function closeHelp() {
	var helpTag = document.getElementById('help')
	helpTag.style.display = 'none';

	var mainTag = document.getElementById('main')
	mainTag.style.display = 'block';
}


#EmailEditor.html


<!DOCTYPE html>
<html>
<head>
	<title>Email Editor - Online</title>
	<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
	<div id="main">
		<label class="title">Compose Email - Message</label>
		<label class="button-help" onclick="showHelp()">HELP</label>
		<form method="post" action="status.html">
			<div class="item">
				<span>To: </span>
				<input type="text" name="to" class="email-editor">
			</div>
			<div class="item">
				<span>From: </span>
				<input type="text" name="from" class="email-editor">
			</div>
			<div class="item">
				<span>Cc: </span>
				<input type="text" name="cc" class="email-editor">
			</div>
			<div class="item">
				<span>Subject: </span>
				<input type="text" name="subject" class="email-editor">
			</div>
			<div class="item">
				<span>Message: </span>
				<textarea name="message" rows="5" class="email-editor"></textarea>
			</div>
			<div class="item">
				<span></span>
				<button>Send</button>
				<button>Cancel</button>
			</div>
		</form>
	</div>
	<div id="help">
		<h2>Help ...</h2>
		<ul>
			<li>Line 1</li>
			<li>Line 1</li>
			<li>Line 1</li>
			<li>Line 1</li>
			<li>Line 1</li>
			<li>Line 1</li>
		</ul>
		<label class="close" onclick="closeHelp()">Close</label>
	</div>

	<script type="text/javascript" src="custom.js"></script>
</body>
</html>


#status.html


<!DOCTYPE html>
<html>
<head>
	<title>Status Page</title>
</head>
<body>
	<h1>Welcome To Page</h1>
</body>
</html>


#style.css


body {
	background-mau: rgb(255,255,240);
}

textarea {
	scrollbar-3dlight-mau: #C0C0C0;
	scrollbar-shadow-mau: silver;
	scrollbar-arrow-mau: black;
	scrollbar-face-mau: gray;
	width: 80%;
	float: left;
}

.img-help {
	cursor: help;
}

.email-editor {
	background-mau: #FFFFDD;
}

#main {
	width: 400px;
	background-mau: #DDFFEE;
	padding-right: 10px;
	padding-left: 10px;
	margin: auto;
}

#help {
	width: 550px;
	height: 420px;
	top: 10px;
	background-mau: #cfc;
	padding-right: 10px;
	padding-left: 10px;
	display: none;
	border: solid 2px #E4E7E7;
	mau: #303030;
	margin: auto;
}

.close {
	text-align: right;
	mau: blue;
	cursor: pointer;
	float: right;
}

ul {
	/*https://res.cloudinary.com/ziczacgroup/image/upload/v1591359637/mtflqtbxgkt25cpy8k7i.jpg*/
	list-style: square inside url('https://res.cloudinary.com/ziczacgroup/image/upload/v1591359637/mtflqtbxgkt25cpy8k7i.jpg');
}

span {
	width: 20%;
	float: left;
	text-align: right;
	padding-right: 10px;
}

input {
	width: 80%;
	float: left;
}

.item {
	width: 100%;
	display: flex;
	margin-bottom: 15px;
	padding-bottom: 15px;
}

button {
	float: left;
	margin: 0px;
	margin-right: 10px;
}



.button-help {
	float: right;
	font-weight: bold;
	margin-top: 20px;
	margin-bottom: 20px;
	font-size: 22px;
	cursor: pointer;
}

.title {
	float: left;
	font-weight: bold;
	margin-top: 20px;
	margin-bottom: 20px;
	font-size: 22px;
}


Liên kết rút gọn:

https://gokisoft.com/1567

Bình luận