Bootstrap 3 Column Alignment - twitter-bootstrap-3

MY (COMMON) PROBLEM:
I am struggling with what I feel is an old or common problem with BootStrap 3 column alignment, but I am not sure how to articulate myself enough to find specific answers online via googling them, thus why I am posting this here.
Here is an example of my layout:
Depiction of Layout:
If you look at the first column, second row on the lower left you'll see a VERY long title, that now creates a bad alignment with the second column paragraph on the lower right and it looks unprofessional/unintentional.
WHAT I TRIED:
I've tried making a specific min-height to the h4 tags, but, of course the layout will make the layout change as the viewport changes.
I've tried specific CSS properties (like center-fix or flex???) and that only makes the element centered within the parent div, it STILL looks off and thus unprofessional.
MY CODE:
<style type="text/css">
.feature{
margin-bottom: 6%;
padding-left: 40px;
padding-right: 40px;
}
.bottom_icon_padding {
margin-bottom: 27px;
}
#other_features h4 {
text-align: center;
min-height:10%;
}
.field-item img {
padding: 0px;
}
</style>
<div class="col-md-offset-1 col-md-10">
<h4 style="color:#666;line-height: 2.3rem;">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.</h4>
<hr>
</div>
<div class="col-sm-12" id="other_features">
<div class="row">
<div class="col-md-offset-1 col-md-5 feature" ><img alt="Unmeeting Logo" src="/sites/default/files/unmeeting_logo.png" />
<h4 class="bottom_icon_padding" >Unmeeting RFAs</h4>
<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.</p>
<p>Learn more</p>
</div>
<div class="col-md-5 feature" ><img alt="Synergy Logo" src="/sites/default/files/synergy_logo.png" />
<h4 class="bottom_icon_padding" >Synergy RFAs</h4>
<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</p>
<p>Learn more</p>
</div>
</div>
<div class="row" >
<div class="col-md-offset-1 col-md-5 feature" ><img alt="Certificate Variant With Image" src="/sites/default/files/030-certificate-variant-with-image.png" />
<h4 class="bottom_icon_padding" >CTSA Program Collaborative Innovation Awards: Administrative Supplements</h4>
<p>These supplements allow investigators from two or more CTSA Program hubs to form collaborations to implement, assess, and/or disseminate discoveries in methods, approaches, education and training in clinical and translational science.</p>
<p>View site</p>
</div>
<div class="col-md-5 feature" ><img alt="Premium Badge" src="/sites/default/files/035-premium-badge.png" />
<h4 class="bottom_icon_padding" >SmartIRB</h4>
<p>SMART IRB is a platform designed to ease common challenges associated with initiating multisite research and to provide a roadmap for institutions to implement the NIH Single IRB Review policy.</p>
<p>View site</p>
</div>
</div>
</div>
MY QUESTION:
This is for a client that has ALOT of restrictions on layout so I can't just move anything around, can anyone make any suggestions so the bottom two paragraph sections align no matter what the viewport size is?

