Bootstrap - Creating mobile-adaptation for reverse row pattern - html

I want to create a reverse effect with Bootstrap
(1st row: Text on the left, image on the right
2nd row: Image on the left, text on the right
3rd row: Text on the left, image on the right
4th row: Image on the left, text on the right
And it goes on and on!
It's looking very nice on large devices but then when it shows on device, it logically adapts as if the pictures go one after another!
I would like on mobile to always go : Up = Text, down = image instead of variations.
Here is the code for two rows:
<!-- FIRST ROW -->
<div class="row border-marine margin-bottom">
<div class="col-lg-6 text-center">
<h2 class="padding-bottom-large">Réfection de toiture</h2>
<p>Que ce soit un toit de bardeau, de tôle ou à faible pente, Toitures l & l saura
vous satisfaire</p>
</div>
<div id="no-padding" class="col-lg-6">
<img src="assets/img/toiture.png" class="img-responsive" alt="">
</div>
</div>
<!-- SECOND ROW -->
<div class="row border-marine margin-bottom">
<div id="no-padding" class="col-lg-6">
<img src="assets/img/ventilation.png" class="img-responsive" alt="">
</div>
<div class="col-lg-6 text-center">
<h2 class="padding-bottom-small">Ventilation de toiture</h2>
<p>Ayant effectué une centaine de travaux de ventilation de toiture, Toitures L & L
possède les connaissances et l'expérience nécessaire à l'aération de votre toiture.</p>
</div>
</div>
How it looks on a large media device
How it looks on a mobile device
Cheers guys!!

Assuming you are using Bootstrap 4 (which is the current version of Bootstrap), you're using flexbox under the hood. That means you can simply lay out the content in the way you would like it to appear for mobile sites in the DOM (writing out the text before the image in the HTML), and then make use of flex-direction: row-reverse for the rows that you wish to have the image appear on the left for desktop views. To get really fancy, you can apply this to .row:nth-of-type(even) (or odd) to invert every second row.
This can be seen in the following:
.row:nth-of-type(even) {
flex-direction: row-reverse;
}
<!-- BOOTSTRAP REFERENCES -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<!-- FIRST ROW -->
<div class="row border-marine margin-bottom">
<div class="col-lg-6 text-center">
<h2 class="padding-bottom-large">Réfection de toiture</h2>
<p>Que ce soit un toit de bardeau, de tôle ou à faible pente, Toitures l & l saura vous satisfaire</p>
</div>
<div class="col-lg-6">
<img src="http://placehold.it/400" class="img-responsive" alt="">
</div>
</div>
<!-- SECOND ROW -->
<div class="row border-marine margin-bottom">
<div class="col-lg-6 text-center">
<h2 class="padding-bottom-small">Ventilation de toiture</h2>
<p>Ayant effectué une centaine de travaux de ventilation de toiture, Toitures L & L possède les connaissances et l'expérience nécessaire à l'aération de votre toiture.</p>
</div>
<div class="col-lg-6">
<img src="http://placehold.it/400" class="img-responsive" alt="">
</div>
</div>
NB: I've removed your no-margin IDs, as these are duplicates, and duplicate IDs are not valid markup. I've also replaced your images with placeholders for the purposes of this demo.
Bootstrap 3.3 solution:
Bootstrap 3.3 doesn't have the convenience of flexbox, so instead you'll have to float the columns. To achieve the same effect, what you'll want to do is float the first column (the content) to the right when you want the image displayed on the left, making use of the selector .row:nth-of-type(even) > .col-lg-6:first-of-type.
This can be seen in the following:
.row:nth-of-type(even) > .col-lg-6:first-of-type {
float: right;
}
<!-- BOOTSTRAP REFERENCES -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<!-- FIRST ROW -->
<div class="row border-marine margin-bottom">
<div class="col-lg-6 text-center">
<h2 class="padding-bottom-large">Réfection de toiture</h2>
<p>Que ce soit un toit de bardeau, de tôle ou à faible pente, Toitures l & l saura vous satisfaire</p>
</div>
<div class="col-lg-6">
<img src="http://placehold.it/400" class="img-responsive" alt="">
</div>
</div>
<!-- SECOND ROW -->
<div class="row border-marine margin-bottom">
<div class="col-lg-6 text-center">
<h2 class="padding-bottom-small">Ventilation de toiture</h2>
<p>Ayant effectué une centaine de travaux de ventilation de toiture, Toitures L & L possède les connaissances et l'expérience nécessaire à l'aération de votre toiture.</p>
</div>
<div class="col-lg-6">
<img src="http://placehold.it/400" class="img-responsive" alt="">
</div>
</div>

Related

how to create Card flip with bouton radio

I try to change cards face up with a radio button a bit like on this link:
https://codyhouse.co/demo/pricing-tables/index.html
For the moment I am getting to something when the responsive is below 62 rem (my mobile break point) but the result is not convincing above when the card pair is no longer in column but in row: / the pivot point remains central and suddenly the rotation will not be the same ... In fact, I would like the pivot points to always be on the cards that they pass in column or in row
So here is the code (mobile first)
Another problem with this code is that with absolute positions, it breaks my code a bit and suddenly from the "flap" div the elements are no longer in the "flip" section, which generates faults in my base code, especially for my footer ... So I would like to know how I can do to keep the "absolute" positions which make the elements turn, while keeping a well-constructed page with my card part and under my footer
Thank you in advance :)
HTML
<form>
<div class="radio-group">
<input type="radio" id="option-one" name="selector" checked><label for="option-one">Mensuel</label><input type="radio" id="option-two" name="selector"><label for="option-two">Annuel</label>
</div>
</form>
<section class='flip abo'>
<div id='flap' class='flap'>
<div class="recto">
<div class="card">
<h4 class='title-free'>Freelance</h4>
<div class='prix'>
<p>€</p>
<p class='free'><span>5</span>/mois</p>
</div>
<p class='bg-card'>1 utilisateur</p>
<p>Invités illimités</p>
<p class='bg-card'>Projets illimités</p>
<p>Un tableau Kanban/projet</p>
<p class='bg-card'>Tâches illimitées</p>
<p>Paiement des factures en ligne</p>
<p class='bg-card'>Support 5j/7</p>
</div>
<div class="card">
<h4 class='title-team'>Team</h4>
<div class='prix'>
<p>€</p>
<p class='team'>à partir de <span>9</span>/mois</p>
</div>
<p class='bg-card'>2 à 150 utilisateurs</p>
<p>Invités illimités</p>
<p class='bg-card'>Projets illimités</p>
<p>Un tableau Kanban/projet</p>
<p class='bg-card'>Tâches illimitées</p>
<p>Paiement des factures en ligne</p>
<p class='bg-card'>Support 5j/7</p>
</div>
</div>
<div class="verso">
<div class="card">
<h4 class='title-free'>Freelance</h4>
<div class='prix'>
<p>€</p>
<p class='free'><span>55</span>/ans</p>
</div>
<p class='bg-card'>1 utilisateur</p>
<p>Invités illimités</p>
<p class='bg-card'>Projets illimités</p>
<p>Un tableau Kanban/projet</p>
<p class='bg-card'>Tâches illimitées</p>
<p>Paiement des factures en ligne</p>
<p class='bg-card'>Support 5j/7</p>
</div>
<div class="card">
<h4 class='title-team'>Team</h4>
<div class='prix'>
<p>€</p>
<p class='team'>à partir de <span>99</span>/ans</p>
</div>
<p class='bg-card'>2 à 150 utilisateurs</p>
<p>Invités illimités</p>
<p class='bg-card'>Projets illimités</p>
<p>Un tableau Kanban/projet</p>
<p class='bg-card'>Tâches illimitées</p>
<p>Paiement des factures en ligne</p>
<p class='bg-card'>Support 5j/7</p>
</div>
</div>
</div>
</section>

