How to align text with a imagen using Bootstrap and Css - css

Im creating a web app and I need to know how to align images with text. Right now, I have this:
What I want it to have the image on the left with it description on the right. The code Im using is this:
<div class="row">
<div class="col-md-4">
<div class="thumbnail">
<img src="https://images-na.ssl-images-amazon.com/images/I/91epzdXTTHL._SX300_.jpg" alt="Lights" style="width:20%">
<div class="caption">
<pelicula tipo="accion" calificacion="Mayores de 13" estreno="26 de abril de 2019" ></pelicula>
<titulo>Titulo: Avengers Engame</titulo><br />
<director>Dirección: Joe and Anthony Russo</director><br />
<productor>Producción: Kevin Feige</productor><br />
<guion>Guión: Cristhoper Markus y Stephen McFeely</guion><br />
<musica>Música: Alan Silvestri</musica><br />
<duracion>Duración: 181 minutos</duracion><br />
<productora>Productora: Marvel Studios</productora><br />
<Presupuesto>Presupuesto: 356.000.000 $</Presupuesto><br />
<Recaudacion>Recaudación: 2.800.000.000 $</Recaudacion><br /
<Comentarios> Comentario: Una de las peliculas mas esperadas del año. El desenlace final la guerra del infinito. </Comentarios><br />
</div>
</div>
</div>
</div>

You could provide a Codepen example, it would be useful to other developers.
Anyway, you can accomplish this with the flexbox:
.thumbnail {
display: flex;
}
Another way would be to use the bootstrap grid or using CSS float.

use bootstrap flex to do https://getbootstrap.com/docs/4.5/utilities/flex/
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="d-flex align-items-center p-2 text-white-50 rounded shadow-sm" style="background-color:var(--purple)">
<img src="https://images-na.ssl-images-amazon.com/images/I/91epzdXTTHL._SX300_.jpg" alt="Lights" style="width:30%">
<div class="lh-100 ml-3">
<div class="caption">
<pelicula tipo="accion" calificacion="Mayores de 13" estreno="26 de abril de 2019"></pelicula>
<titulo>Titulo: Avengers Engame</titulo><br />
<director>Dirección: Joe and Anthony Russo</director><br />
<productor>Producción: Kevin Feige</productor><br />
<guion>Guión: Cristhoper Markus y Stephen McFeely</guion><br />
<musica>Música: Alan Silvestri</musica><br />
<duracion>Duración: 181 minutos</duracion><br />
<productora>Productora: Marvel Studios</productora><br />
<Presupuesto>Presupuesto: 356.000.000 $</Presupuesto><br />
<Recaudacion>Recaudación: 2.800.000.000 $</Recaudacion><br / <Comentarios> Comentario: Una de las peliculas mas esperadas del año. El desenlace final la guerra del infinito. </Comentarios><br />
</div>
</div>

This is very simple with flex function in css. Add display: flex; to .thumbnail class. If you don't know about display flex refer below sites.
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
https://www.w3schools.com/css/css3_flexbox.asp
<div class="row">
<div class="col-md-4" style="background: yellowgreen;">
<div class="thumbnail" style="display: flex;padding: 10px;">
<img src="https://images-na.ssl-images-amazon.com/images/I/91epzdXTTHL._SX300_.jpg" alt="Lights" style="width:20%;">
<div class="caption" style="margin-left: 20px; ">
<pelicula tipo="accion" calificacion="Mayores de 13" estreno="26 de abril de 2019" ></pelicula>
<titulo>Titulo: Avengers Engame</titulo><br />
<director>Dirección: Joe and Anthony Russo</director><br />
<productor>Producción: Kevin Feige</productor><br />
<guion>Guión: Cristhoper Markus y Stephen McFeely</guion><br />
<musica>Música: Alan Silvestri</musica><br />
<duracion>Duración: 181 minutos</duracion><br />
<productora>Productora: Marvel Studios</productora><br />
<Presupuesto>Presupuesto: 356.000.000 $</Presupuesto><br />
<Recaudacion>Recaudación: 2.800.000.000 $</Recaudacion><br /
<Comentarios> Comentario: Una de las peliculas mas esperadas del año. El desenlace final la guerra del infinito. </Comentarios><br />
</div>
</div>
</div>