There could be one solution to set min-height:40px if you are sure of the content in your website.
Another solution could be that you modify your structure in a way that your Images come in one row and your describing text go to next row. Can post details if it suits you
.feature {
margin-bottom: 6%;
padding-left: 40px;
padding-right: 40px;
}
.bottom_icon_padding {
margin-bottom: 27px;
}
#other_features h4 {
text-align: center;
min-height: 40px;
}
}
.field-item img {
padding: 0px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="col-md-offset-1 col-md-10">
<h4 style="color:#666;line-height: 2.3rem;">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.</h4>
<hr>
</div>
<div class="col-sm-12" id="other_features">
<div class="row">
<div class="col-md-offset-1 col-md-5 feature"><img alt="Unmeeting Logo" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSqrfVof7CYYRtsdCu1VD4AWoPB2gs25PP5hQAuhOwhZngrOhsS" />
<h4 class="bottom_icon_padding">Unmeeting RFAs</h4>
<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.</p>
<p>Learn more</p>
</div>
<div class="col-md-5 feature"><img alt="Synergy Logo" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSqrfVof7CYYRtsdCu1VD4AWoPB2gs25PP5hQAuhOwhZngrOhsS" />
<h4 class="bottom_icon_padding">Synergy RFAs</h4>
<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</p>
<p>Learn more</p>
</div>
</div>
<div class="row">
<div class="col-md-offset-1 col-md-5 feature"><img alt="Certificate Variant With Image" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSqrfVof7CYYRtsdCu1VD4AWoPB2gs25PP5hQAuhOwhZngrOhsS" />
<h4 class="bottom_icon_padding">CTSA Program Collaborative Innovation Awards: Administrative Supplements</h4>
<p>These supplements allow investigators from two or more CTSA Program hubs to form collaborations to implement, assess, and/or disseminate discoveries in methods, approaches, education and training in clinical and translational science.</p>
<p>View site</p>
</div>
<div class="col-md-5 feature"><img alt="Premium Badge" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSqrfVof7CYYRtsdCu1VD4AWoPB2gs25PP5hQAuhOwhZngrOhsS" />
<h4 class="bottom_icon_padding">SmartIRB</h4>
<p>SMART IRB is a platform designed to ease common challenges associated with initiating multisite research and to provide a roadmap for institutions to implement the NIH Single IRB Review policy.</p>
<p>View site</p>
</div>
</div>
</div>
</div>

Related

v-for with varaible number of content blocks

Is there a way to have variable amount of content blocks inside a v-for loop? Say one of the instances has 1 content paragraph and an other needs 3 content paragraphs? Would you have to create a nested loop inside the outer loop?
https://codepen.io/mDDDD/pen/dyWRqJW
<div id='timeline' class="timeline container">
<div class="timeline__main">
<div
class="timeline__main--inner"
v-for="year in timelines"
:key="year.id"
ref="timelines"
>
<div class="timeline-title">
<h3 class="title-3">{{ year.year }}</h3>
</div>
<div class="timeline-content">
**(one of the instances this needed 3 P tags with class history content?)**
<p class="history-description">
{{ year.content }}
</p>
const Timeline = {
data() {
return {
timelines: [
{ id: 2020, year: '2020', content: `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. `},
{ id: 2019, year: '2019', content: `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. ` },
],
};
},
};
Vue.createApp(Timeline).mount("#timeline");
</div>
</div>
</div>
</div>
Two adjustments: (1) to the data, representing N paragraphs per year, and (2) the important one in the markup, nesting a v-for to iterate the nested array.
var app = new Vue({
el: '#app',
data() {
return {
timelines: [{
id: 2020,
year: '2020',
content: [`The first paragraph in 2020`, `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. `]
},
{
id: 2019,
year: '2019',
content: [`The first paragraph in 2019`, `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. `]
},
],
};
},
})
.timeline__main--inner {
display: flex;
margin-bottom: 75px;
}
.timeline__main {
width: 100%;
max-width: 785px;
margin: 0 auto;
}
.timeline-title {
display: flex;
align-items: center;
padding-right: 65px;
border-right: 1px solid grey;
h3 {
color: green;
font-size: 60px;
}
}
.timeline-content {
padding: 15px 54px 15px 62px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<div id='timeline' class="timeline container">
<div class="timeline__main">
<div class="timeline__main--inner" v-for="year in timelines" :key="year.id" ref="timelines">
<div class="timeline-title">
<h3 class="title-3">{{ year.year }}</h3>
</div>
<div class="timeline-content">
<p class="history-description" v-for="(p,i) in year.content" :key="i">
{{ p }}
</p>
</div>
</div>
</div>
</div>
</div>

How to customize image size for card in vue bootstrap

I am working on a NuxtJS project, with BootstrapVue as front-end framework. I am trying to edit the size of an image inserted inside the title of a card, with the following code:
<b-card
bg-variant="primary"
text-variant="white"
img-alt="Image"
img-src="~/assets/images/house.png"
header="The house"
class="text-center position-relative"
>
<b-card-text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</b-card-text>
<b-button variant="primary" class="paragraph stretched-link"
>Click here</b-button
>
</b-card>
Does anyone know if is possible to customize the style of the image through the b-card properties (without CSS)? The documentation did not helped me.
You could use img-height and img-width to provide the image size inside the card, they accepts a string or a number as values :
<b-card
bg-variant="primary"
text-variant="white"
img-alt="Image"
img-src="~/assets/images/house.png"
img-height="200"
img-width="200"
header="The house"
class="text-center position-relative"
>

How to pass imageUrl as props?

Here is my component. It takes a props imageUrl which is String referring either an image from a URL or a reference to a local asset from the assets folder
<template>
<div class="flex" style="height: 155px;align-items: center">
<div class="avatar" style="height: 130px;width: 130px">
<img :src="require(`imageUrl`)" height="130" width="130" style="border-radius: 50%"/>
</div>
<div class="flex flex-column" style="margin-left: 31px">
<div class="flex" style="font-weight: bold">
{{fullName}}
</div>
<div class="flex" style="">
{{title}}
</div>
<div style="height: 20px"></div>
<div class="flex" style="text-align: start">
{{content}}
</div>
</div>
</div>
</template>
<script>
export default {
name: "ReviewTile",
props: {
imageUrl: String,
fullName: String,
title: String,
content: String
}
}
</script>
<style scoped>
</style>
I use it like this:
<ReviewTile
image-url="../assets/Eugene.png"
full-name="Eugene B.
"
title="UI/UX Designer."
content=" Christabel is one of the business world’s truly great deal makers and strategists, easily on par with
the best of the strategy consultants and designers I have worked with at SOS-HGIC and Kleio. She is also
a world-class human being."
></ReviewTile>
<div style="background-color: #b7b7b7;height: 1px; margin: 33px 0px"></div>
<ReviewTile
image-url="../assets/headshot_black1.png"
full-name="Gilliam D."
title="Web designer/Developer"
content="Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo."
></ReviewTile>
But images are not loading.
There is a strange JS bug that breaks proper image loading (sry, I forgot what it was, but I found the solution on stackoverflow a while ago).
What helps is breaking the image request up like this:
:src="require('#/assets/' + imageName + '')"
So you only have your image name in the prop and load it without the curly brackets. Now you also don't have to worry about the correct path. The # will find the correct folder.
If anyone can explain the technicalities of this better or finds the other thread with the solution, please feel free to expand on my answer.
Edit: First part of the explanation: Webpack can't work with only a variable as path, because then it would have to go over potentially thousands of files. So you have to have the #/assets/ part as text. Explained more nicely here: Vue.js dynamic image src with webpack require() not working
Couldn't find yet why the curly brackets don't work.
If all your images are in the same folder your can just pass the file name as props:
<ReviewTile
image-url="Eugene.png"
...
></ReviewTile>
<ReviewTile
image-url="headshot_black1.png"
...
></ReviewTile>
Then in the ReviewTitle component, require the imageUrl with the assets path:
<div class="avatar">
<img :src="require(`../assets/${imageUrl}`)" />
</div>
Note:
If all the images have the same extension .png you can even just write the file name like image-url="Eugene" and in the component: <img :src="require(`../assets/${imageUrl}.png`)" />
if you are sending the path of the image in the url, then you can use the props directly,
but make sure you are providing the right path to the image.
<img :src="imageUrl" height="130" width="130" style="border-radius: 50%"/>
also change your prop name in the other component
// Wrong
<ReviewTile
image-url="../assets/Eugene.png"
full-name="Eugene B.
// correct one would be something like this
<ReviewTile
:imageUrl="../assets/Eugene.png"
full-name="Eugene B.
For those using Nuxt.js for the Vue apps - there is simple solution using static folder instead of assets.
The key difference between these two folders is that static is not compiled by Webpack - therefore you are free to use variables as you please.
See the docs:
https://nuxtjs.org/docs/2.x/directory-structure/static

Vue JS transition toggle based of class binded - ease down and up

Using Vue JS i am trying to transition the read more/read less by dropping/closing by transitioning the max-height properties with ease.
This itemBio is sitting in a bootstrap vue modal (if this is relevant).
If the readMore data is true then the readMore class is binded to the itemBio class div. This then activates the max-height property to 100%.
Though doesn't seem to be working at all. Just instantly shows/closes the div.
this is what i have so far:
.itemBio {
max-height: 51px;
overflow: hidden;
transition: max-height 5s ease;
&.readMore {
max-height: 100%;
overflow: auto;
transition: max-height 5s ease;
&::-webkit-scrollbar {
display: none;
}
}
}
<div class="itemBio font-14 text-grey69 w-100"
:class="{'readMore':readMore}"
style="line-height: 17px;"
:ref="'countLines' + menuItem.uuid">
{{ menuItem.description }}
<button #click="$refs.allergensModal.show()"
class="mt-10 w-100 text-left"
v-if="dietaryTrue !== 0"
>
<span class="allergen green"
v-if="menuItem.dietary.vegetarian">
V
</span>
<span class="allergen aqua"
v-if="menuItem.dietary.vegan">
VG
</span>
<span class="allergen gold"
v-if="menuItem.dietary.gluten_free">
GF
</span>
<span class="allergen pink"
v-if="menuItem.dietary.halal">
HA
</span>
<span class="allergen yellow"
v-if="menuItem.dietary.soy_free">
SF
</span>
<span class="allergen brown"
v-if="menuItem.dietary.nut_free">
NF
</span>
<span class="allergen blue"
v-if="menuItem.dietary.dairy_free">
DF
</span>
</button>
</div>
<button class="text-teal font-black font-12" #click="showItemBio()" v-if="lines > 2">
<span v-if="!readMore">Read More</spa`enter code here`n>
<span v-if="readMore">Read Less</span>
</button>
Typescript:
readMore: boolean = false;
showItemBio() {
this.readMore = !this.readMore;
}
I have made one sample example. Check this once. This may help.(you mention 100% in max-height and in starting max-height you mentioned 51px thats might be the problem for not transitioning. Maintain both in px or %)
<template>
<div id="app">
<div class="paragraph" :class="{showmore:checkStatus}">
<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.
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
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.
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</p>
</div>
<button #click="changeData">{{ readStatus }}</button>
</div>
</template>
<script>
export default {
name: 'App',
data:function(){
return {
readStatus:'readmore',
checkStatus:false
}
},
methods:{
changeData:function(){
if(this.readStatus=='readmore'){
this.readStatus='readless';
this.checkStatus=true;
}else{
this.readStatus='readmore';
this.checkStatus=false;
}
}
}
}
</script>
<style scoped>
.paragraph {
max-height: 100px;
overflow: hidden;
transition: max-height 2s;
}
.paragraph p{
color: black;
}
.showmore{
max-height: 500px;
overflow: auto;
}
</style>

Hide content on articlebody schema structured data

I have my itemtype="http://schema.org/BlogPosting" but inside the articleBody tag, I have content I want to hide for google, but keep visible for users.
<div itemprop="articleBody">
<p>Aliquam nisi libero, convallis sit amet lectus id, posuere rutrum dolor. Sed consectetur ligula at viverra rhoncus.</p>
<div class"related">list of related posts</div>
</div>
On the structured data testing tool, the content inside div class"related" appear on the articleBody as text. I would like to hide the entire content inside the div to make articleBoy only focus on post content.
Any help is really appreciated!
Many thanks
Peter
I'm having trouble understanding your definition of 'hide'.
I don't see why you would want to hide valuable, relatable content from your website that search engines will crawl, so I'm going to assume you mean hiding from the structured testing tool.
As you have only provided a snippet of code it's hard to know what you have already written.
Markup
First of all, in an ideal scenario you want to markup your article using the article tag.
Your markup should now be structured like:
<article itemscope itemtype="http://schema.org/Article">
<header>
<h1 itemprop="headline">Blog Title</h1>
<time datetime="2016-10-03">03 September 2016</time>
</header>
<div itemprop="articleBody">
<p>The article element represents a self contained article or document.</p>
<div class="related">list of related posts</div>
</div>
</article>
You should take the related content out of the <div itemprop="articleBody"> and place it within an <aside> within the <article> for the following reasons.
Definition of aside
The HTML element represents a section of the page with content connected tangentially to the rest, which could be considered separate from that content. These sections are often represented as sidebars or inserts. They often contain the definitions on the sidebars, such as definitions from the glossary; there may also be other types of information, such as related advertisements; the biography of the author; web applications; profile information or related links on the blog.
Source - Mozilla Developer Network
Usage of aside
When used within an article element, the contents should be specifically related to that article (e.g., a glossary). When used outside of an article element, the contents should be related to the site (e.g., a blogroll, groups of additional navigation, and even advertising if that content is related to the page).
Source - Aside Revisited
Your markup should now include an <aside> and be structured like:
<article itemscope itemtype="http://schema.org/Article">
<header>
<h1 itemprop="headline">Blog Title</h1>
<time datetime="2016-10-03">03 September 2016</time>
</header>
<div itemprop="articleBody">
<p>The article element represents a self contained article or document.</p>
</div>
<aside class="related">
<header>
<h2>Related content</h2>
</header>
</aside>
</article>
Validation
In order to pass validation for Google Structured data testing tool you are required to add more information for article.
You can either have:
Marked up (visible, recommended)
Use the <meta itemprop="name" content="content" /> (invisible)
For example:
<span itemprop="author">John Doe</span>
<meta itemprop="author" content="content" />
Route 1 is preferred as you can mark them up with the relevant schema, in this instance Person
Complete Markup
I have added in the required HTML/Schema to pass validation for Google Structured data testing tool.
<article itemscope itemtype="http://schema.org/Article">
<header>
<h1 itemprop="headline">Blog Title</h1>
<time itemprop="datePublished" datetime="2016-10-03">03 September 2016</time>
<p itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">John Doe</span>
</p>
<div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
<div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
<img src="http://placekitten.com/200/50" alt=""/>
<meta itemprop="url" content="http://placekitten.com/200/50">
<meta itemprop="width" content="200">
<meta itemprop="height" content="50">
</div>
<meta itemprop="name" content="Blog name">
</div>
</header>
<div itemprop="articleBody">
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<img src="http://placekitten.com/300/300" alt="Kitten, cute kitten"/>
<meta itemprop="url" content="http://placekitten.com/300/300">
<meta itemprop="width" content="300">
<meta itemprop="height" content="300">
</div>
<p>The article element represents a self contained article or document.</p>
</div>
<aside class="related">
<header>
<h2>Related content</h2>
</header>
</aside>
</article>
Codepen demo
Validated
✔ HTML5 Validation
✔ Google Structured data testing tool