By GokiSoft.com| 21:22 16/10/2023|
Học HTML5 - CSS3

Bài tập - Thiết kế form gửi email - Lập trình HTML/CSS/JS

Phản hồi từ học viên

5

(Dựa trên đánh giá ngày hôm nay)

Nguyên Phấn Đông [community]
Nguyên Phấn Đông

2020-10-13 13:47:39


bai
<!DOCTYPE html>
<html>
<head>
	<title>E-mail Editor</title>
	<link rel="stylesheet" type="text/css" href="style4.css">
</head>
<body>
 <form id="main" action="#">
   <h1>Compose e-mail message</h1><br>
   <table>
   	<tr>
   		<td ><label for="to">To:</label></td>
   		<td><input type="text" name="to" value="" style="width:400px"/></td>
    </tr>
    <tr>
   		<td ><label for="form">From:</label></td>
   		<td><input type="text" name="form" value="" style="width:400px"/></td>
    </tr>
    <tr>
   		<td ><label for="Cc">Cc:</label></td>
   		<td><input type="text" name="Cc" value="" style="width:400px"/></td>
    </tr>
    <tr>
   		<td ><label for="subject">Subject:</label></td>
   		<td><input type="text" name="Subject" value="" style="width:400px"/></td>
    </tr>
    <tr>
   		<td ><label for="message">Message:</label></td>
   		<td><textarea rows="10" cols="55" name="comment" form="usrform" class="scroll" > Nhập văn bản...</textarea></td>
    </tr>
   </table> 
  <a href="status.html"> <input type="submit" name=""></a>
    <input type="submit" id="register_0" value="Canner"/>
 </form>&nbsp;&nbsp;&nbsp;&nbsp;
<div class="dropdown">
  <button id="myBtn" class="dropbtn"><img src="help.jpg"></button>
  <div id="myDropdown" class="dropdown-content">
    <h2 style="margin-left: 10px"> -: E-mail Editor Help:-</h2>
    <div style="margin-left: 60px;">
    <b><img src="bullet.jpg"> To and Cc:</b><br>
    <b>To</b> and <b>Cc</b> boxes allow you to enter the e-mail addresses of the recepients to whom to message has to be sent. Recipients will be able to see who else was sent the message by looking at the contents of the <b>To</b> and <b>Cc</b> boxes.<br>
    <b><img src="bullet.jpg"> Subject:</b><br>
    The <b>Subject</b> box allows you to enter meaningful summary of the message. <br>
    <b><img src="bullet.jpg"> Message:</b><br>
    The <b>Message</b> TextArea allow you to enter the text of your message.
</div>
<a href="" style="float: right;color: blue;cursor: hand" >close</a>
  </div>
</div>
<script>
document.getElementById("myBtn").onclick = function() {myFunction()};
function myFunction() {
  document.getElementById("myDropdown").classList.toggle("show");
}
</script>

</body>
</html>
style4.html


body{
	background-color: rgb(255,255,240);
	padding-left: 20%;
	float: left;
}
.textarea{
    scroll-behavior: auto;
    scrollbar-shadow-color: silver;
    scrollbar-arrow-color: black;
    scrollbar-face-color: gray;
}
.emaileditor{
	background-color:  #FFFFDD;
}
#main{
	width: 500px;
	background-color: #DDFFEE;
	padding-left: 10px;
	padding-right:  10px;
	text-align: center;	
	float: left;
}
.scroll{
            display:block;
            border: 1px solid black;
            padding:5px;
            margin-top:5px;
            width:390px;
            height:150px;
            overflow:scroll;
         }

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  width: 500px;
  height: 420px;
  background-color: #cfc;
	padding-left: 10px;
	padding-right:  10px;
	color: #303030;
	border: 2px solid black;
}
.clean{
	clear: all;
}
.show {display:block;}



Nguyễn Tiến Đạt [T2008A]
Nguyễn Tiến Đạt

2020-10-12 15:47:44


#bullet.jpg


https://res.cloudinary.com/wegoup/image/upload/v1602517659/yz1xk7mdqcpibynzm7go.jpg


#help.html


