2016-10-06 2 views
1

Я делаю проект, но мне нужна помощь в моей форме. Я делаю короткое текстовое окно описания и размер, который у меня есть, насколько большой я хочу, но мой текст начинается посередине. Кроме того, при вводе текста выходит за рамки. Я не хочу, чтобы текст оставался на одной строке, я хочу, чтобы он содержался в ящике.HTML-тег формы, текст должен оставаться внутри текстового поля

<!DOCTYPE html> 

<html lang="en"> 
<head> 
    <title>Centennial College|Creating Student Profile</title> 
    <meta charset="utf-8"> 
    <style id="navStyle"> 
     /*I got some help on this coding from w3schools.*/ 
     #image2{ 
      position: absolute; height: 100px; 
     } 
     #navigationList{ 
      list-style-type: none; 
      margin: 0; 
      padding:0; 
      overflow:hidden; 
      background-image: url(Images/background_header.jpg); 
      position: absolute; left: 310px; height: 100px; width:950px; 
      font-weight: bold; 
     } 
     .links{ 
      float:left; 
      position: relative; top: 30px; 
     } 
     .links a{ 
      display:block; 
      color:white; 
      text-align: center; 
      padding: 10px 50px; 
      text-decoration: none; 
     } 
     /*When someone hovers over the link the colour goes black*/ 
     .links a:hover{ 
      background-color:#c6f22c; 
      color: #45473e; 
     } 
     .links .active{ 
      color:#6b8112; 
     } 

    </style> 

    <style id="bodyStyle"> 
     #headerImage img{ 
      width: 1245px; 
     } 
     body{ 
      background-color:#464646; 
      font-family:cursive, sans-serif; 
      color:#464646; 
     } 
     forms{ 
      color: #464646; 
      font-size: 20px; 
      background-color:floralwhite; 
      display: inline-block; 
     } 
     #formSection h1, h3{ 
      color:aliceblue; 
     } 
     #description{ 
      height: 150px; 
      width: 100%; 
     } 
    </style> 
</head> 
<body> 
    <div class="Navigation"> 
     <!--Navigation Links with Logo. All Style code is in style sheets.--> 
     <img id="image2" src="Images/Logo.jpg" alt="Centennial Logo" /> 

     <ul id="navigationList"> 
      <li class="links"><a href="index.html">Home Page</a></li> 

      <li class="links"><a class="active" href="creatstudentprofile.html">Create Student Profile</a></li> 

      <li class="links"><a href="viewmyperformance.html">View My Performance</a></li> 
     </ul> 
    </div> 

    <div id="headerImage"> 
     <img src="Images/ecentennial-students.jpg" alt="Header Picture"/> 
    </div> 

    <div id="formSection" style="margin:0 auto; width:75%; text-align: center;"> 
     <h1>Enter the information below to create your student profile!</h1> 
     <h3>Create your Student Profile:</h3> 
     <forms> 
      <fieldset> 
       <legend>Student Profile</legend> 
       Name: 
       <br> 
       <input type="text" name="name" size="40"> 
       <br> 
       Email Address: 
       <br> 
       <input type="email" name="email" size="40"> 
       <br> 
       Year: 
       <br> 
       <select id="year" name="Year"> 
        <option value="year1">Year 1</option> 
        <option value="year2">Year 2</option> 
        <option value="year3">Year 3</option> 
       </select> 
       <br> 
       <input type="radio" name="computerType" value="mac">Mac 
       <input type="radio" name="computerType" value="pc">PC 
       <br> 
       Brief Description: 
       <br> 
       <input type="text" name="Description" size="40" id="description"> 
       <br> 
       <input type="Submit" value="Submit"> 
      </fieldset> 
     </forms> 
    </div> 
</body> 
</html> 
+0

Попробуйте использовать, например текстовой: user1211

ответ

0

Souns мне, что вы хотите, чтобы ваш input вести себя так, как textarea. Вы должны просто использовать его вместо этого.

<textarea id="description" name="Description"></textarea>

+0

спасибо так много! Я не делал кодирования со средней школы, я полностью забыл о текстовой области. –

Смежные вопросы