How to make product cards equal height? [duplicate]

I am new to Bootstrap 3 and I would like to have 3 panels on my landing page of equal height, even though the middle panel has less content. When resized they become the same height, but are not upon initial visit to the page.
I already tried hiding the overflow with CSS and it cuts off the bottom of the panel which isn't what I want, so I'm thinking I need to use jQuery.
Here is my code:
<div class="row-fluid">
<!--begin panel 1 -->
<div class="col-md-4">
<div style="text-align:center" class="panel panel-primary">
<div class="panel-heading">
<h1 class="panel-title text-center">Web y Metrícas</h1>
</div>
<!-- end panel-heading -->
<div class="panel-body">
<p>
<img style="margin: 0 auto;" class="img-responsive" src="web.png" height="30%" width="30%" alt="Web y Metrícas" />
</p>
<p class="text-left lead2">Apoyamos estratégicamente la presencia de tu empresa en el mundo digital, a través de la construcción de recursos web atractivos para tus clientes.</p>
<ul class="text-left">
<li>Web Corporativas</li>
<li>Tiendas Virtuales</li>
<li>Plataformas e-Learning</li>
<li>Arquitectura de Información</li>
<li>Google Analytics, SEO–SEM</li>
<li>Análisis de Competencia Digital</li>
<li>Data Mining</li>
</ul> <a class="btn btn-primary" href="#">Ver más »</a>
</div>
<!-- end panel-body -->
</div>
<!-- end panel-primary -->
</div>
<!--end col-md-4 -->
<!-- begin panel 2 -->
<div class="col-md-4">
<div style="text-align:center" class="panel panel-primary">
<div class="panel-heading">
<h1 class="panel-title">Gestíon de Redes Socials</h1>
</div>
<!-- end panel-heading -->
<div class="panel-body">
<p>
<img style="margin: 0 auto;" class="img-responsive" src="redes.png" height="30%" width="30%" alt="Gestíon de Redes Socials" />
</p>
<p class="text-left lead2">Crear una experiencia de marca excepcional a través de redes es más inteligente, rápida y las comunicaciones sociales serán más eficientes.</p>
<ul class="text-left">
<li>Compromiso</li>
<li>Publicación</li>
<li>Monitoreo</li>
<li>Analítica</li>
<li>Colaboración</li>
<li>CRM</li>
<li>Movil</li>
</ul> <a class="btn btn-primary" href="#">Ver más »</a>
</div>
<!-- end panel-body -->
</div>
<!-- end panel-primary -->
</div>
<!-- end col-md-4 -->
<!--begin panel 3 -->
<div class="col-md-4">
<div style="text-align:center" class="panel panel-primary">
<div class="panel-heading">
<h1 class="panel-title">Plan de Medios</h1>
</div>
<!-- end panel-heading -->
<div class="panel-body">
<p>
<img style="margin: 0 auto;" class="img-responsive" src="medios.png" height="30%" width="30%" alt="Plan de Medios" />
</p>
<p class="text-left lead2">Trabajamos en conjunto con la empresa para reforzar las fortalezas de su organización y las comunicamos de forma integral y con un mensaje claro.</p>
<ul class="text-left">
<li>Asesoría Comunicacional</li>
<li>RR.PP</li>
<li>Presencia de Marca</li>
<li>Clipping Digital</li>
<li>Manejo de Crisis</li>
<li>Lobby</li>
<li>Media Training</li>
</ul> <a class="btn btn-primary" href="#">Ver más »</a>
</div>
<!-- end panel-body -->
</div>
<!-- end panel-primary -->
</div>
<!-- end col-md-4 -->
</div>
<!-- end row -->
This can be done with CSS flexbox. Only minimal CSS is needed..
.equal {
display: -webkit-flex;
display: flex;
}
Just add .equal to your .row and flexbox does the rest.
http://www.codeply.com/go/BZA25rTY45
UPDATE: Bootstrap 4 uses flexbox so there is no need for the additional CSS.
http://www.codeply.com/go/0Aq0p6IcHs
Bootstrap's solution - add this css and add the class to your row:
.row-eq-height {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
It has a couple caveats, as posted at http://getbootstrap.com.vn/examples/equal-height-columns/, but it sounds like it'll be good enough for your case.
I also saw this answer here.
Update for dynamic number of columns
Bootstrap automatically wraps columns into new rows when you add more than can fit in one row, but this flexbox approach breaks this. To get flexbox to wrap, I've found you can do something like this:
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
-webkit-align-content: flex-end;
align-content: flex-end;
This is awesome when you have a dynamic number of columns, or columns that change width according to the screen size. So you can have something like this:
<div class="row row-eq-height">
<div class="col-sm-6 col-md-4">Content...</div>
<div class="col-sm-6 col-md-4">Content...</div>
<div class="col-sm-6 col-md-4">Content...</div>
<div class="col-sm-6 col-md-4">Content...</div>
<div class="col-sm-6 col-md-4">Content...</div>
</div>
And it all lines up the way it's expected. Just watch out - it only works in newer browsers. More info here
If you're going to use the bootstrap grid, I don't think you're going to find an easy way to accomplish this without hacks like the following css.
This basically says. When the screen width is greater than the md breakpoint in bootstrap, give all the elements with panel-body class which are direct descendants of the column elements a minimum height of 420px which happens to be a "magic number" that works with your existing content.
Again, I think this is a really gross solution, but it "works" in a pinch.
#media (min-width: 992px) {
.col-md-4 > .panel > .panel-body {
min-height: 420px;
}
}
Here's a CSS-Tricks article Fluid Width Equal Height Columns which covers various ways (display: table & flexbox) to accomplish this. However, you might need to step away from the responsive bootstrap grid for this particular task.
Also, here's the Complete Guide to Flexbox
Haven't found any of these CSS methods to work in my case I am using images in my panels too instead I used a simple JQuery function to get the job done
window.onload = function resizePanel(){
var h = $("#panel-2").height();
$("#panel-1").height(h); // add a line like this for each panel you want to resize
}
Where the ids "panel-1" and and "panel-2" are in the panel tag choose the largest panel as the one you use to set h and call the function at the end of you html.
<body onresize = "resizePanel()">
I also make it so the function is called when if the window is resized by adding the onresize attribute to the body
this function finds the largest .panel-body height, then makes that the height of all my .panel-body elements.
function evenpanels() {
var heights = []; // make an array
$(".panel-body").each(function(){ // copy the height of each
heights.push($(this).height()); // element to the array
});
heights.sort(function(a, b){return b - a}); // sort the array high to low
var minh = heights[0]; // take the highest number
$(".panel-body").height(minh); // and apply that to each element
}
Now that all the panel-bodys are the same, the heights need to be cleared when the window resizes before running the "evenpanels" function again.
$(window).resize(function () {
$(".panel-body").each(function(){
$(this).css('height',""); // clear height values
});
evenpanels();
});
I add top and bottom paddings in style for the lower <div>.
<div class="xxx" style="padding: 8px 0px 8px 0px">
...
</div>
Because after all each case is different and you have to adjust according to the situation.
Chrome dev tool can be very useful in situations like this.

