I am showing information on MateralizeCSS cards but I want to show them side by side on medium to large devices but they are shown one over the other when using V_FOR and I do not understand the reason:
Can you help me?
According to I must show 3 cards and then 1 for the class: col s12 m4 but it shows one on top of the other in any resolution
<div class="row">
<div class="col s12 m4" v-for="item in services" :key="item.id">
<div v-for="inside in item.servicios" :key="inside.name">
<div class="card" v-if="item.id === serviceId">
<div class="card-content">
<img class="responsive-img" :src="require(`../assets/img/services/${inside.img}`)">
<h3>Lavandería</h3>
</div>
<div class="card-action">
This is a link
This is a link
</div>
</div>
</div>
</div>
</div>
Attached image of how they are displayed:
I also tried to do it with FLexbox but some images take a lot of space and look bad
You need to place all the cards inside a single row - it is not 1 row per card. Rows are block level items so they will start a new line. I replaced the image and duplicated your card markup (which starts .col) 3 times:
https://codepen.io/doughballs/pen/rNVyaBR?editors=1010
<div class="row">
<!-- Card 1 -->
<div class="col s12 m4" v-for="item in services" :key="item.id">
<div v-for="inside in item.servicios" :key="inside.name">
<div class="card" v-if="item.id === serviceId">
<div class="card-content">
<img class="responsive-img" src="https://cdn.mos.cms.futurecdn.net/ntFmJUZ8tw3ULD3tkBaAtf-650-80.jpg">
<h3>Lavandería</h3>
</div>
<div class="card-action">
This is a link
This is a link
</div>
</div>
</div>
</div>
<!-- Card 2 -->
<div class="col s12 m4" v-for="item in services" :key="item.id">
<div v-for="inside in item.servicios" :key="inside.name">
<div class="card" v-if="item.id === serviceId">
<div class="card-content">
<img class="responsive-img" src="https://cdn.mos.cms.futurecdn.net/ntFmJUZ8tw3ULD3tkBaAtf-650-80.jpg">
<h3>Lavandería</h3>
</div>
<div class="card-action">
This is a link
This is a link
</div>
</div>
</div>
</div>
<!-- Card 3 -->
<div class="col s12 m4" v-for="item in services" :key="item.id">
<div v-for="inside in item.servicios" :key="inside.name">
<div class="card" v-if="item.id === serviceId">
<div class="card-content">
<img class="responsive-img" src="https://cdn.mos.cms.futurecdn.net/ntFmJUZ8tw3ULD3tkBaAtf-650-80.jpg">
<h3>Lavandería</h3>
</div>
<div class="card-action">
This is a link
This is a link
</div>
</div>
</div>
</div>
</div>
https://materializecss.com/cards.html
Related
I have this template that is working fine.
But when I want to separate the single-course (or product) in a component, row-class not working fine and items are under each other...
This is my code:
<div class="col-lg-9">
<div class="row">
<app-single-course></app-single-course>
<app-single-course></app-single-course>
</div>
</div>
Update
this is the code without single component and its working fine if I copy it they appear side by side.
<div class="col-lg-9">
<div class="row">
<div class="col-lg-4 col-md-6">
<div class="single-course-inner style-two">
<div class="thumb">
<img src="assets/img/course/2.png" alt="img">
<div class="rating">4.9/5 <i class="fa fa-star"></i></div>
<i class="fa fa-bookmark-o"></i>
</div>
<div class="details">
<div class="meta">
<div class="row">
<div class="col-6">
<p>5,957 students</p>
</div>
<div class="col-6 text-right">
<p>01h 49m</p>
</div>
</div>
</div>
<h5>Motion Graphics: Create a Nice Typography Animation</h5>
<div class="price-inner">
<div class="row">
<div class="col-6">
<p>$33.99</p>
</div>
<div class="col-6 text-right">
<i class="fa fa-shopping-cart"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
I think you might talk about the bootstrap grid system.
Well first of all the col class comes inside the row class or else you'll always have item "under each other".
Here is the documentation with examples : https://getbootstrap.com/docs/4.5/layout/grid/
guys so I'm pulling in content from a JSON file to populate a grid of images. when the data loads it displays all the images in 1 column instead of in a grid. ideally, i would like a 4 wide image grid. All the CSS for this part of from default Bootstrap 4 values
HTML
<div id="UHD" ng-controller="Content-folders-4K">
<div id="UHD-frames" class="d-flex">
<div ng-repeat="friend in UHD" class="row">
<div id="img-frame" class="col-md-3 col-sm-6 col-xs-12">
<a href="/4k/{{friend.name}}.html">
<img alt="{{friend.name}}" src="assets/images/4k-thumbs/{{friend.name}}.jpg" class="img-fluid">
</a>
<p class="font-weight-bold text-center">{{friend.name}}</p>
</div>
</div>
</div>
</div>
Current result
Expected (simulated) result
I think You didn't wrap Your Grid with container and row class
Follow below example
<div class="container">
<div class="row">
<div class="col"> 1 of 2 </div>
<div class="col"> 2 of 2 </div>
</div>
</div>
**Wrap Your column div with container and row class **
You want to iterate the columns instead of the row...
<div id="UHD" ng-controller="Content-folders-4K">
<div id="UHD-frames" class="d-flex">
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12" ng-repeat="friend in UHD">
<a href="/4k/{{friend.name}}.html">
<img alt="{{friend.name}}" src="assets/images/4k-thumbs/{{friend.name}}.jpg" class="img-fluid">
</a>
<p class="font-weight-bold text-center">{{friend.name}}</p>
</div>
</div>
</div>
</div>
here's the code I used to get it to work.
<div id="UHD" ng-controller="Content-folders-4K" class="row">
<div ng-repeat="friend in UHD" class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
<a href="{{friend.link}}">
<div id="tiles" class="tiles">
<img src="thumbs/111/{{friend.name}}.png" alt="" />
</a>
<p class="text-center">{{friend.name}}</p>
</div>
</div>
</div>
I am facing an issue while trying to create a page contain N cards(single or multiple)
while in multiple all cards are as I want them to be, when it is a single card it shrinks and is not presented as I want it to be :
and a single card looks like this:
I am trying to understand what I am doing wrong.
this is the card HTML :
<div class="card text-white bg-danger">
<div class="card-header">
<div class="row">
<div class="col col-xs-3">
<i class="fa fa-euro">{{expenseItem.amount}}</i>
</div>
<div class="col col-xs-9 text-right">
<div class="d-block huge">{{count}}</div>
<div class="d-block">{{label}}</div>
<div class="card-body">
<div class="row">
</div>
</div>
</div>
</div>
</div>
<div class="card-footer">
<span class="float-left">Details </span>
<a href="javascript:void(0)" class="float-left card-inverse">
<span ><i class="fa fa-arrow-circle-left"></i></span>
</a>
</div>
</div>
and it is located inside acomponent that should be a list :
<div class="container">
<div class="row">
<hr>
</div>
<div class="row">
<div class="page-header">
<h1 >Comp header</h1>
<h4> total epenses per month {{expenses.total}}</h4>
<app-pagination [paginationSize]="limit" [total]="total" (requierdPage)="getPage($event)"></app-pagination>
</div>
</div>
<hr>
<!--<div class="row" >
<div class="col-xs-3 col-lg-4" *ngFor="let expense of expensesList" >
<app-expnses-item [expenseItem]="expense"></app-expnses-item>
</div>
</div>-->
<!--<div class="container">
<div class="row">
<div class="card-deck" *ngFor="let expense of expensesList">
<app-expnses-item [expenseItem]="expense"></app-expnses-item>
<!– <div class="card">
<div class="card-block">
<h4 class="card-title">Card title</h4>
<p class="card-text">This is a wider
card with supporting text below as a natural lead-in to additional content.
This content is a little bit longer.This is a wider
card with supporting text below as a natural lead-in to additional content.
This content is a little bit longer.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>–>
</div>
</div>
</div>-->
<div class="row" >
<div class="col-sm-6 col-xs-6 col-xl-6 col-md-6 col-lg-6" *ngFor="let expense of expensesList">
<app-expnses-item [expenseItem]="expense"></app-expnses-item>
</div>
</div>
<div class="row add">
<div class="col-xs-1 offset-xs-1 align-self-sm-end">
<i class="fa fa-plus-square-o fa-4x" aria-hidden="true" (click)="Uopen()"></i>
</div>
<app-add-expense (onFormSubmitted)="onDataSubmit($event)"></app-add-expense>
</div>
</div>
what am I missing here?
The .card-deck should be placed directly in container instead of row. Remove the .row as it's flexbox, and should be used only to contain grid columns (col-*) which you're not using for the .card-deck.
<div class="container">
<div class="card-deck">
<div class="card text-white bg-danger">
</div>
<div class="card text-white bg-danger">
</div>
(repeat 1..n cards)
</div>
</div>
https://www.codeply.com/go/Gmch54KdgL
I have a col-4 | col-8 layout in Bootstrap 4 Beta 3.
The first col contains a pic, the second col should contain a pic and text aside.
At the moment I have divided the second col into another row with two cols.
I need to have these to cols stick together (e.g. class=no-gutters). But the image inside gets larger than the one in the first col as soon as I remove the gutters. I cannot remove all gutters on all three cols, as there should be a margin remaining between main col 1 and 2.
Codepen:
https://codepen.io/SchweizerSchoggi/pen/mpjgLP
<div class="container mt-3">
<div class="row">
<!-- Teaser 1 -->
<div class="col-12 col-md-4" id="teaser_Umzug">
<div class="teaser-img teaser-stick">
<img src="https://placeimg.com/640/480/tech" alt="Bild XY Company Umzug" class="img-fluid z-1 mr-1" />
<div class="teaser-overlay pt-2 pl-4 z-2">
<div class="teaser-txt">
<h2 class="mb-3"></h2>
<p class="mb-4">
<span class="bold clearfix">Settelen –</span> ist Ihr Partner<br/>für regionalen und nationalen Umzug.
</p>
<button type="button" class="teaser">Mehr erfahren</button>
</div>
</div>
</div>
</div>
<!-- Teaser 2 -->
<div class="col-12 col-md-8" id="teaser_AutoService">
<div class="row">
<!-- Teaser 2 Img -->
<div class="col-12 col-md-6 bg-box-light">
<div class="ml-0 mr-0"><img src="https://placeimg.com/640/480/tech" alt="Bild XY Company Auto und Service" class="img-fluid" /></div>
</div>
<!-- Teaser 2 Text -->
<div class="col-12 col-md-6 bg-box-light">
<div class="teaser-txt pt-4 pl-4">
<p class="mb-4">
<span class="bold clearfix">XY Company –</span> Ihr starker Partner in Sachen Auto und Service.
</p>
<button type="button" class="teaser">Services</button>
</div>
</div>
</div>
</div>
</div>
Well, here's a solution I came up with...
Add the pl-md-0 class to the column for the teaser 2 image. (that removes the left padding for medium screens)
Then put the contents of the first column (that includes the teaser 1 image) into a new row-column pair.
Then add the pl-md-0 class to the inner column for the teaser 1 image.
I believe this is the effect you were going for. (I didn't touch the right paddings because I thought it wasn't necessary but you certainly could remove both the left and right paddings with the px-md-0 class.)
Here's the code:
.bg-box-light {
background-color: #eee; /* TBD ! */
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">
<div class="container mt-3">
<div class="row">
<!-- Teaser 1 -->
<div class="col-12 col-md-4" id="teaser_Umzug">
<div class="row">
<div class="col pl-md-0">
<div class="teaser-img teaser-stick">
<img src="https://placeimg.com/640/480/tech" alt="Bild XY Company Umzug" class="img-fluid z-1 mr-1" />
<div class="teaser-overlay pt-2 pl-4 z-2">
<div class="teaser-txt">
<h2 class="mb-3"></h2>
<p class="mb-4">
<span class="bold clearfix">Settelen –</span> ist Ihr Partner<br/>für regionalen und nationalen Umzug.
</p>
<button type="button" class="teaser">Mehr erfahren</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Teaser 2 -->
<div class="col-12 col-md-8" id="teaser_AutoService">
<div class="row">
<!-- Teaser 2 Img -->
<div class="col-12 col-md-6 pl-md-0 bg-box-light">
<div class="ml-0 mr-0"><img src="https://placeimg.com/640/480/tech" alt="Bild XY Company Auto und Service" class="img-fluid" /></div>
</div>
<!-- Teaser 2 Text -->
<div class="col-12 col-md-6 bg-box-light">
<div class="teaser-txt pt-4 pl-4">
<p class="mb-4">
<span class="bold clearfix">XY Company –</span> Ihr starker Partner in Sachen Auto und Service.
</p>
<button type="button" class="teaser">Services</button>
</div>
</div>
</div>
</div>
</div>
</div>
I am new to ionic framework
I need to get this view done
I have tried this thing
<div class="row">
<div class="col col-80">
<div class="row">
<img src="{{jobDetails.category.name}}.png" class="col col-10" width="30">
<span class="heading col col-10" ng-bind="jobDetails.category.name"></span>
(<span ng-bind="jobDetails.subcategory.subCategoryName" class="heading"></span>)
</div>
</div>
</div>
But i am unable to get the correct view there
Any help would be appreciated
I hope to help you with my answer below:
<div>
<div class="row">
<div class="col col-10">
<img src="" alt="not available">
</div>
<div class="col col-90">
<span>
Text goes here
</span>
</div>
</div>
<p>If the text extends in the first row ..</p>
</div>