<!DOCTYPE html>
<html>
<head>
	<title>E-mail Editor</title>
	<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
	<div id="help">
		<div class="put" style="padding-bottom: 2px;">
			-: E-mail Editor Help :-
		</div>
		<ul class="trang2">
			<li> 
				<b style="margin-left: 5px">To and Cc:</b>
				<br>
				<div style="margin-left: -20px;text-align: left;">
					<b>To</b> and <b>Cc</b> boxes allow you to enter the e-mail addresses of the recepients to whom to message has to be sent. Recipients will be able to see who else was sent the message by looking at the contents of the <b>To</b> and <b>Cc</b> boxes.
				</div>
			</li>
			<li> 
				<b style="margin-left: 5px">Subject:</b>
				<br>
				<div style="margin-left: -20px;text-align: left;">
					The <b>Subject</b> box allows you to enter meaningful summary of the message.
				</div>
			</li>
			<li> 
				<b style="margin-left: 5px">Message:</b>
				<br>
				<div style="margin-left: -20px;text-align: left;">
					The <b>Message</b> TextArea allow you to enter the text of your message.
				</div>
			</li>
		</ul>
		<div id="close">
			<a href="index.html" style="text-decoration: none;color: blue">Close</a>
		</div>
	</div>
</body>
</html>


#Help.jpg


https://res.cloudinary.com/wegoup/image/upload/v1602517659/bo5wiiapuy1jltc47vxn.jpg


#index.css


body{
	background-color: rgb(255,255,240);
	padding-left: 20%;
}
.textarea{
	overflow: auto;
}
.imgHelp{
	cursor: help;
}
.EmailEditor{
	background-color:  #FFFFDD;
}
#main{
	width: 400px;
	background-color: #DDFFEE;
	padding-left: 10px;
	padding-right: 10px; 
}
#help{
	position: absolute;
	width: 500px;
	height: 420px;
	top: 10px;
	background-color: #cfc;
	padding-left: 10px;
	padding-right: 10px;
	border: solid 2px #303030;
}
#close{
	text-align: right;
	color: blue;
	cursor: hand;
}
ul.trang2{
	list-style-image: url(bullet.jpg);
	list-style-type: square;
}
form{
	margin-left: 20px;
}
.put{
	padding-top:17px;
	padding-bottom: 13px;
	font-size: 25px;
	font-weight: bold;
}
li.dat{
	margin-left: -91px;
    width: 386px;
    list-style-type: none;
    text-align: right;
    padding-bottom: 5px;
}
.cancel{
	margin-left: 95px;
	margin-top: -16.5px;
}
.send{
	position: absolute;
	top: 217px;
	left: 387px;
}
.help{
	position: absolute;
	top: 28px;
    right: 695px;
    font-size: 20px;
    font-family:arial;
    color: #2c24d1;
    font-weight: bold;
}
span.dat{
	background-color: #DDFFEE;
	text-decoration: none;
}
a{
	text-decoration: none;
}


#index.html


<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>E-mail Editor</title>
	<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
	<div id="main">
		<div class="put">
			Compose e-mail message.
		</div>
		<form>
			<ul>
				<li class="dat">To: <input type="e-mail" name="receiver" size="40px" class="EmailEditor"></li>	
				<li class="dat">From: <input type="e-mail" name="sender" size="40px" class="EmailEditor"></li>
				<li class="dat">Cc: <input type="text" name="Cc" size="40px" class="EmailEditor"></li>
				<li class="dat">Subject: <input type="text" name="Subject" size="40px" class="EmailEditor"></li>
				<li class="dat">Message: <input type="message" name="Subject" size="40px" class="EmailEditor" class="textarea"></li>
			</ul>
			<div class="cancel">
				<button>Cancel</button>
	    	</div>
		</form>
		<div class="send">
	    		<a href="success.html"><button>Send</button></a>
	    </div>
	    <div class="help">
		<a href="help.html" class="imgHelp"><span class="dat">Help</span></a>
		</div>
	</div>
</body>
</html>


#success.html


<!DOCTYPE html>
<html>
<head>
	<title>E-mail Editor</title>
</head>
<body>
	<h1>Your message has been successfully sent.</h1>
</body>
</html>