Find and replace url in substring from html tags in Mysql

I have tried a lot, but with no success. I have a column content (longtext) stored in a database.So, I wanna find all occurrences of https://curious-api.example.pro and replace it with http://localhost. Thanks in advance. Here is the content:
<section id="jumbotron" style="background-image: url(https://curious-api.example.pro/fixture-images/images/label_appointment_scheduling.jpg);">
</section>
<section id="solutions-article">
<div id="" class="content-aside-image img-left">
<div class="row no-gutters">
<div class="col col-12 col-md-6 image">
<figure><img src="https://curious-api.example.pro/fixture-images/images/as_what_we_do.jpg" width="100%" alt="car" /></figure>
</div>
<div class="col col-12 col-md-6 content">
<p>Curious Inc helpt u en uw bedrijf om uw planning te optimaliseren. Wij bieden uw medewerkers en uw klanten de mogelijkheid om uw agenda’s in te zien en desgewenst zelf te plannen. Wij koppelen de planning aan uw dienstverlening. Communicatie met uw klanten over de agenda en uw dienstverlening verloopt eenvoudiger, u integreert moeiteloos uw planning aan uw boekhouding en met slimme rapportages optimaliseert u uw processen. </p>
</div</div>
</div>
</section>
<section id="solution-showcases">
<div class="container-fluid">
<div class="row">
<div class="card basic transparent disable-hover">
<div class="card-inner">
<div class="card-image"><img src="https://curious-api.example.pro/fixture-images/images/CUR 003 Iconen labels_Agenda Planning.svg" alt="1" /></div>
<div class="card-body">
<h4 class="card-title">Slim plannen in de agenda</h4>
<p class="card-text">Ga slimmer om met vrije momenten. Krijg inzage in de agenda op mobiele telefoon, tablet en PC, plan sneller door automatische controle op beschikbaarheid van mens en middelen.</p>
</div>
</div>
</div>
<div class="card basic transparent disable-hover">
<div class="card-inner">
<div class="card-image"><img src="https://curious-api.example.pro/fixture-images/images/CUR 003 Iconen labels_Communicatie.svg" alt="2" /></div>
<div class="card-body">
<h4 class="card-title">Klantbeheer en communicatie</h4>
<p class="card-text">Verbeter uw service en communiceer proactief over de planning en uw dienstverlening met uw klanten. Onze producten werken met app, social media, sms, e-mail en webportaal.</p>
</div>
</div>
</div>
<div class="card basic transparent disable-hover">
<div class="card-inner">
<div class="card-image"><img src="https://curious-api.example.pro/fixture-images/images/CUR 003 Iconen labels_Boekhouding.svg" alt="3" /></div>
<div class="card-body">
<h4 class="card-title">Administratie en optimalisatie</h4>
<p class="card-text">Factureer automatisch op basis van geleverde diensten, koppel met uw boekhoudpakket en verkrijg rapportages die u helpen om nog slimmer te werken.</p>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="section-customer-stories">
<div class="container-fluid">
<figure class="customer-image"><img src="https://curious-api.example.pro/fixture-images/images/sander_borsten.png" alt="" /></figure>
<figure class="customer-logo"><img src="https://curious-api.example.pro/fixture-images/images/logo_anwb.jpg" height="65" alt="" /></figure>
</div>
</article>
</section>
</section>
How about MYSQL replace() ?
UPDATE your_tbl_name SET content = REPLACE(content,'https://curious-api.example.pro','http://localhost')
You can also speed up things with a (optional) WHERE clause e.g
UPDATE your_tbl_name SET content = REPLACE(content,'https://curious-api.example.pro','http://localhost') WHERE content LIKE '%https://curious-api.example.pro%'
If you want regex replace on mysql 5.7, you can try this: https://gist.github.com/crx4/a9fc379d4e833fc03918
Use replace()
UPDATE table_name SET content = REPLACE(content, 'https://curious-api.example.pro', 'http://localhost')

