How can I center my image + text and keep responsive? - html

here's the result I'd like to obtain once I'm reducing the window :
the problem in this result is that they aren't centered, once I center them that's what I get, I guess I'm doing something wrong : the issue. This code is the one that cause the issue when they're centered.
Here's my code :
section {
margin-top: 25px;
padding: 24px;
box-sizing: border-box;
}
h2 {
margin-bottom: 30px;
text-align: center;
font-weight: bold;
font-size: 22px;
}
.flex-container {
display: flex;
flex-direction: column;
align-content: flex-start;
height: 100%;
padding: 15x;
}
.flex-container > div{
position: relative;
left: 21%;
border-radius: 5px;
padding: 8px;
}
.articleactu img {
float: left;
border-radius: 15px;
max-width: 210px;
}
p {
word-wrap: break-word;
max-width: 900px;
padding-left: 200px;
}
#titre {
line-height: px;
font-weight: bold;
}
#date {
font-size: 14px;
font-weight: bold;
color: #662189;
}
hr.solid {
position: relative;
left: 21%;
width: 50%;
opacity: 12%;
}
div p ,#titre ,#date {
margin-left: 35px;
}
<!-- ACTUALITÉ - ARTICLES -->
<section>
<h2> L'ACTUALITÉ </h2>
<article class="articleactu">
<div class="flex-container">
<div>
<img src="images/gtaarticle.jpeg" alt="Article GTA " class="center">
<p id="titre">GTA : THE TRILOGY DEFINITIVE EDITION, les fans sont déçus !</p>
<p> Les joueurs attendaient une refonte complète de la trilogie afin de rappeler de lointains souvenirs mais malheureusement les fans sont déçus...</p>
<p id="date"> Publié le 27 novembre 2021 </p>
</div>
<hr class="solid">
<div>
<img src="images/bf2042-2.jpg" alt="Article GTA " class="center">
<p id="titre">BATTLEFIELD 2042 : De très mauvaise notes pour le nouvel opus.</p>
<p> Le lancement du jeu est malheureusement un raté... Un jeu rempli de bugs, on repense évidemment à Cyberpunk 2077...</p>
<p id="date"> Publié le 26 novembre 2021 </p>
</div>
<hr class="solid">
</article>
</section>
I hope that anyone can help me with this. Thanks in advance !

The main reason is
.flex-container > div{
left: 21%;
}
Then, that div has full width(100%) but the left position has 21%. So the content will look on the left side.
Try like this.
section {
margin-top: 25px;
padding: 24px;
box-sizing: border-box;
}
h2 {
margin-bottom: 30px;
text-align: center;
font-weight: bold;
font-size: 22px;
}
.flex-container {
display: flex;
flex-direction: column;
align-content: flex-start;
height: 100%;
padding: 10%;
}
.flex-container > div {
display: flex;
}
.flex-container > div > div {
float: left;
}
.description {
margin-left: 20px;
}
.articleactu img {
border-radius: 15px;
max-width: 210px;
}
p {
word-wrap: break-word;
}
#titre {
line-height: px;
font-weight: bold;
}
#date {
font-size: 14px;
font-weight: bold;
color: #662189;
}
hr.solid {
position: relative;
width: 50%;
opacity: 12%;
}
your HTML
<section>
<h2> L'ACTUALITÉ </h2>
<article class="articleactu">
<div class="flex-container">
<div style="display: flex">
<div>
<img src="images/gtaarticle.jpeg" alt="Article GTA " class="center">
</div>
<div class="description">
<p id="titre">GTA : THE TRILOGY DEFINITIVE EDITION, les fans sont déçus !</p>
<p> Les joueurs attendaient une refonte complète de la trilogie afin de rappeler de lointains souvenirs mais malheureusement les fans sont déçus...</p>
<p id="date"> Publié le 27 novembre 2021 </p>
</div>
</div>
<hr class="solid">
<div>
<div>
<img src="images/bf2042-2.jpg" alt="Article GTA " class="center">
</div>
<div class="description">
<p id="titre">BATTLEFIELD 2042 : De très mauvaise notes pour le nouvel opus.</p>
<p> Le lancement du jeu est malheureusement un raté... Un jeu rempli de bugs, on repense évidemment à Cyberpunk 2077...</p>
<p id="date"> Publié le 26 novembre 2021 </p>
</div>
</div>
<hr class="solid">
</div>
</article>
</section>

