How to move a form to the right area of the screen

1

Hello friends and been looking for about this problem that confuses me a lot because I'm starting with this why I'm sorry if the code is not quality.

My problem is that I have to move a contact form but in reality nothing comes to mind on how to do it.

Could someone help me? I have almost finished everything, I just need that.

Code:

out there I found that with the rule css position could be but I find nothing valuable.

<!DOCTYPE html>
<html>
<head>
    <title>Contacto</title>
    <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<style type="text/css">
    
    body{
   background-image:url(img/IMG_0139.JPG/);


    }
</style>
<body>

</body>
</html>

<?php
$action=$_REQUEST['action'];
if ($action=="")    /* display the contact form */
    {
    ?>
   <div style=" position:relative;" class="container">
    <form  action="" method="POST" enctype="multipart/form-data">
    <input for="usr" type="hidden" name="action" value="submit">
    Tu nombre:<br>
    <input name="name" type="text" value="" size="30"/><br>
    Tu email:<br>
    <input name="email" type="text" value="" size="30"/><br>
     Tu Direccion:<br>
    <input name="direccion" type="text" value="" size="30"/><br>
    Tu mensaje:<br>
    <textarea name="message" rows="7" cols="30"></textarea><br>
    <input type="submit" value="Send email"/>
    </form>
    </div>
    <?php
    } 
else                /* send the submitted data */
    {
    $name=$_REQUEST['name'];
    $direccion=$_REQUEST['direccion']
    $email=$_REQUEST['email'];
    $message=$_REQUEST['message'];
    if (($name=="")||($email=="")||($message==""))
        {
		echo "All fields are required, please fill <a href=\"\">the form</a> again.";
	    }
    else{		
	    $from="From: $name<$email>\r\nReturn-path: $email";
        $subject="CONTACTO CABALLO :)";
		 mail("[email protected]", $subject, $message,$direccion $from);
		echo "Email sent!";
	    }
    }  
?>
    
asked by simon 10.04.2017 в 01:30
source

2 answers

1

With bootstrap (I see you're using it) you can place it inside a column with the specific width by adding the class col-md-x where x represents the integer from 1 to 12 that identifies the width of the column.

Once this is done, you must complete the width of the content with the missing space:

<div class="col-md-6"></div> <!-- Columna vacía -->
<div class="col-md-6"><!-- Columna derecha con formulario -->
    <form  action="" method="POST" enctype="multipart/form-data">
        <input for="usr" type="hidden" name="action" value="submit">
        Tu nombre:<br>
        <input name="name" type="text" value="" size="30"/><br>
        Tu email:<br>
        <input name="email" type="text" value="" size="30"/><br>
        Tu Direccion:<br>
        <input name="direccion" type="text" value="" size="30"/><br>
        Tu mensaje:<br>
        <textarea name="message" rows="7" cols="30"></textarea><br>
        <input type="submit" value="Send email"/>
    </form>
</div>
    
answered by 10.04.2017 в 02:11
1

in the previous div to form it as follows:

<div style="position:absolute;right: 0;" class="container">
    
answered by 10.04.2017 в 08:02