i am trying to make my tiles look the same even text inside increase.but it does seems to be able to work even with word property.i want to make the "buy extended warranty" and ""List machines for service pack" to be same as others.
Anyone can help?
.tile {
width: 100%;
display: inline-block;
box-sizing: border-box;
background: #fff;
padding: 30px;
margin-bottom: 40px;
text-align:center;
}
.tile:hover
{
background:#F8F9F9;
}
<div class="tab-pane active" id="warranty">
<div class="col-md-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">Show warranty </a>
</div>
<div class="col-md-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">New Warranty</a>
</div>
<div class="col-md-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">Delete Warranty</a>
</div>
<div class="col-md-4 ">
<a class="tile " style="background-color:#EBDEF0;" href="#">Enter Invoice</a>
</div>
<div class="col-md-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">Enter Serial </a>
</div>
<div class="col-md-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">Buy extended warranty </a>
</div>
<div class="col-md-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">List Machines for service pack</a>
</div>
</div>
You could use flex-box for this:
css:
.tab-pane {
display: flex;
flex-wrap: wrap;
}
.tile {
width: 100%;
padding: 30px;
margin-bottom: 40px;
text-align: center;
display: block;
}
.tile:hover {
background: #F8F9F9 !important;
}
HTML
<div class="tab-pane active" id="warranty">
<div class="col-sm-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">Show warranty </a>
</div>
<div class="col-sm-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">New Warranty</a>
</div>
<div class="col-sm-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">Delete Warranty</a>
</div>
<div class="col-sm-4 ">
<a class="tile " style="background-color:#EBDEF0;" href="#">Enter Invoice</a>
</div>
<div class="col-sm-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">Enter Serial </a>
</div>
<div class="col-sm-4">
<a class="tile" style="background-color:#EBDEF0;" href="#">Buy extended warranty </a>
</div>
<div class="col-sm-4 ">
<a class="tile" style="background-color:#EBDEF0;" href="#">List Machines for service pack</a>
</div>
</div>
I adjusted the class on your col-md-4 to col-sm-4 so you could see it in action. I included the bootstrap CDN CSS, as you are using bootstrap class names in your HTML. And I added !important to override your inline color styles on the anchor tags.
Here's the fiddle to see it in action:
https://jsfiddle.net/mjqfjbh0/1/
Related
I have a carousel faq, there are some boxes with different questions and answers, so the boxes are not the same size as you can see above:
My code is this one:
<section id="faq" class="shadow-lg">
<div class="container text-center">
<h3 class="font-weight-light">Faq</h3>
<div class="row mx-auto my-auto">
<div id="recipeCarousel" class="col carousel slide w-100" data-ride="carousel">
<div class="row carousel-inner w-100" role="listbox">
<div class="carousel-item active">
<div class="col-md-4">
<div class="card card-body">
<h4 class="card-title">pergunta</h4>
<p class="card-text">resposta</p>
</div>
</div>
</div>
<div class="carousel-item">
<div class="col-md-4">
<div class="card card-body">
<h4 class="card-title">pergunta</h4>
<p class="card-text">resposta</p>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev w-auto" href="#recipeCarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon bg-dark border border-dark rounded-circle"
aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next w-auto" href="#recipeCarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon bg-dark border border-dark rounded-circle"
aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
</section>
css:
.carousel-inner .carousel-item.active,
.carousel-inner .carousel-item-next,
.carousel-inner .carousel-item-prev {
display: flex;
}
#faq{
padding-bottom: 80px;
}
#faq h3{
padding-top: 50px;
padding-bottom: 50px;
}
#faq .card{
border-color: #216869;
min-height: 400px;
}
#infos, #contato, #faq, #planos{
font-family: Montserrat-Regular;
font-size: 14px;
line-height: 1.7;
color: #666666;
margin: 0px;
}
I want the boxes to be at the same height, regardless of the size of the questions. Basically, I want all the boxes to be the same height as the largest.
I have a page with preview of images. All images are different size, but preview should be all square.
/* This is the CSS code which sets automatic height: */
.preview-img {
width: 100%;
height: auto;
object-fit: cover;
}
<div class="row">
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="#image1">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<p class="text-white">Full size</p>
</div>
</div>
<img class="img-fluid preview-img" src="img/01-thumbnail.jpg" alt="">
</a>
<div class="portfolio-caption">
<h4>Image name</h4>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="#image2">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<p class="text-white">Full size</p>
</div>
</div>
<img class="img-fluid preview-img" src="img/02-thumbnail.jpg" alt="">
</a>
<div class="portfolio-caption">
<h4>Image name</h4>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="#image3">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<p class="text-white">Full size</p>
</div>
</div>
<img class="img-fluid preview-img" src="img/03-thumbnail.jpg" alt="">
</a>
<div class="portfolio-caption">
<h4>Image name</h4>
</div>
</div>
</div>
How can I set the height of an image according to it's width, without using pixels?
.preview-img {
width: 100%;
padding-bottom: 100%;
height: 0;
object-fit: cover;
}
This should work on all major browsers.
If you can use javascript,
window.addEventListener("resize", function(e) {
var element = document.getElementsByClassName("preview-img");
mapElement.style.height = mapElement.width;
});
How can I make this angular8 component fill the whole height?
The Root Style.scss has this
html, body, app-root {
min-height: 100vh;
height: auto;
margin: 0;
}
The left green bar (DIV) needs to fill the height of the screen
.nav-left-container {
width: var(--nav-left-w) // 6rem;
height: 100vh;
background-color: var(--col-green-blue);
position: absolute;
top: 0;
left: 0;
}
HTML
<div class="nav-left-container">
<div class="nav-logo-container d-flex justify-content-center align-items-center">
<a [routerLink]="['/home']" routerLinkActive="" (click)=toHome()><img class="nav-logo-img"" alt=" "></a>
</div>
<div class="navigation-container d-flex justify-content-start align-items-center flex-column">
<div class="home d-flex justify-content-center align-items-center mt-4 mb-5">
<a [routerLink]="['/home']" routerLinkActive="" tooltip="Home" placement="right" (click)="toHome()"><img class="nav-link-img" src="../../../assets/images/ui/home.png" alt="home"></a>
</div>
<div class="search d-flex justify-content-center align-items-center mb-5">
<a [routerLink]="['/products']" routerLinkActive="" tooltip="Search" placement="right" (click)="toSearch()"><img class="nav-link-img" src="../../../assets/images/ui/barcode_search.png" alt="search"></a>
</div>
<div class="history d-flex justify-content-center align-items-center mb-5">
<a [routerLink]="['/history']" routerLinkActive="" tooltip="History" placement="right" (click)="toHistory()"><img class="nav-link-img" src="../../../assets/images/ui/history.png" alt="history"></a>
</div>
<div class="settingsd-flex justify-content-center align-items-center mb-5">
<a [routerLink]="['/settings']" routerLinkActive="" tooltip="Settings" placement="right" (click)="toSettings()"><img class="nav-link-img" src="../../../assets/images/ui/settings.png" alt="settings"></a>
</div>
</div>
</div>
The main container of the page (home and notifications (grey) have this
.home-container {
width: calc(100% - var(--nav-left-w)) // to avoid horizontal scroll;
height: 100vh;
margin-left: 6rem;
}
HTML
.home-container {
width: calc(100% - var(--nav-left-w));
height: 100vh;
margin-left: 6rem;
}
<app-nav-top></app-nav-top>
<div class="container-fluid home-container">
<div class="row">
<div class="col-md-9">
<div class="row mt-4">
<div class="col">
<div class="find-resource-wrapper mt-4">
<a (click)="onFindResource()">
<h1>Find a resource <fa-icon [icon]="faSearchPlus"></fa-icon>
</h1>
</a>
<hr>
<div class="find-resource-display-wrapper">
<app-resource-list></app-resource-list>
</div>
</div>
</div>
</div>
<!-- end find resource -->
<div class="row mt-4">
<div class="col">
<div class="offer-resource-wrapper">
<a>
<h1>Offer resource <fa-icon [icon]="faSearchPlus"></fa-icon>
</h1>
</a>
<hr>
</div>
</div>
</div>
<!-- end offer resource -->
<div class="row mt-4">
<div class="col">
<div class="cycles-wrapper">
<a>
<h1>Cycles <fa-icon [icon]="faRecycle"></fa-icon></h1>
</a>
<hr>
</div>
</div>
</div>
<!-- end cycles -->
</div>
<!-- end main left -->
<div class="col-md-3 notification-area">
<div class="row">
<div class="col">
<div class="mt-4">Logged in as</div>
<div>
<fa-icon [icon]="faEnvelope"></fa-icon> {{email}}
</div>
</div>
</div>
</div>
</div>
<!-- end notification -->
</div>
<!-- end home-container -->
<app-nav-left></app-nav-left>
How can I get the green bar to fill the whole height of the screen?
Thank you in advance.
try to make change in your css I am sure it will work.
.nav-left-container {
width: var(--nav-left-w) // 6rem;
background-color: var(--col-green-blue);
position: absolute;
top: 0;
left: 0;
bottom: 0;
}
I have a page using a masterpage in asp.net 4.0. My masterpage has header which has a search box. Header has css position fixed and have z-index 10.
I am trying to create a search instruction which will open when user types anything. my instruction box do not show as floatig over header instead it opens inside header and expands it. Here are my css and html
header {
width:100%;
display:inline-block;
background-color:#ef4023;
position:fixed;
z-index:10;
}
header #Guide {
width: 100%;
z-index: 5;
margin-right: -1px;
position:relative;
background: #eee;
border: 1px solid #ccc;
}
<header>
<div class="col-lg-4 col-md-4 col-sm-2 col-xs-4">
<div class="logo">
<img src="images/logo.png" alt="logo" class="img-responsive" />
</div>
</div>
<div class="col-lg-8 col-md-8 col-sm-10 col-xs-8">
<div class="col-md-6">
<!--SearchBarStart-->
<div ng-controller="MyCtrl">
<form>
<h3>Search Here </h3>
<input type="text" class="form-control" id="SearchKeyword" ng-model="searchText" required="required" />
<div class="list-group" id="Guide" ng-show="showLinks">
<a class="list-group-item" href="" ng-click="SearchType(0,true,'KeyWord', 1)">
<div class="input-group">
<span class="fa fa-suitcase"></span><span style="padding-left: 20px">instruction goes here</span>
</div>
</a>
</div>
</form>
</div>
</div>
</div>
</header>
You have to use position: fixed also on the instruction box, with according position settings. (relative will put it into the document flow, thereby taking up space, and absolute won't work since you don't have a relative parent for it.)
header {
width: 100%;
display: inline-block;
background-color: #ef4023;
position: fixed;
z-index: 10;
}
header #Guide {
width: 100%;
z-index: 15;
margin-right: -1px;
position: fixed;
top: 110px;
left: 0px;
background: #eee;
border: 1px solid #ccc;
}
<header>
<div class="col-lg-4 col-md-4 col-sm-2 col-xs-4">
<div class="logo">
<img src="images/logo.png" alt="logo" class="img-responsive" />
</div>
</div>
<div class="col-lg-8 col-md-8 col-sm-10 col-xs-8">
<div class="col-md-6">
<!--SearchBarStart-->
<div ng-controller="MyCtrl">
<form>
<h3>Search Here </h3>
<input type="text" class="form-control" id="SearchKeyword" ng-model="searchText" required="required" />
<div class="list-group" id="Guide" ng-show="showLinks">
<a class="list-group-item" href="" ng-click="SearchType(0,true,'KeyWord', 1)">
<div class="input-group">
<span class="fa fa-suitcase"></span><span style="padding-left: 20px">instruction goes here</span>
</div>
</a>
</div>
</form>
</div>
</div>
</div>
</header>`
I have problem with 3 object in one row there is text between two images on the desktop it show this http://www.part.lt/img/d3aabc6dea1cafd939b9cda8152403a5633.jpg on mobile looks great, i need solution any help ?
my code:
<div class="pull-left hidden-xs">
<img src="images/head_window.png" class="img-responsive">
</div>
<div class="header_title">
<h2 class="align-right">åpnes i<br/>
eller<br/>
åpne ut
</h2>
</div>
<div class="pull-right hidden-xs">
<img src="images/head_window2.png" class="img-responsive">
</div>
css
.header_title {
margin:90px auto 0px;
width: 32%;
text-align: center;
padding: 0px;
}
.header_title h2 {
font-family: 'Arimo', sans-serif;
font-size: 73px;
color: #004657;
}
Try to add columns since you using boostrap.
<div class="col-sm-5">
<div class="pull-left hidden-xs">
<img src="images/head_window.png" class="img-responsive">
</div>
</div>
<div class="col-sm-2">
<div class="header_title">
<h2 class="align-right">åpnes eller åpne ut</h2>
</div>
</div>
<div class="col-sm-5">
<div class="pull-right hidden-xs">
<img src="images/head_window2.png" class="img-responsive">
</div>
</div>