Related

Impossible to enter values via an input

I would like to enter a value into the input, but nothing happens. However, after 2 clicks the image is selected automatically.
I don't understand why I can't enter values in the input? I think it's an HTML/CSS problem?
Here is a screenshot
Thank you very much for your help and your time.
ol.wrapper_digipass {
margin: 0 0 0 15px;
padding: 0;
}
.title_digipass {
font-weight: 700;
padding-bottom: 5px;
}
.information_digipass {
padding-top: 5px;
}
.instruction_digipass {
list-style: circle;
padding-bottom: 10px;
font-size: 14px;
display: flex;
flex-direction: column;
gap: 10px;
}
.logoDigipass {
position: relative;
height: 110px;
width: 130px;
}
.logoDigipass img {
position: absolute;
top: -31px;
left: -12px;
}
.logoDigipass1 {
position: relative;
padding: 0;
}
.logoDigipass1 img {
height: 125px;
margin-left: -25px;
}
.wrapper_digipass {
position: relative;
}
.section_instruction {
margin-top: -60px;
padding-bottom: 35px;
}
.width30 {
width: 30%;
}
.width42 {
width: 42%;
}
.width434 {
width: 434px
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="section_digipass">
<ol class="wrapper_digipass">
<li class="title_digipass">Utilisez votre digipass.</li>
<p class="information_digipass">Après avoir réactivé votre digipass et introduit votre code PIN, celui-ci demande quelle application vous souhaitez utiliser.</p>
<ul class="instruction_digipass">
<li>Appuyez sur le chiffre "2"</li>
<li>Introduisez d'abord les 6 <u>chiffres</u> soulignés extraits du code SVM du titre <u>000347075</u> , qui sont <strong>007075</strong></li>
<li>Introduisez le nombre de titres de l'opération, donc 10, suivant le format : <strong>000010</strong></li>
<li>Le digipass vous fournit un code de 6 chiffres à introduire dans la zone de confirmation</li>
</ul>
<li class="title_digipass">Introduisez le code de 6 chiffres affichés par le digipass.</li>
<div class="wrapper_digipass">
<div class="logoDigipass1">
<img src="https://via.placeholder.com/150">
</div>
<div class="section_instruction">
<div class="row">
<div class="col-6 col-form-label text-end width42">
<label for="code">Code de confirmation</label>
</div>
<div class="col-4 width434">
<input type="text " id="code" name="code" class="form-control d-inline width30 "> et cliquez ensuite sur <strong>"Confirmer ".</strong>
</div>
</div>
</div>
</div>
</ol>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
As others suggested in the comments above, logoDigipass1 is overlapping section_instruction.
To solve this problem add this to your CSS:
.section_instruction {
position: relative; /* Add this */
z-index: 1; /* Add this */
}
See the snippet below.
ol.wrapper_digipass {
margin: 0 0 0 15px;
padding: 0;
}
.title_digipass {
font-weight: 700;
padding-bottom: 5px;
}
.information_digipass {
padding-top: 5px;
}
.instruction_digipass {
list-style: circle;
padding-bottom: 10px;
font-size: 14px;
display: flex;
flex-direction: column;
gap: 10px;
}
.logoDigipass {
position: relative;
height: 110px;
width: 130px;
}
.logoDigipass img {
position: absolute;
top: -31px;
left: -12px;
}
.logoDigipass1 {
position: relative;
padding: 0;
}
.logoDigipass1 img {
height: 125px;
margin-left: -25px;
}
.wrapper_digipass {
position: relative;
}
.section_instruction {
margin-top: -60px;
padding-bottom: 35px;
position: relative; /* Add this */
z-index: 1; /* Add this */
}
.width30 {
width: 30%;
}
.width42 {
width: 42%;
}
.width434 {
width: 434px
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="section_digipass">
<ol class="wrapper_digipass">
<li class="title_digipass">Utilisez votre digipass.</li>
<p class="information_digipass">Après avoir réactivé votre digipass et introduit votre code PIN, celui-ci demande quelle application vous souhaitez utiliser.</p>
<ul class="instruction_digipass">
<li>Appuyez sur le chiffre "2"</li>
<li>Introduisez d'abord les 6 <u>chiffres</u> soulignés extraits du code SVM du titre <u>000347075</u> , qui sont <strong>007075</strong></li>
<li>Introduisez le nombre de titres de l'opération, donc 10, suivant le format : <strong>000010</strong></li>
<li>Le digipass vous fournit un code de 6 chiffres à introduire dans la zone de confirmation</li>
</ul>
<li class="title_digipass">Introduisez le code de 6 chiffres affichés par le digipass.</li>
<div class="wrapper_digipass">
<div class="logoDigipass1">
<img src="https://via.placeholder.com/150">
</div>
<div class="section_instruction">
<div class="row">
<div class="col-6 col-form-label text-end width42">
<label for="code">Code de confirmation</label>
</div>
<div class="col-4 width434">
<input type="text " id="code" name="code" class="form-control d-inline width30 "> et cliquez ensuite sur <strong>"Confirmer ".</strong>
</div>
</div>
</div>
</div>
</ol>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>

How to align two divs with html css?

I would like to align two divs but it's not working.
<!DOCTYPE html>
<html lang="fr">
<head>
<title>ELOUANN'S SITE</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../css/index.css"/>
<link rel="icon" type="image/png" href="../img/webdev.png"/>
</head>
<body>
<div id="headDiv">
<div id="headDivTitle">
<img src="../img/webdev.png" width="10%"/><a class="trait">|</a><a>ELOUANN'S SITE</a>
</div>
<div id="headDivFile">
<a id="indexFile" href="./index.html">Accueil</a>
<a class="next">></a>
<a class="anyfile">...</a>
</div>
</div>
<div id="contentDiv">
<div id="rightDiv" class="content">
<div id="rightDivDescription">
<div id="border">
<a>Bienvenue ! Ici tu vas pouvoir apprendre quelques éléments de base du HTML et du CSS, ainsi que l'accès à un memento qui te permettra d'avoir une liste de chaque éléments de chaque langage accompagné d'une description, afin de pouvoir les utiliser à des fins personnelles !</a>
</div>
</div>
</div>
<div id="buttonsDiv" class="content">
<div id="buttonsDivHtml">
<img src="../img/languages/030-html-5.png" width="10%"/>Apprendre le HTML
</div>
<div id="buttonsDivCss">
<img src="../img/languages/031-css.png" width="10%"/>Apprendre le CSS
</div>
</div>
</div>
</body>
</html>
This is my html file. I would like align "buttonsDiv" and "rightDiv".
This is my css file :
/* STYLE DU TITRE ET DE L'IMAGE */
body{
background-color: #efecca;
font-family: Bahnschrift Light;
}
body div#headDiv{
background-color: #002f2f;
padding-top: 2%;
padding-left: 5%;
padding-bottom: 2%;
box-shadow: 0px 0px 100px black;
}
body div#headDiv div#headDivTitle a{
vertical-align: middle;
font-size: 250%;
color: #e6e2af;
}
body div#headDiv div#headDivTitle img{
vertical-align: middle;
}
body div#headDiv div#headDivTitle a.trait{
font-size: 420%;
margin-left: 1.5%;
margin-right: 3%;
color: #6f6c52;
}
/* STYLE DU TEXTE DES FICHIERS */
body div#headDiv div#headDivFile {
margin-left: 7%;
margin-top: 3%;
}
body div#headDiv div#headDivFile a{
font-size: 150%;
color: #e6e2af;
}
body div#headDiv div#headDivFile a.next{
font-size: 170%;
margin: 5%;
color: #6f6c52;
}
/* STYLE DE LA BOITE DE DROITE ET DE LA DESCRIPTION */
body div#contentDiv div#rightDiv{
background-color: #002f2f;
margin-top: 2%;
margin-bottom: 2%;
box-shadow: 0px 0px 10px black;
margin-right: 80%;
font-size: 175%;
}
body div#contentDiv div#rightDiv div#rightDivDescription{
padding: 10%;
color: #e6e2af;
}
body div#contentDiv div#rightDiv div#rightDivDescription div#border{
box-shadow: -10px 0px 0px #046380;
}
/* STYLE DES BOUTONS */
body div#contentDiv div#buttonsDiv div img{
vertical-align: middle;
}
body div#contentDiv div#buttonsDiv div a{
vertical-align: middle;
}
and when i use this, it gives me that :
https://cdn.discordapp.com/attachments/760957022686019625/760957040775397406/unknown.png
Please help me soon. Thanks you all. Bye
I would suggest you to make a few changes:
don't use margin-right in #rightDiv. Instead you can use width: 20%; if you want that much width is acquired by the div. Also use float: left;. May be you will get your intended result.

