Computer Science, asked by nikitajbade32, 9 months ago

2) Write Html5 code with CSS as
follows-
1. To create form to accept
name, age,
email address,
from the user.
2. Create a submit button to
send the data.
3. The heading of the form
should have a background
colour and a different font
style.

Answers

Answered by srajfaroquee
149

Answer:

Code

<html>

   <head>

       <title>HTML forms</title>

       <style type="text/css" >  

       

       h2{

           font-family:elephant;

           background-color: aqua;

           padding-left: 50%;

       }

       form {

           padding: 20px;

       }

       

       #name {

           margin-left:17px;

       }

       #email {

           margin-left: 12px;

       }

       #age {

           margin-left: 30px;

       }

       

       

       </style>

   </head>

<body>

<h2>HTML Forms</h2>

<form  action="#">

 <label for="fname">Name:</label>

 <input type="text" id="name" name="name" placeholder="Name"><br><br>

 <label for="email">E-mail:</label>

 <input type="text" id="email" name="email" placeholder="E-mail" ><br><br>

 <label for="age">Age:</label>

 <input type="text" id="age" name="age" placeholder="Age" ><br><br>

 <input type="submit" value="Submit">

</form>  

<p>If you click the "Submit" button, the page will be redirect to this page itself.</p>

</body>

</html>

Please follow me and mark this ans as Branliest answer.Thank you!

Answered by sarahssynergy
5

Given below are the HTML and CSS programs for the required format.

Explanation:

  • <html>
  • <head>
  • <style>
  • #head{
  •    background- color: red;
  •    font- style: italic;
  • }
  • </style>
  • </head>
  • <body>
  • <h1 id="head">Form heading </h1>
  • <form>
  • <label for="fname"> NAME: </label>
  • <label for="age"> AGE: </label>
  • <label for="mail"> E-MAIL: </label>  
  • <input type="text" id="fname" name="fname"> <br>
  • <input type="number" id="age" name="age"> <br>
  • <input type="email" id="mail" name="mail"> <br>
  • <input type="submit" value="submit"><br>
  • </form>
  • </body>
  • </html>

Similar questions