Make bootstrap boxes the same height on all devices

I have been trying to make two panels(boxes) the same size, no matter how long is the text inside them. I have realised that on my computer the two boxes are aligned, but on my laptop they aren't.
Here's how the page looks like on my laptop:
The code :
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Bine aţi venit la ATLmath!
</h1>
</div>
<div class="col-md-6">
<div class="panel panel-info">
<div class="panel-heading">
<h4><i class="glyphicon glyphicon-book"></i> Probleme rezolvate</h4>
</div>
<div class="panel-body">
<p>Puteţi găsi modele de probleme rezolvate, împreuna cu explicaţii si desene pentru a asigura fixarea cunoştinţelor. Problemele rezolvate sunt grupate in două categorii:</p>
<ul>
<li>Probleme de geometrie</li>
<li>Probleme de algebră</li>
</ul>
Probleme
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-info">
<div class="panel-heading">
<h4><i class="glyphicon glyphicon-ok"></i> Probleme de testare a cunoştinţelor</h4>
</div>
<div class="panel-body">
<p>Testele de evaluare vor testa capacitatea elevilor de a rezolva probleme similare cu cele din categoria "Probleme rezolvate". Şi aici, problemele vor fi grupate in două categorii:</p>
<ul>
<li>Probleme de geometrie</li>
<li>Probleme de algebră</li>
</ul>
Teste
</div>
</div>
</div>
</div>
I was wondering how I can make them the same height. I've searched this on google and I couldn't do anything good.
EDIT: I would like it to look like this on every device
You can achieve this by using min-width: ; and min-height: ; you can specify a minimal amount of pixels needed for the box using this, this will also prevent your website from deforming when using a different laptop/pc (screen sizes differ on each) and if you don't want it to get bigger either, you can also replace the min with max as statements too
You fix your problem using class "row-eq-height" it's a bootstrap default css for using maintain equal height of multiple columns into a row. You must check the html structure on my demo becoz i changed the structure little bit.
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Bine aţi venit la ATLmath!
</h1>
</div>
</div> .........cont..
http://codepen.io/inewton/pen/rrRwAw