How to position <hr> in a DIV

How to put the line <hr> about 15 px above the bottom of the text block somewhere between button and bottom textblock?
.box {
background: white;
float: right;
position: relative
}
.space {
padding: 15px;
}
img {
max-width: 100%;
}
.button {
position: absolute;
bottom: 40px;
margin-left: 15px;
}
#media (max-width:768px) {
.button {
position: relative;
bottom: auto;
margin-left: 15px;
}
}
<div class="box">
<img class="box" src="https://d2f0ora2gkri0g.cloudfront.net/e4/16/e4164876-1967-4303-9a57-aae00eb2b22b.png" alt="oproeien" style="margin-right:0px; margin-left:0px">
<h2 class="space">Amsterdam</h2>
<p class="space">Amsterdam is de (titulaire) hoofdstad en naar inwonertal de grooteeuw tot stadsuitbreidingen, waaronder de laatste grachten van de fortificatie die nu als grachtengordel bekend is en in 2010 is toegevoegd aan de UNESCO-Werelderfgoedlijst.</p>
<a class="button" href="https://www.buienradar.nl">Slecht weer</a>
<hr>
</div>
Why not simply border on text that you can easily control with padding:
.box {
background: white;
float: right;
position: relative
}
.space {
padding: 15px;
}
p.space {
border-bottom:1px solid #000;
}
img {
max-width: 100%;
}
.button {
position: absolute;
bottom: 40px;
margin-left: 15px;
}
#media (max-width:768px) {
.button {
position: relative;
bottom: auto;
margin-left: 15px;
}
}
<div class="box">
<img class="box" src="https://d2f0ora2gkri0g.cloudfront.net/e4/16/e4164876-1967-4303-9a57-aae00eb2b22b.png" alt="oproeien" style="margin-right:0px; margin-left:0px">
<h2 class="space">Amsterdam</h2>
<p class="space">Amsterdam is de (titulaire) hoofdstad en naar inwonertal de grooteeuw tot stadsuitbreidingen, waaronder de laatste grachten van de fortificatie die nu als grachtengordel bekend is en in 2010 is toegevoegd aan de UNESCO-Werelderfgoedlijst.</p>
<a class="button" href="https://www.buienradar.nl">Slecht weer</a>
</div>
And if you want to control the width of the line you can consider a linear-gradient trick (or pseudo-element):
.box {
background: white;
float: right;
position: relative
}
.space {
padding: 15px;
}
p.space {
background:linear-gradient(to bottom,transparent calc(100% - 1px),#000 0) 0 0/50% 100% no-repeat;
}
img {
max-width: 100%;
}
.button {
position: absolute;
bottom: 40px;
margin-left: 15px;
}
#media (max-width:768px) {
.button {
position: relative;
bottom: auto;
margin-left: 15px;
}
}
<div class="box">
<img class="box" src="https://d2f0ora2gkri0g.cloudfront.net/e4/16/e4164876-1967-4303-9a57-aae00eb2b22b.png" alt="oproeien" style="margin-right:0px; margin-left:0px">
<h2 class="space">Amsterdam</h2>
<p class="space">Amsterdam is de (titulaire) hoofdstad en naar inwonertal de grooteeuw tot stadsuitbreidingen, waaronder de laatste grachten van de fortificatie die nu als grachtengordel bekend is en in 2010 is toegevoegd aan de UNESCO-Werelderfgoedlijst.</p>
<a class="button" href="https://www.buienradar.nl">Slecht weer</a>
</div>