Related

How to align two form fields on the same row in html page using css?

I have this html text
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="glossary-form"></div>
<div class="form-group" style="display:inline-block; width:48%;padding-right: 5%;">
<label for="glossary_entry_input_1">Lemma IT</label>
<input type="text" class="form-control" id="glossary_entry_input_1" placeholder="">
</div>
<div class="form-group" style="display:inline-block; width:48%; padding-left: 5%;">
<label for="glossary_entry_input_2">Lemma CH</label>
<input type="text" class="form-control" id="glossary_entry_input_2" placeholder="">
</div>
<div class="form-group">
<label for="glossary_entry_input_3">Acronimo IT</label>
<small id="inputHelp" class="form-text text-muted">Inserire una sigla (se esiste) del Lemma. Nel caso in cui il lemma sia una grandezza fisica, inserire la lettera o il simbolo che la identifica.</small>
<input type="text" class="form-control" id="glossary_entry_input_3" placeholder="">
</div>
</div>
generating the following form fields, aligned on one line, as you see
and I want to display them symmetrically to the vertical axys of my html page, by moving the second one to the right, as you see
So that the left margin of the "Lemma CH" box is aligned with the one of "Acronimo IT" box.
How do I have to change my code to obtain the result shown in the second image?
Float right is not a right solution. try this.
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="glossary-form"></div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="glossary_entry_input_1">Lemma IT</label>
<input type="text" class="form-control" id="glossary_entry_input_1" placeholder="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="glossary_entry_input_2">Lemma CH</label>
<input type="text" class="form-control" id="glossary_entry_input_2" placeholder="">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="glossary_entry_input_3">Acronimo IT</label>
<small id="inputHelp" class="form-text text-muted">Inserire una sigla (se esiste) del Lemma. Nel caso in cui il
lemma sia una grandezza fisica, inserire la lettera o il simbolo che la identifica.</small>
<input type="text" class="form-control" id="glossary_entry_input_3" placeholder="">
</div>
</div>
</div>
</div>
Here's my solution. I've added following code to "Lemma CH" box. Hope it will meet your requirement.
float: right;
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="glossary-form"></div>
<div class="form-group" style="display:inline-block; width:48%;padding-right: 5%;">
<label for="glossary_entry_input_1">Lemma IT</label>
<input type="text" class="form-control" id="glossary_entry_input_1" placeholder="">
</div>
<div class="form-group" style="display:inline-block; width:48%; padding-left: 5%; float: right;">
<label for="glossary_entry_input_2">Lemma CH</label>
<input type="text" class="form-control" id="glossary_entry_input_2" placeholder="">
</div>
<div class="form-group">
<label for="glossary_entry_input_3">Acronimo IT</label>
<small id="inputHelp" class="form-text text-muted">Inserire una sigla (se esiste) del Lemma. Nel caso in cui il lemma sia una grandezza fisica, inserire la lettera o il simbolo che la identifica.</small>
<input type="text" class="form-control" id="glossary_entry_input_3" placeholder="">
</div>
</div>
You can use their documentation..
https://getbootstrap.com/docs/4.0/components/forms/#form-row
I'd advise using bootstrap docs as you are using bootstrap anyway. Creating the form how you are will require further CSS to cater for responsive design. Use the docs and bootstrap will look after you.
Hope this helps.

Display image next to a textarea Bootstrap 4

