Advertisement
gtw7375

CSS - Aline - formulario

Mar 10th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 6.51 KB | None | 0 0
  1. http://www.designadaptavel.com.br/artigos/layout-fluido-ou-liquido
  2.  
  3. <!DOCTYPE html>
  4. <html lang="en">
  5. <head>
  6.     <meta charset="UTF-8">
  7.     <meta name="viewport" content="width=device-width, initial-scale:1.0">
  8.  
  9.     <style>
  10.    
  11.      
  12.    
  13.  
  14.    
  15.     #principeira{
  16.    
  17.     width:50%;
  18.     height:380px;
  19.     border:0px solid black;
  20.     position:absolute;
  21.     top:22%;
  22.     left: 24%;
  23.     background-color:red;
  24.    
  25.     max-width:960px;/* limita o crescimento do layout a até 960px */
  26.  
  27.     min-width:300px;
  28.    
  29.     }
  30.    
  31.     #secundeira{
  32.    
  33.     background-color: blue;
  34.     width:95%;
  35.     height:355px;
  36.     border:1px solid black;
  37.     position:relative;
  38.     top:3%;
  39.     left: 2%;
  40.  
  41.      
  42.      
  43.     max-width:960px;/* limita o crescimento do layout a até 960px */
  44.  
  45.     min-width:300px;
  46.    
  47.     }
  48.    
  49.     p {
  50.    
  51.     line-height:200%;
  52.    
  53.     }
  54.    
  55.     #caixa_codigo {
  56.    
  57.     position:relative;
  58.     left: 0%;
  59.     width: 13%;
  60.    
  61.     }
  62.    
  63.     #caixa_nome {
  64.    
  65.     position:relative;
  66.     left: 0%;
  67.     width: 66%;
  68.    
  69.     }
  70.    
  71.    
  72.     #caixa_endereco{
  73.    
  74.     position:relative;
  75.     left: 2%;
  76.     width: 86%;
  77.    
  78.     }
  79.    
  80.     #caixa_bairro{
  81.    
  82.     position:relative;
  83.     left: 3%;
  84.     width: 88%;
  85.    
  86.     }
  87.    
  88.     #caixa_cep{
  89.    
  90.     position:relative;
  91.     left:3%;
  92.     width: 30%;
  93.    
  94.     }
  95.    
  96.     #caixa_telefone{
  97.    
  98.     position:relative;
  99.     left: 8%;
  100.     width:41%;
  101.    
  102.     }
  103.    
  104.     #caixa_cidade{
  105.    
  106.     position:relative;
  107.     left:3%;
  108.     width: 29%;
  109.    
  110.     }
  111.    
  112.     #caixa_select{
  113.    
  114.     position:relative;
  115.     left:9%;
  116.     width: 44%;
  117.    
  118.     }
  119.    
  120.     #caixa_descricao{
  121.    
  122.     position:relative;
  123.     margin-top: 1%;
  124.     margin-left: 4%;
  125.    
  126.     width:80%;
  127.    
  128.    
  129.     resize:none;
  130.    
  131.     }
  132.    
  133.     #des {
  134.    
  135.     position:relative;
  136.     maring-top:15%;
  137.    
  138.     }
  139.    
  140.    
  141.    
  142.     #tel {  position:relative;  left:7%; }
  143.     #est {  position:relative;  left:7%; }
  144.    
  145.    
  146.    
  147.    
  148.     #botao_cadastro{
  149.     background-color: #00FF00;
  150.     width: 30%;
  151.     height: 60px;      
  152.     }
  153.    
  154.     #botao_excluir{
  155.     background-color: #FF0000;
  156.     width: 30%;
  157.     height: 60px;      
  158.     }
  159.    
  160.     body {
  161.    
  162.     background-color: #E6E6FA;
  163.    
  164.     }
  165.    
  166.    
  167.     @media screen and (max-width:1330px){
  168.    
  169.         #botao_cadastro {
  170.        
  171.             background-color: red;
  172.        
  173.         }
  174.        
  175.         #principeira{
  176.    
  177.             height:500px;
  178.             }
  179.            
  180.         #secundeira{
  181.    
  182.             height: 470px;
  183.         }
  184.     }
  185.    
  186.     @media screen and (max-width:968px){
  187.    
  188.         #botao_cadastro {
  189.        
  190.             background-color: green;
  191.        
  192.         }
  193.        
  194.         #principeira{
  195.    
  196.             height:600px;
  197.             }
  198.            
  199.         #secundeira{
  200.    
  201.             height: 570px;
  202.         }
  203.     }
  204.    
  205.     </style>
  206.  
  207.     <script>
  208.         function limitarCodigo(e){              
  209.        
  210.         var evt = e.charCode;  
  211.         var valid_chars = '0123456789';                     // criando a lista de teclas permitidas
  212.         var chr = String.fromCharCode(evt);                 // pegando a tecla digitada
  213.         if (valid_chars.indexOf(chr)>-1 ){return true;}     // se a tecla estiver na lista de permissão permite-a
  214.            
  215.                  
  216.             return false;   // do contrário nega
  217.         }
  218.        
  219.         function limitarNome(e){            
  220.        
  221.         var evt = e.charCode;  
  222.         var valid_chars = 'abcdefghijlmnopqrstuvxzwykABCDEFGHIJLMNOPQRSTUVXZWYKãçéêõúíÃÇÉÊÕÚÍ';    // criando a lista de teclas permitidas
  223.         var chr = String.fromCharCode(evt);                                                      // pegando a tecla digitada
  224.         if (valid_chars.indexOf(chr)>-1 ){return true;}                                         // se a tecla estiver na lista de permissão permite-a
  225.        
  226.         if(valid_chars.indexOf(chr)>30 || evt<35) {return true;}                                // Tecla Espaço
  227.             return false;   // do contrário nega
  228.         }
  229.        
  230.         function limitarCep(e){            
  231.      
  232.         var evt = e.charCode;  
  233.         var valid_chars = '0123456789';                     // criando a lista de teclas permitidas
  234.         var chr = String.fromCharCode(evt);                 // pegando a tecla digitada
  235.         if (valid_chars.indexOf(chr)>-1 ){return true;}     // se a tecla estiver na lista de permissão permite-a
  236.            
  237.            
  238.        
  239.             return false;   // do contrário nega
  240.         }
  241.        
  242.         function limitarTelefone(e){            
  243.        
  244.         var evt = e.charCode;  
  245.         var valid_chars = '0123456789';                     // criando a lista de teclas permitidas
  246.         var chr = String.fromCharCode(evt);                 // pegando a tecla digitada
  247.         if (valid_chars.indexOf(chr)>-1 ){return true;}     // se a tecla estiver na lista de permissão permite-a
  248.            
  249.            
  250.        
  251.             return false;   // do contrário nega
  252.         }
  253.  
  254. </script>
  255.  
  256.  
  257. </head>
  258. <body>
  259.    
  260.     <br>
  261.         <center> <h1> CADASTRANDO O CADASTRO </h1> </center>
  262.  
  263.         <form type="submit">
  264.     <div id="principeira">
  265.       <div id="secundeira">
  266.    
  267.                
  268.    
  269.    
  270.                 <p>
  271.                 Codigo*: <input type="text" id="caixa_codigo" required="required" maxlength="5" onKeyPress="return limitarCodigo(event);"></input>
  272.                 Nome*: <input type="text"  id="caixa_nome"required="required" onKeyPress="return limitarNome(event)"/>
  273.                
  274.                 Endereco: <input type="text"  id="caixa_endereco"/> <br>
  275.                 Bairro:  <input type="text"  id="caixa_bairro"/><br>
  276.                 CEP*:  <input type="text"  required="required" id="caixa_cep" onKeyPress="return limitarCep(event)"/>
  277.                 <a id="tel">Telefone*:</a>  <input type="tel"  required="required" id="caixa_telefone" onKeyPress="return limitarTelefone(event)"/><br>
  278.                 Cidade:  <input type="text"   id="caixa_cidade"/>
  279.                 <a id="est">Estado:</a>
  280.                 <select id="caixa_select">
  281.                     <option> Selecione </option>
  282.                     <option> Acre </option>
  283.                     <option> Alagoas </option>
  284.                     <option> Amapa </option>
  285.                     <option> Amazonas </option>
  286.                     <option> Bahia </option>
  287.                     <option> Distrito Federal </option>
  288.                     <option> Espirtio Santo </option>
  289.                     <option> Goias </option>
  290.                     <option> Maranhao </option>
  291.                     <option> Mato Grosso </option>
  292.                     <option> Mato Grosso do Sul </option>
  293.                     <option> Minas Gerais </option>
  294.                     <option> Para </option>
  295.                     <option> Paraiba </option>
  296.                     <option> Parana </option>
  297.                     <option> Pernambuco </option>
  298.                     <option> Piaui </option>
  299.                     <option> Rio de Janeiro </option>
  300.                     <option> Rio Grande do Norte </option>
  301.                     <option> Rio Grande do Sul </option>
  302.                     <option> Rondonia </option>
  303.                     <option> Roraima </option>
  304.                     <option> Santa Catarina </option>
  305.                     <option> Sao Paulo </option>
  306.                     <option> Sergipe </option>
  307.                     <option> Tocantins </option>
  308.                 </select> <br>
  309.                
  310.                 <a id="des"> Descrição: </a>  <textarea id="caixa_descricao" placeholder="Insira aqui informações adicionais..."  rows="5" cols="70"></textarea>
  311.                    
  312.                    
  313.                
  314.                
  315.                 </p>
  316.                
  317.                 <center>
  318.                
  319.                 <input type="reset" id="botao_excluir" value="Limpar"></input>
  320.                 <input type="submit" id="botao_cadastro" value="Cadastrar"></input>
  321.            
  322.                 </center>
  323.       </div>
  324.     </div>
  325.     </form>
  326.                
  327.    
  328.  
  329.  
  330. </center>
  331. </body>
  332. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement