I'm having the below source code in HTML that basically is a Bootstrap card:
<div class="card shadow-none card-fluid mb-3 mb-md-5">
<div class="row">
<div class="col-md-3 col-lg-3 mb-3 mb-sm-0">
<img class="img-fluid rounded"
src="{% static 'img url' %}"
alt="Image Description">
</div>
<div class="col-md-9">
<div class="card-header py-md-0 py-lg-0 py-xl-0 pl-0 pr-0">
<h6 class="h5 mb-3">Text of 100 characters Text of 100 characters Text of 100
characters Text of 100 characters Text of 100 characters
</h6>
<p class="font-size-1">
Text of 20 characters.
</p>
</div>
<div class="card-body p-0 px-0 py-md-0 py-lg-0 py-xl-0">
<div class="row">
<div class="col-8 text-left">
<a class="d-inline-flex align-items-center">
<span class="static-rating static-rating-sm d-block mr-2">
<i class="fas fa-star text-warning"></i>
<i class="fas fa-star text-warning"></i>
<i class="fas fa-star text-warning"></i>
<i class="fas fa-star text-warning"></i>
<i class="fas fa-star-half-alt text-warning"></i>
</span>
</a>
<span class="d-inline-block">
<h6 class="mt-0 mb-2">4.95/5
<small class="text-white-70">(1.5k+)</small>
</h6>
</span>
</div>
</div>
</div>
<div class="card-footer p-3 py-md-2 py-lg-2 mt-xl-5">
<div class="row align-items-center">
<div class="col-6">
<button type="button"
class="btn btn-sm btn-link btn-icon-label hover-translate-y-n3">
<span class="btn-inner--icon btn-cust-icon">
<i class="mr-1" data-feather="edit-3"></i>
</span>
<span class="btn-inner--text">Edit</span>
</button>
</div>
<div class="col-6 text-right">
<button type="button"
class="btn btn-xs btn-outline-danger btn-icon-label hover-translate-y-n3">
<span class="btn-inner--icon">
<i data-feather="trash-2"></i>
</span>
<span class="btn-inner--text">Delete</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
The issue I'm facing is that depending on the size of the text within card-header class, the div corresponding to the one having class card-footer it moves up or down. Is there any way to keep the card-footer static and only to limit the size of the text to let's say 120 chars?
Edit
Added the following snippet:
.custom-css {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
/* number of lines to show */
-webkit-box-orient: vertical;
}
<li class="card shadow-none card-fluid mb-3 mb-md-5">
<div class="row">
<div class="col-md-3 col-lg-3 mb-3 mb-sm-0">
<img class="img-fluid rounded" src="{% static 'img url' %}" alt="Image Description">
</div>
<div class="col-md-9">
<div class="card-header py-md-0 py-lg-0 py-xl-0 pl-0 pr-0">
<h6 class="h5 mb-3 custom-css">Text 100 charactersText 100 charactersText 100 charactersText 100 charactersText 100 charactersText 100 charactersText 100 charactersText 100 charactersText 100 characterscharactersText 100 charactersText 100 charactersText 100 charactersText
100 charactersText 100 charactersText 100 charactersText 100 characterscharactersText 100 charactersText 100 charactersText 100 charactersText 100 charactersText 100 charactersText 100 charactersText 100 characters
</h6>
<p class="font-size-1">
Text length medium
</p>
</div>
<div class="card-body p-0 px-0 py-md-0 py-lg-0 py-xl-0">
<div class="row">
<div class="col-8 text-left">
<a class="d-inline-flex align-items-center">
<span class="static-rating static-rating-sm d-block mr-2">
<i class="fas fa-star text-warning"></i>
<i class="fas fa-star text-warning"></i>
<i class="fas fa-star text-warning"></i>
<i class="fas fa-star text-warning"></i>
<i class="fas fa-star-half-alt text-warning"></i>
</span>
</a>
<span class="d-inline-block">
<h6 class="mt-0 mb-2">4.95/5
<small class="text-white-70">(1.5k+ review-uri)</small>
</h6>
</span>
</div>
</div>
</div>
</div>
</div>
</li>
you could give it a min-height and max-height and also min-width and max-width to sort of contain it between these values.
Related
My site is responsive on all media by displaying it in a browser. When I load it in the android webview the display is distorted. I found that there are class bootstrap 5 which work badly. Its classes are position classes.
such as: .position-relative, .position-static and .position-absolute.
The css of its class does not work with the android webview.
Does anyone have an idea for the webview to take positional css into account.
Exemple css :
.position-static
position: static !important;
.position-relative
position: relative !important;
.position-absolute
position: absolute !important;
Example HTML:
<div class="row g-0 border rounded overflow-hidden flex-md-row mb-2 shadow-sm h-md-250 position-relative">
<div class="col-auto d-lg-block">
<a href="/ad-categories/21" hreflang="zxx"><img loading="lazy" src="/sites/default/files/styles/thumbnail/public/2022-10/sauce%20pistache.jpg ?itok=RcWqSOZN" width="100" height="100" alt="" typeof="foaf:Image" class="img-fluid image-style-thumbnail">
</a>
<div class="label-top shadow-sm">
<i class="fa fa-star" aria-hidden="true"></i>
</div>
</div>
<div class="col d-flex flex-column position-static small">
<div class="d-flex bd-highlight">
<div class="flex-fill bd-highlight">
<h5 class="card-title small "><span class="field field--name-title field--type-string field--label-hidden">MAÏTE DEHYDRATED SAUCES</span>
</h5>
</div>
</div>
<div class="d-flex bd-highlight departure-date">
<div class="flex-fill bd-highlight text-muted small">
<p class="card-text address"><i class="fa fa-map-o text-info"></i> Abidjan,CI</p>
</div>
<div class="flex-fill bd-highlight small">
<span class="badge rounded-pill bg-success border border-light text-light fw-bold">
Premium
<span class="visually-hidden">New alerts</span>
</span>
</div>
</div>
<div class="d-flex bd-highlight">
<div class="flex-fill bd-highlight text-muted small">
<div class="field field--name-field-categories field--type-entity-reference field--label-hidden field__item"><div class="contextual-region term-categories-icon d-flex justify-content -start" about="/taxonomy/term/4">
<div class="field field--name-field-icon field--type-fontawesome-icon field--label-hidden field__item"><div class="fontawesome-icons">
<div class="fontawesome-icon">
<i class="fas fa-beer food-drink" data-fa-transform="" data-fa-mask="" style="--fa-primary-color: #000000; --fa-secondary-color : #000000; food-drink"></i>
</div>
</div>
</div>
<a class="link" href="/ad-categories?categories_id=4">
<div class="field field--name-name field--type-string field--label-hidden field__item">Food & drink</div>
</a>
</div></div>
</div>
<div class="flex-fill bd-highlight text-muted small">
<span class="align-middle"><i class="fa fa-map-marker"></i> Abidjan</span>
</div>
</div>
</div>
</div>
I don't have any experience with html, so I am using a free template for my website that uses fadeInUp to display images. When the page is first loaded one section overlaps the images on top of each other and even on top of a contact form at the bottom of the page. Shown here:
Overlapping Images
This persists until the page is reloaded, then it all works like it's supposed to. I've tried for days to find a solution, but with my extremely limited knowledge, it's hard to even know what to look for. Here is what it should look like and what it does look like once the page is reloaded:
Correct Layout
I'm hoping someone can help me figure out why this is happening. Happens in Safari, Chrome, and Edge and each time it is fixed when I reload.
Here is the code from the free template (modified by me to add descriptions and the correct images):
<!-- Projects Start -->
<div class="container-xxl py-5">
<div class="container">
<div class="section-title text-center">
<h1 class="display-5 mb-5">Portfolio Samples</h1>
</div>
<div class="row g-4 portfolio-container">
<div class="col-lg-4 col-md-6 portfolio-item first wow fadeInUp" data-wow-delay="0.1s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/ShojiLamp.jpg" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/ShojiLamp.jpg" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">For Sale</p>
<h4 class="mb3">Shoji Lamp</h4>
<p>Japanese inspired shoji lamp in walnut with maple panels. Castle joinery throughout.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item second wow fadeInUp" data-wow-delay="0.3s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/ChessBoard.jpg" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/ChessBoard.jpg" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">Custom Woodworking</p>
<h4 class="mb3">Chess Board</h4>
<p>Simple chessboard made from 19mm thick walnut with 4mm thick curly maple inlays. </p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item first wow fadeInUp" data-wow-delay="0.5s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/3dCuttingBoard.jpeg" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/3dCuttingBoard.jpeg" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">For Sale</p>
<h4 class="mb3">Bella Cutting Board</h4>
<p>50mm thick end grain cutting board crafted in walnut and hard maple. Featuring a 3D effect.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item second wow fadeInUp" data-wow-delay="0.1s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/TableLamp.jpg" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/TableLamp.jpg" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">For Sale - 2 available</p>
<h4 class="mb3">Riley Table Lamp</h4>
<p>A tilted shade and bent body offers a twist on a tradional table lamp with the cord threaded through the body. Crafted in walnut.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item first wow fadeInUp" data-wow-delay="0.3s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/EntrywayTable.jpg" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/EntrywayTable.jpg" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">For Sale</p>
<h4 class="mb3">Entryway Table</h4>
<p>A delicate live edge entryway table in spalted ash with walnut bowtie inlays. Cracks filled with black epoxy. Box joinery on the apron. </p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item second wow fadeInUp" data-wow-delay="0.5s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/GearShiftKnob.png" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/GearShiftKnob.png" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">Custom Woodworking</p>
<h4 class="mb3">Gear Shift Knob </h4>
<p>A custom gear shift knob commisioned in support of a loved one's fight with stomach cancer. Crafted in walnut with epoxy inlay.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Projects End -->
I have a Drupal 8 TWIG file with this code :
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4 p-0 text-center">
<i class="far fa-heart fa-lg"></i> {{ product.flag_like_product }}
</div>
Is it possible to exclude the following code :
<div class="flag flag-like-product js-flag-like-product-14 action-flag">
<a title="" href="/fr/flag/details/flag/like_product/14?destination=/fr/boutique/exemple-dune-boutique" class="use-ajax" data-dialog-type="modal" data-dialog-options="{"width":"auto"}" rel="nofollow">
<span class="btn btn-outline-success btn-sm">
<i class="far fa-heart fa-lg"></i> J'aime
</span>
</a>
</div>
Here is the rendering of the code :
<div class="row p-0 m-0">
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4 p-0 text-center">
<i class="far fa-heart fa-lg"></i>
<div class="bs-field-like-link">
<div class="flag flag-like-product js-flag-like-product-14 action-flag">
<a title="" href="/fr/flag/details/flag/like_product/14?destination=/fr/boutique/exemple-dune-boutique" class="use-ajax" data-dialog-type="modal" data-dialog-options="{"width":"auto"}" rel="nofollow">
<span class="btn btn-outline-success btn-sm">
<i class="far fa-heart fa-lg"></i> J'aime
</span>
</a>
</div>
</div>
<span class="bs-field-like-count">
1
</span>
</div>
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4 p-0 text-center">
<i class="far fa-comment fa-lg"></i> 0
</div>
<div class="col-4 col-sm-4 col-md-4 col-lg-4 col-xl-4 p-0 text-center">
<i class="fas fa-share-alt fa-lg"></i> 0
</div>
</div>
HTML
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-2"></div>
<div class="col-2 Jumbooptions" id="create" onclick="location.href='#';">
<p class="efr">Create</p>
<i class="fas fa-plus fa-2x" id="ci"></i>
</div>
<div class="col-2 Jumbooptions" id="add" onclick="location.href='#';">
<p class="efr">Add</p>
<i class="fas fa-address-book fa-2x" id="ai"></i>
</div>
<div class="col-2 Jumbooptions" id="stats" onclick="location.href='#';">
<p class="efr">Statistics</p>
<i class="fas fa-chart-pie fa-2x" id="si"></i>
</div>
<div class="col-2 Jumbooptions" id="export" onclick="location.href='#';">
<p class="efr">Export</p>
<i class="fas fa-file-export fa-2x" id="ei"></i>
</div>
</div>
<div class="row" id="bigger">
<div class="col-2" id=""></div>
<div id="created" class="dropdown col-4">
<h2>CREATE</h2>
<p>as many sheets as you want with ease!</p>
</div>
<div id="addd" class="dropdown col-4">
</div>
<div id="statsd" class="dropdown col-4">
</div>
<div id="exportd" class="dropdown col-4">
</div>
</div>
</div>
</div>
CSS
height:70px !important;
width:700px;
margin-left:47px
}
If I make the "height" any more than 70 the rest of the row goes to the start of the jumbotron
When height is less than 70: https://gyazo.com/6601be928cb893b5355c78fbc792e694
When height is more than 70 (200): https://gyazo.com/6b6f96fa6eadcffc6db3dd427cac8d03
I'm really not sure what to do.
How do I move a whole div element to the right side? At present both div:s are appearing side by side. Please see the image I provided, I want to make it work like that.
Please help me with this. Thanks in Advance
<div class="d-flex align-items-start summary" style="margin-bottom: 10px;">
<img [src]="imagePath" style="width: 150px;max-height: 150px;clip-path: square(22px at center);" class="mr-3 d-none d-sm-block"
alt="...">
<i (click)="inputFile.click()" *ngIf="isEditItems" style="color : white;left: 155px;
position: absolute; top: 28px; padding: 3px; background-color: rgb(0, 195, 255);
border-radius: 50%;font-size: 12px;"
class="fa fa-pencil fa-lg" aria-hidden="true"></i>
<div>
<div class="col-sm">
<div class="office-address-heading">
<b>Office Address</b>
</div>
<div class="d-flex align-items-center">
<i class="fa fa-map-marker fa-2x mr-2" aria-hidden="true"></i>
<address class="mb-0">
{{myprofile?.OfficeAddress}}
</address>
</div>
</div>
<hr />
<div class="col-sm">
<div class="office-address-heading">
<b>Communication Details</b>
</div>
<div class="d-flex align-items-center office-address-details">
<i class="fa fa-phone fa-2x mr-2" aria-hidden="true"></i>
<div>{{myprofile?.Phone}}</div>
<span class="d-flex align-items-center mail office-address-details">
<i class="fa fa-envelope fa-2x mr-2" aria-hidden="true"></i>
<div>
{{myprofile?.Email}}
</div>
</span>
</div>
</div>
</div>
</div>
Here we go please use this
.d-flex.align-items-start.summary {
display: flex;
flex-direction: row;
justify-content:space-between;
margin:auto;
max-width:1170px;
width:100%;
}
<div class="d-flex align-items-start summary" style="margin-bottom: 10px;">
<img src="https://image.flaticon.com/icons/svg/147/147144.svg" style="width: 150px;max-height: 150px;clip-path: square(22px at center);" class="mr-3 d-none d-sm-block"
alt="...">
<i (click)="inputFile.click()" *ngIf="isEditItems" style="color : white;left: 155px;
position: absolute; top: 28px; padding: 3px; background-color: rgb(0, 195, 255);
border-radius: 50%;font-size: 12px;"
class="fa fa-pencil fa-lg" aria-hidden="true"></i>
<div>
<div class="col-sm">
<div class="office-address-heading">
<b>Office Address</b>
</div>
<div class="d-flex align-items-center">
<i class="fa fa-map-marker fa-2x mr-2" aria-hidden="true"></i>
<address class="mb-0">
{{myprofile?.OfficeAddress}}
</address>
</div>
</div>
<hr />
<div class="col-sm">
<div class="office-address-heading">
<b>Communication Details</b>
</div>
<div class="d-flex align-items-center office-address-details">
<i class="fa fa-phone fa-2x mr-2" aria-hidden="true"></i>
<div>{{myprofile?.Phone}}</div>
<span class="d-flex align-items-center mail office-address-details">
<i class="fa fa-envelope fa-2x mr-2" aria-hidden="true"></i>
<div>
{{myprofile?.Email}}
</div>
</span>
</div>
</div>
</div>
</div>