I need to show an image next to a textarea using Bootstrap 4. But I have a display problem:
What I want is that image and textarea it looks like:
always look like the previous image both on the pc and in the responsive mode.
This is the code of my actual angular HTML component:
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="col-lg-4">
<img
data-src="holder.js/200x200"
class="rounded float-left"
alt="100x100"
src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22200%22%20height%3D%22200%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%20200%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_164e3f66702%20text%20%7B%20fill%3Argba(255%2C255%2C255%2C.75)%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A10pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_164e3f66702%22%3E%3Crect%20width%3D%22200%22%20height%3D%22200%22%20fill%3D%22%23777%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%2274.4296875%22%20y%3D%22104.5%22%3E200x200%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E"
data-holder-rendered="true"
style="width: 150px; height: 150px; margin:5px;">
</div>
<div class="col-lg-8">
<label for="modifications">Modificaciones al diseño</label>
<textarea
class="form-control"
id="modifications"
rows="4"
required
[(ngModel)]="mModifications"
name="modifications"
#modifications="ngModel"
[ngClass]="{'is-valid': modifications.valid && modifications.touched, 'is-invalid': modifications.invalid && modifications.touched}">
</textarea>
<small *ngIf="modifications.untouched || modifications.valid && modifications.touched" class="form-text text-muted">Se conciso en la descripción, esto ayuda a nuestros expertos a estar preparados el día de la visita.</small>
<small *ngIf="modifications.invalid && modifications.touched" class="form-text text-muted-error">Debes describir el trabajo a realizar</small>
</div>
</div>
</div>
</div>
I have tried several ways to change the css to get this, but I could not.
Thank you very much!
<div class="container">
<div class="row">
<div class="col-lg-4">
<img
data-src="holder.js/200x200"
class="rounded float-left"
alt="100x100"
src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22200%22%20height%3D%22200%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%20200%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_164e3f66702%20text%20%7B%20fill%3Argba(255%2C255%2C255%2C.75)%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A10pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_164e3f66702%22%3E%3Crect%20width%3D%22200%22%20height%3D%22200%22%20fill%3D%22%23777%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%2274.4296875%22%20y%3D%22104.5%22%3E200x200%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E"
data-holder-rendered="true">
</div>
<div class="col-lg-8">
<label for="modifications">Modificaciones al diseño</label>
<textarea
class="form-control"
id="modifications"
rows="4"
required
[(ngModel)]="mModifications"
name="modifications"
#modifications="ngModel"
[ngClass]="{'is-valid': modifications.valid && modifications.touched, 'is-invalid': modifications.invalid && modifications.touched}">
</textarea>
<small *ngIf="modifications.untouched || modifications.valid && modifications.touched" class="form-text text-muted">Se conciso en la descripción, esto ayuda a nuestros expertos a estar preparados el día de la visita.</small>
<small *ngIf="modifications.invalid && modifications.touched" class="form-text text-muted-error">Debes describir el trabajo a realizar</small>
</div>
</div>
</div>
Just remove the col-lg-12 div altogether.
https://codepen.io/anon/pen/jpYQQK
in your html
<div class="col-md-12" id="dvImageTextBox">
<input id="cc-cvc" placeholder="CVC" formControlName="cvc" type="text" autocomplete="off" ccCvc>
<img src="assets/citybook/images/CVV.png" height="45px" width="75px" />
</div>
css
#dvImageTextBox
{
position: relative;
}
#dvImageTextBox input
{
display: block;
width: 100%;
}
#dvImageTextBox img
{
position: absolute;
top: 5px;
right: 5px;
}

Wordpress Contact Form don't send files in attachment

I've got a little problem with CF7. The plugin works good in wordpress, but when I put the file field on the form, the wordpress doesn't send the e-mail, if I take off the file field, it works perfectly.
EDIT -----------
Form HTML:
<div class="row-fluid formulario-cotacao">
<div class="span12">
<h3>Seus Dados de Contato</h3>
[text* your-name watermark "Nome:"]
[email* your-email watermark "E-mail:"]
[tel* tel-987 id:telId class:telClass watermark "Telefone:"]
[textarea your-message watermark "Mensagem:"]
</div>
<div class="span12">
<h3>Tipo de Seguro Desejado</h3>
[checkbox* tipo-seguro id:tipo-seguro class:tipo-seguro label_first use_label_element "seguro de automóvel" "seguro de motos" "consórcio" "seguro de vida" "planos de saúde" "seguro de caminhões" "seguro prestamista" "carta verde" "previdência privada" "seguro viagem"]
</div>
<div class="span12">
[text outros id:outros class:outros watermark "Outros Seguros Desejados:"]
</div>
<div class="span12">
<p>Enviar arquivo</p>
<p>[file arquivo limit:3000000 filetypes:jpg|doc|png|pdf id:arquivo class:arquivo]</p>
</div>
<p class="text-center">[submit id:cotar class:cotar "solicitar cotação"] <input type="reset" value="limpar campos" /> </p>
</div>
IN MESSAGE BODY:
<h1 style="font-family:Arial, Helvetica, sans-serif; font-size:22px; line-height:26px; color:#06F;">Cotação do Web Site</h1>
<p><b>Nome: </b><br/> [your-name]</p>
<p><b>E-mail: </b><br/> [your-email]</p>
<p><b>Telefone: </b><br/> [tel-987]</p>
<p><b>Mensagem: </b><br/> [your-message]</p>
<p><b>Outros seguros desejados: </b> <br/> [outros]</p>
<p><b>Arquivo:</b> <img src="[arquivo]"> <br> [arquivo]</p>
<br/><br/><br/><br/>
<h3 style="font-family:Arial, Helvetica, sans-serif; font-size:22px; line-height:26px; color:#06F;">
<b>Tipo de Seguro Desejado</b>
</h3><br/>
<p> [tipo-seguro]</p>
IN ATTACHMENT FIELD:
[arquivo] // <-- this is my input file field
Someone already had the same problem?