How can i center a dropdown menu bar?

I want the bar to remain such as this, but the three menu options (along with the drop-down ) pass be at the center of the page.
The page have some img's (including de menu bar) that is not included.
header, footer, aside, nav, article {
display: block;
}
header h1{
color: #670C15;
text-align: center;
}
body {
margin: 0 auto;
width: 940px;
font: 13px/22px Helvetica, Arial, sans-serif;
background: #f5f5f1;
}
h1 {
font-size: 28px;
line-height: 30px;
padding: 10px 0;
}
h2 {
font-size: 23px;
line-height: 25px;
padding: 10px 0;
}
h3 {
font-size: 18px;
line-height: 20px;
padding: 11px 0;
}
p {
padding-bottom: 22px;
}
nav {
display: block;
position: absolute;
left: 0;
width: 100%;
background: url("nav_background.png");
}
nav ul {
padding: 0;
margin: 0;
}
nav ul:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
/********************************/
nav li {
position: relative;
float: left;
list-style-type: none;
margin: 0 auto;
}
nav li a {
display: block;
padding: 10px 20px;
border-left: 1px solid #999;
border-right: 1px solid #222;
color: #777;
text-decoration: none;
}
nav li a:focus {
outline: none;
text-decoration: underline;
}
nav li:first-child a {
border-left: none;
}
nav li:hover ul {
display:block;
}
nav a span {
display: block;
float: right;
margin-left: 5px;
}
nav ul ul {
display: none;
width: 100%;
position: absolute;
left: 0;
background: #670C15;
}
/******************************/
nav ul ul li {
float: none;
}
nav ul ul a {
padding: 5px 10px;
border-left: none;
border-right: none;
font-size: 14px;
}
nav ul ul a:hover {
color: #fff;
}
nav ul li a:hover {
color: #fff;
}
nav ul a span {
-moz-transform:rotate(-180deg);
-webkit-transform:rotate(-180deg);
transform: rotate(-180deg);
}
#intro {
position: relative;
margin-top: 66px;
padding: 44px;
background: #467612 url("intro_background.png") repeat-x;
border-radius: 170px 50px;
}
#intro img {
position: absolute;
top: 0;
right: 0;
width: 470px;
height: 100%;
border-radius: 170px 50px;
}
#intro h2 {
position: relative;
z-index: 9999;
width: 600px;
padding: 0 0 0 0;
font-weight: bold;
}
#intro p {
position: absolute;
top: 0;
right: 0;
padding: 3% 0 0 0;
width: 400px;
z-index: 9999;
font-weight: bold;
}
#contenido {
display: table;
}
#contenidoPrincipal {
display: table-cell;
width: 620px;
padding-right: 22px;
}
aside {
display: table-cell;
width: 300px;
}
.blogPost div {
column-count: 2;
column-gap: 22px;
-moz-column-count: 2;
-moz-column-gap: 22px;
-webkit-column-count: 2;
-webkit-column-gap: 22px;
}
.blogPost img {
margin: 22px 0;
box-shadow: 3px 3px 7px #777;
width: 100%;
}
#comentarios {
margin-top: 21px;
padding-top: 22px;
border-top: 1px solid #d7d7d7;
}
#comentarios article {
display: table;
padding: 22px;
}
section#comentarios article:nth-child(2n+1) {
padding: 21px;
background: #E3E3E3;
border: 1px solid #d7d7d7;
border-radius: 11px;
}
#comentarios article header {
display: table-cell;
width: 220px;
padding-right: 22px;
}
#comentarios article header a {
display: block;
font-weight: bold;
color: #000;
}
#comentarios article header a:hover {
text-decoration: none;
}
#comentarios article p {
padding: 0;
}
form {
margin-top: 21px;
padding-top: 22px;
border-top: 1px solid #d7d7d7;
}
form p {
display: table;
margin-bottom: 22px;
padding: 0 22px;
}
form label {
display: table-cell;
width: 140px;
padding-right: 20px;
text-align: right;
font-weight: bold;
vertical-align: top;
}
form input[type="text"], form input[type="email"], form input[type="url"] {
display: table-cell;
width: 300px;
height: 20px;
border: 1px solid #d7d7d7;
}
form textarea {
width: 300px;
height: 100px;
border: 1px solid #d7d7d7;
}
form input[type="submit"] {
margin-left: 162px;
}
aside section {
margin: 22px 0 0 22px;
padding: 11px 22px;
background: url("sidebar_section_background.png") repeat-x;
}
aside section ul {
margin: 0 0 0 22px;
list-style: none;
}
aside section ul li a {
display: block;
text-decoration: none;
color: #000;
}
aside section ul li a: hover {
text-decoration: underline;
}
footer {
position: absolute;
left: 0;
width: 100%;
background: #681E1E;
}
footer div {
display: table;
margin: 0 auto;
padding: 44px 0;
width: 940px;
color: #777;
}
footer div section {
display: table-cell;
width: 300px;
}
footer div #acerca, footer div #otrosBlogs {
padding-right: 20px;
}
footer h3 {
color: #FFF;
}
footer a {
color: #999;
}
footer a:hover {
color: #FFF;
text-decoration: none;
}
footer ul {
margin: 0 0 0 40px;
list-style: square;
color: #565656;
}
footer ul li a {
display: block;
}
form p label{
color: #914F56;
}
<!doctype html>
<html>
<head id="titulo">
<title>Título de Página</title>
<link rel="stylesheet" href="estiloexpe.css" type="text/css" media="screen" />
</head>
<body>
<header>
<h1>Título de Página</h1>
</header>
<nav>
<ul>
<li>Inicio</li>
<li>
Archivo<span>^</span>
<ul>
<li> Submenú 1 </li>
<li> Submenú 2 </li>
<li> Submenú 3 </li>
</ul>
</li>
<li>Contacto</li>
</ul>
</nav>
<br><br><br><br>
<section id="intro">
<h2>Esta es una introducción de prueba.</h2>
<img src="intro_pebbles.png" alt="Image: Felixco, Inc. / FreeDigitalPhotos.net" />
<p>Cuando todo va mal te imagino sonriendo y se me pasa. <br> Ese es mi truco y esa es tu magia.</p>
</section>
<div id="contenido">
<div id="contenidoPrincipal">
<section>
<article class="blogPost">
<header>
<h2>Título del post.</h2>
<p> Escrito el <time datetime= "2016-02-08T09:20:45-06:00">23 de febrero de 2016
</time> por Genessis - Sin comentarios
</p>
</header>
<div>
<p>Para comprender el valor de un año, habla con el alumno que reprobó.
Para comprender el valor de un mes, habla con la madre de un bebé prematuro.
Para comprender el valor de una semana, habla con el redector de un semanario.
Para comprender el valor de un día, habla con el obrero que debe alimentar seis hijos.
</p>
<img src="DianaDardos.jpg" alt="Image: renjith krishnan / FreeDigitalPhotos.net" />
<p>Para comprender el valor de una hora, habla con los amantes que ansían verse.
Para comprender el valor de un minuto, habla con la persona que no alcanzo el tren.
Para comprender el valor de un segundo, habla con quien sobrevivió a un accidente.
Para comprender el valor de una milesima de segundo, habla con quien gano medalla de plata en las olimpiadas.
</p>
</div>
</article>
</section>
<section id="comentarios">
<header>
<h3>Comentarios</H3>
</header>
<article>
<header>
Juan Peacute el <time datetime= "2016-02-09T03:35:20-06:00">
23 de febrero del 2016 a las 12:50 am </time>
</header>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut.
</p>
</article>
<article>
<header>
Mafer Castillo el <time datetime="2012-02-09T11:40:09-06:00">
23 de febrero de 2016 a las 3:00 pm</time>
</header>
<p>Digamos que hoy me levante oto&ntildeal, pero hable contigo y ya tengo los bolsillos
llenos de veranos.
<p>Cuando quieras/puedas, ven a buscarlos.</b>
</p>
</article>
</section>
<form action="#" method="post">
<h3>Agregar comentario</h3>
<p>
<label for="Nombre">Nombre</label>
<input name="nombre" id="nombre" type="text" required />
</p>
<p>
<label for="email">Correo</label>
<input name="email" id="email" type="email" required />
</p>
<p>
<label for="website">Sitio Web</label>
<input name="website" id="website" type="url" />
</p>
<p>
<label for="comentario">Comentario</label>
<textarea name="comentario" id="comentario" required></textarea>
</p>
<p>
<input type="submit" value="Agregar Comentario" />
</p>
</form>
</div>
<aside>
<section>
<header>
<h3>Categorias</h3>
</header>
<ul>
<li> Lorem ipsum dolor. </li>
<li> Sit amet consectetur. </li>
<li> Adipisicing elit sed. </li>
<li> Do eiusmod tempor. </li>
<li> Incididunt ut labore. </li>
</ul>
</section>
<section>
<header>
<h3>Archivos</h3>
</header>
<ul>
<li> Enero 2012 </li>
<li> Diciembre 2011 </li>
<li> Noviembre 2011 </li>
<li> Octubre 2011 </li>
</ul>
</section>
</aside>
</div>
<footer>
<div>
<section id="Acerca">
<header>
<h3>Acerca de...</h3>
</header>
<p>
¿Que gano yo, si obtengo lo que ansío?
Un sueño, un aliento, una chispa de goce fugaz.
&iquestQuien cambiaria un momento de jubilo por una semana de llanto vacio?
&iquestO quien venderia la eternidad para tener un juguete y solaz?
&iquestO por una dulce uva, destruiria la vid y su haz?
</p>
</section>
<section id="otrosBlogs">
<header>
<h3>Otros Blogs</h3>
</header>
<ul>
<li> HTML5Tutoriales </li>
<li> HTML5tuto </li>
<li> HTML </li>
</ul>
</section>
<section id="popular">
<header>
<h3>Lo más popular</h3>
</header>
<ul>
<li> Ten confianza en ti mismo, y en todos los que te rodean </li>
<li> Fija metas que puedas alcanzar. </li>
<li> Habla con tus actos y no con tus palabras. </li>
</ul>
</section>
</div>
</footer>
</body>
</html>
Just a few minor CSS changes:
nav {
// remove position:absolute;
// remove left:0;
display: block;
width:auto;
background: url("nav_background.png");
}
nav ul{
padding:0;
margin: 0 auto;
width:24em; // ( or however many li elements you have at 8em width)
}
nav li {
width:8em; // (for example. Could be larger or smaller or px or %)
}

