0

Mi página es la la primera imagen y debo dejarla como la segunda imagen: introducir la descripción de la imagen aquí

introducir la descripción de la imagen aquí

.globalWrapper {
	width: 1024px;
	background-color: #DFAFF9;
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	padding-top: 10px;
	padding-bottom: 50px;
}

.wrapperMain{
	width: 90%;
	margin-left: auto;
	margin-right: auto;
	background-color: #FEF9CF;
	padding-top: 10px;
	padding-left: 10px;
	padding-right: 10px;
	padding-bottom: 10px;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
}
#backgroundHeader img{
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
	padding: 0px;
}

.textoImagen{
    position: absolute;
    top: 10px;
    left: 10px;
    margin-left: 110px;
    margin-top: 40px;
}


#headerImage>img{
    position: absolute;
    top: 21px;
    right: 150px;
    background-image: url("imgs/header.png");
    width:20%;
    height:150px;
}

img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: 80%;
}

#title1{
	font-size: 30px;
	line-height: 10%;
	color: white;
	font-family: Arial, Helvetica, sans-serif;
}

#title2{
	font-size: 20px;
	line-height: 10%;
	color: orange;
	font-family: Arial, Helvetica, sans-serif;
}

#bar {
	margin-left: auto;
	margin-right: auto;
	background-color: #E49C32 !important;
	height: 40px;
	width: 100%;
}

#lorem {
	color: #432366;
	font-size: 30px;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	line-height: 10%;
	margin-left:5px;
}

#ranaImage>img{
		width: 45%;
}

#ranaImage img{
		width: 100%;
}


#parrafo{
	 width: 50%;
	 float: right;
	 text-align: justify;
}

.myButton {
	background-color:#44c767;
	-moz-border-radius:28px;
	-webkit-border-radius:28px;
	border-radius:28px;
	border:1px solid #18ab29;
	display:inline-block;
	cursor:pointer;
	color:#ffffff;
	font-family:Arial;
	font-size:17px;
	padding:16px 31px;
	text-decoration:none;
	text-shadow:0px 1px 0px #2f6627;
	position: relative;
	float: left;
}
.myButton:hover {
	background-color:#5cbf2a;
}
.myButton:active {
	position:relative;
	top:1px;
}

.colorBackground{
		background-color:#44c767;
}

.box {
  display: inline-block;
  width: 45%;
  margin: 1%;
}


table {
	border-collapse: collapse;
	border: solid;
}

footer {
	width: 96%;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
	background-color: #B5B2A0;
	padding: 15px;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px; 
}

#textFooter{
	color: #44C767;
	font-family:Arial;
	font-size:17px;
	text-decoration:none;
	text-shadow:0px 1px 0px #2f6627;
}
<!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	    <link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div class="globalWrapper">
	<div class="wrapperMain">
		<section id="header">
			<header>
			 <div id="backgroundHeader">
			 		<img src="imgs/fondo.png" alt="fondo encabezado" title="fondo encabezado"/>
			 		<div id="headerImage">
			 			<img src="imgs/header.png" alt="loros" title="loros"/>
			 		</div>
			 		<div class="textoImagen">
			 			<h1 id="title1">Carlos Acevedo</h1>
						<h2 id="title2">Tecnólogo ADSI</h2>
			 		</div>
			 </div>
		  </header>
		</section>
		<section>
			<div id="bar">
			</div>
			<div>
					<p id="lorem">Lorem ipsum</p>
			</div>
		</section>
		<section>
			<div class="box" id="ranaImage">
					<img src="imgs/rana.jpg" alt="rana" title="rana"/>
			</div>
				<div class="box" id="parrafo">
					<p>
						Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
					</p>
					<a href="#" class="myButton">Perspiciate</a>
				</div>	
		</section>
		<section>
			<article class="box">
				 <table>
					  <tr class="colorBackground">
					    <th>Header</th>
					    <th>Header</th>
					    <th>Header</th>
					  </tr>
					  <tr>
					    <td>Data</td>
					    <td>Data</td>
					    <td>Data</td>
					  </tr>
					  <tr>
					    <td>Data</td>
					    <td>Data</td>
					    <td>Data</td>
					  </tr>
					  <tr>
					  	<td>Data</td>	
					    <td>Data</td>
					    <td>Data</td>
					  </tr>
					</table> 
			</article>
			<article class="box">
			   <form method="POST" action="">
			   	<p>
			   		Autenticar
			   	</p>
			   	<p>
			   		<input type="text" value="" required="6" placeholder="usuario" title="Usuario"/>
						<br/>
						<input name="usuario" type="radio" value="u" checked />Usuario<br/>
						<input name="administrador" type="radio" value="a" />Administrador<br/>
						<br/>			
			   	</p>	
			   	<div>
			   			<a href="#" class="myButton">Log in</a>
			   			<a href="#" class="myButton">Reset</a>
			   	</div>		
			</article>
		</section>
		<footer id="textFooter">
	   			Copyright © 2018 <strong>All Right Reserveds</strong>
		</footer>	
	</div>	
</div>
</body>
</html>

1
  • intenta usar la propiedad flotante de css { float: rigth;} el 28 may. 2018 a las 23:19

2 respuestas 2

1

Sí lo único que necesitas es alinear a la derecha los elementos indicados, lo puedes hacer agregando un text-align: right a la clase que contiene el formulario, en este caso al article que tiene la clase box.

.box {
    text-align: right;
}
1
  • Eso no va a solucionarlo, ya que solo lo va a acomodar en la derceha del div, y no de la pantalla.
    – user166844
    el 16 jun. 2020 a las 9:19
1

Lo primero que hay que hacer es contener esos elementos dentro de un div, de esta manera al aplicar margin solo se van a mover los elementos y no el div completo. Ya que los elementos toman el div donde están contenidos como punto de referencia.