Correct use of section article and heading

I wrote some code for an advanced liquid slider. But as my header slider contains some major content like h-tags p-tags and some images. I asked myself "can I consider each slide as an article". Because I can't find the correct answer maybe somebody can help me. The question is, is my code correctly nested and the right use of Semantic Elements. The code is:
<header id="masthead" class="site-header" role="banner">
<div id="main-slider" class="liquid-slider">
<article id="slider-1" class="liquid-slide-wrapper" style="background: url(images/back-99.jpg) 50% 50% /cover; repeat:no-repeat; min-height:450px;">
<section class="section-text-left">
<header>
<h1 class="title" style=" color:#f7740a; display:none;">Professionele, betaalbare website nodig?</h2>
<h2 style=" color:#fff; display:none;">Zelf uw website aanpassen?</h3>
</header>
<p style="display:none; color:#fff;">Onze unieke websites worden afgeleverd met een wordpress CMS systeem.<br>
Hiermee kan u zelf uw website aanpassen!<br> Vat de kudu bij de horens en contacteer ons voor meer info!
</p>
<p style="display:none;"><button type="button" class="btn btn-primary btn-lg">Mail Ons</button> <button type="button" class="btn btn-transparent btn-lg">0494 / 77 22 61</button></p>
</section>
<section class="section-img-right clearfix">
<img class="slider-img-right fadeInRight animated" style="display:none; width:100%; max-width:692px; height:auto;" src="images/imac.png" />
<img class="slider-img-right fadeIn animated-slow" style="display:none; width:100%; max-width:692px; height:auto;" src="images/straf-webdesign.png" />
<img class="slider-img-right fadeIn animated-slow" style="display:none; width:100%; max-width:692px; height:auto;" src="images/responsive-webdesign.png" />
</section>
</article>
<article id="slider-2" style="background: url(images/background-7.png) 50% 50% /cover; repeat:no-repeat; min-height:450px;">
<section class="section-text-left">
<header>
<h1 class="title" style=" color:#f7740a; display:none;">JustOnWeb wordt Kudu Concepts!</h2>
<h2 style="display:none; color:#000;">Een nieuwe naam, met een professionelere aanpak!</h3>
<header>
<p style="display:none; color:#fff;">Een website bestaat uit meer dan een lay-out. <br>Met kudu Concepts gaan we verder daar waar anderen stoppen!<br>
We bedenken een volledige filosofie voor uw website en <br> combineren dit met onze kennis van Online Marketing!
</p>
</section>
</article>
</div>
</header>
According to W3School semantic here : http://www.w3schools.com/html/html5_semantic_elements.asp
< section > contain < article >
it is not recommanded to use < section > inside < article > and inside < header >
According W3C, a section is "a thematic grouping of content, typically with a heading."
< header > is on top of parent element, so on top of body (the header) but also on top of sections or articles or any other div
In your code :
< h1 > should be close with < / h1 > and not h2, same for < h2 >

Header tag Background Color extending into Columns on iPad