Change image size on hover, makes other images wrap

I'm building a 3x3 grid of thumbnails. A 'hover' effect makes the thumbnails grow. But the other images in the gallery move out or under the one that is growing. How can I fix it?
If there's a CSS solution, that would be great. Otherwise, I'm open to using jQuery.
.galeria {
margin-top: 15px;
width: 400px;
height: 520px;
border: 3px solid black;
border-radius: 15px;
}
#vis2 {
text-align: center;
}
.imgs {
display: inline-block;
margin-left: 20px;
}
.despliegue {
width: 95px;
height: 95px;
border: 3px dashed yellow;
border-radius: 100%;
padding: 10px 10px 10px 10px;
align-items: center;
margin-top: 15px;
position: sticky;
}
.despliegue:hover {
width: 140px;
height: 140px;
position: static;
}
.pieimg {
display: none;
}
.despliegue:hover + .pieimg {
display: block;
font-style: normal;
position: absolute;
}
<div class="galeria">
<h4 id="vis2">Dale un vistazo a las notas relevantes</h4>
<div class="imgs">
<img class="despliegue" src="images/aurora.jpg">
<p class="pieimg">Aurora gana premio !en Europa¡</p>
<img class="despliegue" src="images/bio.jpg">
<p class="pieimg">Bioshock se posiciona</p>
<img class="despliegue" src="images/amazon.jpg">
<p class="pieimg">Amazon, vuelve a dar de que hablar</p>
</div>
<div class="imgs">
<img class="despliegue" src="images/guerra.png">
<p class="pieimg">Microsoft, Android y Apple ¿Quien lleva cabeza?</p>
<img class="despliegue" src="images/windows.png">
<p class="pieimg">Windows 10. Te damos consejos</p>
<img class="despliegue" src="images/carlos.jpg">
<p class="pieimg">Carlos Sadness dice que podría venir a LATAM para 2015</p>
</div>
<div class="imgs">
<img class="despliegue" src="images/las_ventajas.jpg">
<p class="pieimg">Nota de: Película</p>
<img class="despliegue" src="images/mcw.png">
<p class="pieimg">Microsoft ataca con nueva <b>Surface</b>
</p>
<img class="despliegue" src="images/netflix.png">
<p class="pieimg">El éxito detras de tan famosa plataforma</p>
</div>
</div>
View on CodePen
It's spilling on to the next line because the container div is not big enough to hold the new larger img along with the other two.
By increasing the width on .galeria to something like 450px, it eliminates this issue.
Add width: 450px; to .galeria, adjust the width until it looks right. :)
.galeria {
margin-top: 15px;
width: 450px;
height: 520px;
border: 3px solid black;
border-radius: 15px;
}
#vis2 {
text-align: center;
}
.imgs {
display: inline-block;
margin-left: 20px;
}
.despliegue {
width: 95px;
height: 95px;
border: 3px dashed yellow;
border-radius: 100%;
padding: 10px 10px 10px 10px;
align-items: center;
margin-top: 15px;
position: sticky;
}
.despliegue:hover {
width: 140px;
height: 140px;
position: static;
}
.pieimg {
display: none;
}
.despliegue:hover + .pieimg {
display: block;
font-style: normal;
position: absolute;
}
<div class="galeria">
<h4 id="vis2">Dale un vistazo a las notas relevantes</h4>
<div class="imgs">
<img class="despliegue" src="images/aurora.jpg">
<p class="pieimg">Aurora gana premio !en Europa¡</p>
<img class="despliegue" src="images/bio.jpg">
<p class="pieimg">Bioshock se posiciona</p>
<img class="despliegue" src="images/amazon.jpg">
<p class="pieimg">Amazon, vuelve a dar de que hablar</p>
</div>
<div class="imgs">
<img class="despliegue" src="images/guerra.png">
<p class="pieimg">Microsoft, Android y Apple ¿Quien lleva cabeza?</p>
<img class="despliegue" src="images/windows.png">
<p class="pieimg">Windows 10. Te damos consejos</p>
<img class="despliegue" src="images/carlos.jpg">
<p class="pieimg">Carlos Sadness dice que podría venir a LATAM para 2015</p>
</div>
<div class="imgs">
<img class="despliegue" src="images/las_ventajas.jpg">
<p class="pieimg">Nota de: Película</p>
<img class="despliegue" src="images/mcw.png">
<p class="pieimg">Microsoft ataca con nueva <b>Surface</b>
</p>
<img class="despliegue" src="images/netflix.png">
<p class="pieimg">El éxito detras de tan famosa plataforma</p>
</div>
</div>