Center a bootstrap column in just a certain device

I'm leaning bootstrap, and I made this a row with two columns to stack each other.
On the large devices i want it to be like that:
With the trophy a little to the top, as you can see.
But in mobile small and medium it's like that:
As you can see, the trophy isn't centered under the black div, it's possible to center it just when the columns stack each other?
html:
<div class='row'>
<div class='subir col-lg-6 col-lg-offset-1'>
<div>
<p class='titulo'>Liga Juizforana</p>
<hr size='1' align='left'>
<p class='subtit'>A Liga Juizforana tem o intuito de trazer campeonatos diversos para a cidade focando em League of Legends. A intenção do campeonato é a diversão de todos, tendo campeonatos sempre que possível para todos se interagirem, conhecerem e entrarem no cenário competitivo da cidade.</p>
</div>
</div>
<div class='grandelogo col-xs-3 col-md-3 col-lg-4'>
<img src='imagens/LigaJFLogo.png' border='0px' alt='LigaJFLogo' title='LigaJFLogo'>
</div>
</div>
you could try this CSS:
#media (max-width: 767px) {
.grandelogo {
text-align:center;
}
}
Change the actual width according to your needs
I can't see any centering element. To center it in a div, just put text-center class in a div.grandelogo classes, that is a supported way to do it in bootstrap.
If you want to have it 100% width in small devices, help yourself with col-sm or col-md settings:
<div class='row'>
<div class='subir col-sm-12 col-lg-6 col-lg-offset-1'>
<div>
<p class='titulo'>Liga Juizforana</p>
<hr size='1' align='left'>
<p class='subtit'>A Liga Juizforana tem o intuito de trazer campeonatos diversos para a cidade focando em League of Legends. A intenção do campeonato é a diversão de todos, tendo campeonatos sempre que possível para todos se interagirem, conhecerem e entrarem no cenário competitivo da cidade.</p>
</div>
</div>
<div class='grandelogo col-sm-12 col-lg-4 text-center'>
<img src='imagens/LigaJFLogo.png' border='0px' alt='LigaJFLogo' title='LigaJFLogo'>
</div>
</div>