I am working on a website and am having problems with the CSS on the IPAD (and possibly the iPhone).
Basically on the Sponsors page: http://www.tcsdesignreno.com/fsw/?page_id=1149. I am getting a red background behind the different sections. I think it has to do with the H3 tags that have a red background.
The same thing happens here: http://www.tcsdesignreno.com/fsw/?page_id=1165. They both are using the Easy Columns plugin in Wordpress.
Here is some sample HTML
<h3 class="sponsor-hdr" style="text-align: center;">Advertising and Media Partners</h3>
<div class="ezcol ezcol-one-third">
<p><a title="Fire Rescue 1" href="http://www.firerescue1.com/" target="_blank"><img class=" size-full wp-image-1238 aligncenter" src="http://www.tcsdesignreno.com/fsw/wp-content/uploads/2014/12/161_FR1_FC_Logo_Stacked.jpg" alt="FireRescue1.com, Fire Chief" width="161" height="93" /></a></p>
</div>
<div class="ezcol ezcol-two-third ezcol-last">
<p><strong>FireRescue1 / Fire Chief</strong><br />
200 Green St.<br />
2nd Floor<br />
San Francisco, CA 94111<br />
Phone: 415-962-5912</p>
</div><div class="ezcol-divider"></div>
<div class="ezcol ezcol-one-third">
<p><a title="CSFA" href="http://www.csfa.net/" target="_blank"><img class=" size-full wp-image-1233 aligncenter" src="http://www.tcsdesignreno.com/fsw/wp-content/uploads/2014/12/116_LatestCSFA-3_5_x_2_75_Logo.jpg" alt="California State Firefighters' Assn " width="116" height="91" /></a></p>
</div>
<div class="ezcol ezcol-two-third ezcol-last">
<p><strong>California State Firefighters’ Assn </strong><br />
2701 K Street, Suite 201<br />
Sacramento, CA 95816<br />
Phone: 800-451-2732<br />
Fax: 916-446-9889</p>
</div><div class="ezcol-divider"></div>
<h3 class="sponsor-hdr" style="text-align: center;">Program Sponsors</h3>
<div class="ezcol ezcol-one-third"><a title="FPAN" href="http://www.fpanevada.org/" target="_blank"><img class="aligncenter size-full wp-image-1232" src="http://www.tcsdesignreno.com/fsw/wp-content/uploads/2014/12/116_FPAN_Logo_Color.jpg" alt="FPAN" width="116" height="116" /></a></div>
<div class="ezcol ezcol-two-third ezcol-last">
<p>In appreciation to:<br />
<strong>Fire Prevention Association of Nevada</strong><br />
<strong>National Code Services Association</strong></p>
</div><div class="ezcol-divider"></div>
<h3 class="sponsor-hdr" style="text-align: center;">Tote Bag Sponsors</h3>
<div class="ezcol ezcol-one-third"><a title="Burton's Fire" href="http://www.burtonsfire.com/" target="_blank"><img class="aligncenter size-full wp-image-1236" src="http://www.tcsdesignreno.com/fsw/wp-content/uploads/2014/12/158_BURTONS_FIRE_INC_LOGO.jpg" alt="BURTONS FIRE" width="158" height="54" /></a></p>
</div>
<div class="ezcol ezcol-two-third ezcol-last">
<p><strong>Burton’s Fire</strong><br />
1301 Doker Avenue<br />
Modesto, CA 95351<br />
209-544-3161</p>
</div><div class="ezcol-divider"></div>
<div class="ezcol ezcol-one-third"><a title="Waterous" href="http://www.waterousco.com/" target="_blank"><img class="aligncenter size-full wp-image-1237" src="http://www.tcsdesignreno.com/fsw/wp-content/uploads/2014/12/158_WaterousLogoSm.jpg" alt="Waterous" width="155" height="29" /></a></p>
</div>
CSS:
h3 {
background-color: #990000;
color: #ffffff;
padding: 10px 0;
text-align: center;
width: 100%;
max-height:92px;
}
Here is an image:
Can anyone see why these sections are showing up in red? For the life of me I can't seem to figure it out.
Looks like your floats aren't clearing. You can add this to your current styles:
.singlepost .content-entry h3 {
clear: both;
}

Resources