HTML:

<div id="derecha">
    <p>
        Autenticar
    </p>
    <p>
        <input type="text" value="" required="6" placeholder="usuario" title="Usuario"/>
            <br/>
            <input name="usuario" type="radio" value="u" checked />Usuario<br/>
            <input name="administrador" type="radio" value="a" />Administrador<br/>
            <br/>           
    </p>    
    <div>
            <a href="#" class="myButton">Log in</a>
            <a href="#" class="myButton">Reset</a>
    </div>
</div>

Después de esto hay que aplicar el margin en el CSS, mas especifico el margin-left, ya que queremos que los elementos en cuestión queden en la derecha. Esto se hace en el div que contiene los elementos.

CSS:

#derecha {
    margin-left: 1200px;
}

Nota: Puedes disminuir o aumentar los pixels (px). Para que quede a tu gusto.

El código final:

HTML:

<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="cerote.css">
</head>
<body>
<div class="globalWrapper">
    <div class="wrapperMain">
        <section id="header">
            <header>
             <div id="backgroundHeader">
                    <img src="imgs/fondo.png" alt="fondo encabezado" title="fondo encabezado"/>
                    <div id="headerImage">
                        <img src="imgs/header.png" alt="loros" title="loros"/>
                    </div>
                    <div class="textoImagen">
                        <h1 id="title1">Carlos Acevedo</h1>
                        <h2 id="title2">Tecnólogo ADSI</h2>
                    </div>
             </div>
          </header>
        </section>
        <section>
            <div id="bar">
            </div>
            <div>
                    <p id="lorem">Lorem ipsum</p>
            </div>
        </section>
        <section>
            <div class="box" id="ranaImage">
                    <img src="imgs/rana.jpg" alt="rana" title="rana"/>
            </div>
                <div class="box" id="parrafo">
                    <p>
                        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
                    </p>
                    <a href="#" class="myButton">Perspiciate</a>
                </div>  
        </section>
        <section>
            <article class="box">
                 <table>
                      <tr class="colorBackground">
                        <th>Header</th>
                        <th>Header</th>
                        <th>Header</th>
                      </tr>
                      <tr>
                        <td>Data</td>
                        <td>Data</td>
                        <td>Data</td>
                      </tr>
                      <tr>
                        <td>Data</td>
                        <td>Data</td>
                        <td>Data</td>
                      </tr>
                      <tr>
                        <td>Data</td>   
                        <td>Data</td>
                        <td>Data</td>
                      </tr>
                    </table> 
            </article>
            <article class="box">
               <form method="POST" action="">
                <div id="derecha">
                    <p>
                        Autenticar
                    </p>
                    <p>
                        <input type="text" value="" required="6" placeholder="usuario" title="Usuario"/>
                            <br/>
                            <input name="usuario" type="radio" value="u" checked />Usuario<br/>
                            <input name="administrador" type="radio" value="a" />Administrador<br/>
                            <br/>           
                    </p>    
                    <div>
                            <a href="#" class="myButton">Log in</a>
                            <a href="#" class="myButton">Reset</a>
                    </div>
                </div>      
            </article>
        </section>
        <footer id="textFooter">
                Copyright © 2018 <strong>All Right Reserveds</strong>
        </footer>   
    </div>  
</div>
</body>
</html>

CSS:

.globalWrapper {
    width: 1024px;
    background-color: #DFAFF9;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-top: 10px;
    padding-bottom: 50px;
}

.wrapperMain{
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    background-color: #FEF9CF;
    padding-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 10px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
#backgroundHeader img{
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    padding: 0px;
}

.textoImagen{
    position: absolute;
    top: 10px;
    left: 10px;
    margin-left: 110px;
    margin-top: 40px;
}


#headerImage>img{
    position: absolute;
    top: 21px;
    right: 150px;
    background-image: url("imgs/header.png");
    width:20%;
    height:150px;
}

img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: 80%;
}

#title1{
    font-size: 30px;
    line-height: 10%;
    color: white;
    font-family: Arial, Helvetica, sans-serif;
}

#title2{
    font-size: 20px;
    line-height: 10%;
    color: orange;
    font-family: Arial, Helvetica, sans-serif;
}

#bar {
    margin-left: auto;
    margin-right: auto;
    background-color: #E49C32 !important;
    height: 40px;
    width: 100%;
}

#lorem {
    color: #432366;
    font-size: 30px;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 10%;
    margin-left:5px;
}

#ranaImage>img{
        width: 45%;
}

#ranaImage img{
        width: 100%;
}


#parrafo{
     width: 50%;
     float: right;
     text-align: justify;
}

.myButton {
    background-color:#44c767;
    -moz-border-radius:28px;
    -webkit-border-radius:28px;
    border-radius:28px;
    border:1px solid #18ab29;
    display:inline-block;
    cursor:pointer;
    color:#ffffff;
    font-family:Arial;
    font-size:17px;
    padding:16px 31px;
    text-decoration:none;
    text-shadow:0px 1px 0px #2f6627;
    position: relative;
    float: left;
}
.myButton:hover {
    background-color:#5cbf2a;
}
.myButton:active {
    position:relative;
    top:1px;
}

.colorBackground{
        background-color:#44c767;
}

.box {
  display: inline-block;
  width: 45%;
  margin: 1%;
}


table {
    border-collapse: collapse;
    border: solid;
}

footer {
    width: 96%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    background-color: #B5B2A0;
    padding: 15px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px; 
}

#textFooter{
    color: #44C767;
    font-family:Arial;
    font-size:17px;
    text-decoration:none;
    text-shadow:0px 1px 0px #2f6627;
}

#derecha {
    margin-left: 1200px;
}

Salu3 xD

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.