I have an HTML/CSS chat that I'm in the process of making work through the WebSocket API, but I'm hitting an issue with Chrome only
(I tested this to work okay in Firefox, Brave, Safari) where the div containing my input field and my send button is just not shown at all on the page.
This is what it looks like in Chrome
And now in other browsers
body {
background: #ddd;
}
a {
text-decoration: none !important;
}
label {
color: rgba(120, 144, 156, 1.0) !important;
}
.btn:focus,
.btn:active:focus,
.btn.active:focus {
outline: none !important;
box-shadow: 0 0px 0px rgba(120, 144, 156, 1.0) inset, 0 0 0px rgba(120, 144, 156, 0.8);
}
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.uneditable-input:focus {
border-color: rgba(120, 144, 156, 1.0);
color: rgba(120, 144, 156, 1.0);
opacity: 0.9;
box-shadow: 0 0px 0px rgba(120, 144, 156, 1.0) inset, 0 0 10px rgba(120, 144, 156, 0.3);
outline: 0 none;
}
.card::-webkit-scrollbar {
width: 1px;
}
::-webkit-scrollbar-thumb {
border-radius: 9px;
background: rgba(96, 125, 139, 0.99);
}
.balon1,
.balon2 {
margin-top: 5px !important;
margin-bottom: 5px !important;
}
.balon1 a {
background: #42a5f5;
color: #fff !important;
border-radius: 20px 20px 3px 20px;
display: block;
max-width: 75%;
padding: 7px 13px 7px 13px;
}
.balon1:before {
content: attr(data-is);
position: absolute;
right: 15px;
bottom: -0.8em;
display: block;
font-size: .750rem;
color: rgba(84, 110, 122, 1.0);
}
.balon2 a {
background: #f1f1f1;
color: #000 !important;
border-radius: 20px 20px 20px 3px;
display: block;
max-width: 75%;
padding: 7px 13px 7px 13px;
}
.balon2:before {
content: attr(data-is);
position: absolute;
left: 13px;
bottom: -0.8em;
display: block;
font-size: .750rem;
color: rgba(84, 110, 122, 1.0);
}
.bg-sohbet:before {
content: "";
background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAgOCkiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PGNpcmNsZSBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS4yNSIgY3g9IjE3NiIgY3k9IjEyIiByPSI0Ii8+PHBhdGggZD0iTTIwLjUuNWwyMyAxMW0tMjkgODRsLTMuNzkgMTAuMzc3TTI3LjAzNyAxMzEuNGw1Ljg5OCAyLjIwMy0zLjQ2IDUuOTQ3IDYuMDcyIDIuMzkyLTMuOTMzIDUuNzU4bTEyOC43MzMgMzUuMzdsLjY5My05LjMxNiAxMC4yOTIuMDUyLjQxNi05LjIyMiA5LjI3NC4zMzJNLjUgNDguNXM2LjEzMSA2LjQxMyA2Ljg0NyAxNC44MDVjLjcxNSA4LjM5My0yLjUyIDE0LjgwNi0yLjUyIDE0LjgwNk0xMjQuNTU1IDkwcy03LjQ0NCAwLTEzLjY3IDYuMTkyYy02LjIyNyA2LjE5Mi00LjgzOCAxMi4wMTItNC44MzggMTIuMDEybTIuMjQgNjguNjI2cy00LjAyNi05LjAyNS0xOC4xNDUtOS4wMjUtMTguMTQ1IDUuNy0xOC4xNDUgNS43IiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS4yNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PHBhdGggZD0iTTg1LjcxNiAzNi4xNDZsNS4yNDMtOS41MjFoMTEuMDkzbDUuNDE2IDkuNTIxLTUuNDEgOS4xODVIOTAuOTUzbC01LjIzNy05LjE4NXptNjMuOTA5IDE1LjQ3OWgxMC43NXYxMC43NWgtMTAuNzV6IiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS4yNSIvPjxjaXJjbGUgZmlsbD0iIzAwMCIgY3g9IjcxLjUiIGN5PSI3LjUiIHI9IjEuNSIvPjxjaXJjbGUgZmlsbD0iIzAwMCIgY3g9IjE3MC41IiBjeT0iOTUuNSIgcj0iMS41Ii8+PGNpcmNsZSBmaWxsPSIjMDAwIiBjeD0iODEuNSIgY3k9IjEzNC41IiByPSIxLjUiLz48Y2lyY2xlIGZpbGw9IiMwMDAiIGN4PSIxMy41IiBjeT0iMjMuNSIgcj0iMS41Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTkzIDcxaDN2M2gtM3ptMzMgODRoM3YzaC0zem0tODUgMThoM3YzaC0zeiIvPjxwYXRoIGQ9Ik0zOS4zODQgNTEuMTIybDUuNzU4LTQuNDU0IDYuNDUzIDQuMjA1LTIuMjk0IDcuMzYzaC03Ljc5bC0yLjEyNy03LjExNHpNMTMwLjE5NSA0LjAzbDEzLjgzIDUuMDYyLTEwLjA5IDcuMDQ4LTMuNzQtMTIuMTF6bS04MyA5NWwxNC44MyA1LjQyOS0xMC44MiA3LjU1Ny00LjAxLTEyLjk4N3pNNS4yMTMgMTYxLjQ5NWwxMS4zMjggMjAuODk3TDIuMjY1IDE4MGwyLjk0OC0xOC41MDV6IiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS4yNSIvPjxwYXRoIGQ9Ik0xNDkuMDUgMTI3LjQ2OHMtLjUxIDIuMTgzLjk5NSAzLjM2NmMxLjU2IDEuMjI2IDguNjQyLTEuODk1IDMuOTY3LTcuNzg1LTIuMzY3LTIuNDc3LTYuNS0zLjIyNi05LjMzIDAtNS4yMDggNS45MzYgMCAxNy41MSAxMS42MSAxMy43MyAxMi40NTgtNi4yNTcgNS42MzMtMjEuNjU2LTUuMDczLTIyLjY1NC02LjYwMi0uNjA2LTE0LjA0MyAxLjc1Ni0xNi4xNTcgMTAuMjY4LTEuNzE4IDYuOTIgMS41ODQgMTcuMzg3IDEyLjQ1IDIwLjQ3NiAxMC44NjYgMy4wOSAxOS4zMzEtNC4zMSAxOS4zMzEtNC4zMSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjEuMjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjwvZz48L3N2Zz4=');
opacity: 0.06;
top: 0;
left: 0;
bottom: 0;
right: 0;
height: 100%;
position: absolute;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="jumbotron m-0 p-0 bg-transparent">
<div class="row m-0 p-0 position-relative">
<div class="col-12 p-0 m-0 position-absolute" style="right: 0px;">
<div class="card border-0 rounded" style="box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10), 0 6px 10px 0 rgba(0, 0, 0, 0.01); overflow: hidden; height: 100vh;">
<div class="card-header p-1 bg-light border border-top-0 border-left-0 border-right-0" style="color: rgba(96, 125, 139,1.0);">
<img class="rounded float-left" style="width: 50px; height: 50px;" src="https://i.pinimg.com/736x/5c/24/69/5c24695df36eee73abfbdd8274085ecd--cute-anime-guys-anime-boys.jpg" />
<h6 class="float-left" style="margin: 0px; margin-left: 10px;"> Yusuf Bulgurcu <i class="fa fa-check text-primary" title="Onaylanmış Hesap!" aria-hidden="true"></i> </br>
<small> İstanbul, TR</small>
</h6>
<div class="dropdown show">
<a id="dropdownMenuLink" data-toggle="dropdown" class="btn btn-sm float-right text-secondary" role="button">
<h5><i class="fa fa-ellipsis-h" title="Ayarlar!" aria-hidden="true"></i>
</h5>
</a>
<div class="dropdown-menu dropdown-menu-right border p-0" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item p-2 text-secondary" href="#"> <i class="fa fa-user m-1" aria-hidden="true"></i> Profile
</a>
<hr class="my-1"></hr>
<a class="dropdown-item p-2 text-secondary" href="#"> <i class="fa fa-trash m-1" aria-hidden="true"></i> Delete </a>
</div>
</div>
</div>
<div class="card bg-sohbet border-0 m-0 p-0" style="height: 100vh;">
<div id="sohbet" class="card border-0 m-0 p-0 position-relative bg-transparent" style="overflow-y: auto; height: 100vh;">
<div class="balon1 p-2 m-0 position-relative" data-is="You - 3:20 pm">
<a class="float-right"> Hey there! What's up? </a>
</div>
<div class="balon2 p-2 m-0 position-relative" data-is="Yusuf - 3:22 pm">
<a class="float-left sohbet2"> Checking out this awesome chat design.. </a>
</div>
<div class="balon1 p-2 m-0 position-relative" data-is="You - 3:23 pm">
<a class="float-right"> Christ, you know who made that? </a>
</div>
<div class="balon2 p-2 m-0 position-relative" data-is="Yusuf - 3:26 pm">
<a class="float-left sohbet2"> Well I can think of only one person capable of this... </a>
</div>
<div class="balon1 p-2 m-0 position-relative" data-is="You - 3:28 pm">
<a class="float-right"> Oh no it can't </a>
</div>
<div class="balon2 p-2 m-0 position-relative" data-is="Yusuf - 3:33 pm">
<a class="float-left sohbet2"> Yes, him. </a>
</div>
</div>
</div>
<div class="w-100 card-footer p-0 bg-light border border-bottom-0 border-left-0 border-right-0">
<form class="m-0 p-0" autocomplete="off">
<div class="row m-0 p-0">
<div class="col-9 m-0 p-1">
<input id="text" class="mw-100 border rounded form-control" type="text" name="text" title="Type a message..." placeholder="Type a message..." required>
</div>
<div class="col-3 m-0 p-1">
<button type="button" id="send" class="btn btn-outline-secondary rounded border w-100" title="Gönder!" style="padding-right: 16px;"><i class="fa fa-paper-plane"
aria-hidden="true"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sockjs-client#1/dist/sockjs.min.js"></script>
It's because your div containing the #sohbet element has a height of 100vh set and its parent div has overflow:hidden set. Therefore, the form gets pushed out of the divs bounds and is invisble to the user.
Chrome renders your layout correctly, apparently the other browsers seem to be wrong here.
Fix the problem by decreasing the height. You can e.g. calculate the height, if your header and form have a fixed height by using calc
<div style="height: calc(100vh - <HeightOfHeaderAndForm>);"
You can also use flexbox to fill the available space. I recommend you check out this excellent guide: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Please add this CSS in your code
.card-footer {
position: fixed;
bottom: 0;
}
Related
The collapsed navbar is being hidden by the content in the section element - for example, when testing as a small device display (iphone se, etc), the section content blocks the navbar and when I click on the collapsed navbar toggle to get the routes, nothing happens. How come it's not pushing that content down to expand?
Am I wrapping the navbar and section wrong?
Using react, bootstrap v5.3.0-alpha1
export default function Navbar() {
return (
<nav className="navbar navbar-expand-sm">
<div className="container-fluid">
<Link to='/' className="navbar-brand d-none d-md-block">
<img src={"./logo.png"} style={{ height: '50px', width: '50px', borderRadius: '5px'}} alt='' />
</Link>
<button className="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span className="navbar-toggler-icon"></span>
</button>
<div className="collapse navbar-collapse text-center justify-content-start" id="navbarTogglerDemo01">
<div className="navbar-nav">
<a className="nav-link" href="/#">about_1</a>
<a className="nav-link" href="/#">about_2</a>
</div>
</div>
<div className="btn-toolbar" role="toolbar">
<div className="btn-group me-2" role="group">
<button type="button" className="btn btn-primary" onClick={signIn} id="sign_in_button">{user === null ? 'Sign In' : user}</button>
</div>
<div className="btn-group me-2" role="group">
<div className="dropdown">
<button className="btn" id="settings" type="button" data-bs-toggle="dropdown" aria-expanded="false" data-bs-auto-close="outside" style={{ height: '40px'}}>
<i className="bi bi-three-dots"></i>
</button>
<ul className="dropdown-menu dropdown-menu-end" style={{ width: '20vw'}} id="settings_menu">
<div className="container-fluid">
<div className="row">
<div className="col">
<li><h6 className="dropdown-header">Navigation</h6></li>
<li><Link to='/burn' className="dropdown-item">test</Link></li>
<li><a className="dropdown-item" href="https://xxx">test</a></li>
</div>
<div className="col">
<li><h6 className="dropdown-header">Other</h6></li>
<li><a className="dropdown-item" href="https://opensea.io/collection/test">test</a></li>
<li><a className="dropdown-item" href="https://opensea.io/collection/test">test</a></li>
</div>
</div>
<div className="row">
<li><hr className="dropdown-divider" /></li>
<li>
<a className="dropdown-item d-flex justify-content-between align-items-center" href="/#" onClick={() => theme === 'light' ? setTheme('dark') : setTheme('light')}>
Dark Theme
<i className="bi bi-moon"></i>
</a>
</li>
<br />
<br />
<div className="col" style={{ display: 'inline-flex'}}>
<li><a className="dropdown-item" href="https://twitter.com/test"><i className="bi bi-twitter"></i></a></li>
<li><a className="dropdown-item" href="https://t.me/test"><i className="bi bi-telegram"></i></a></li>
</div>
</div>
</div>
</ul>
</div>
</div>
</div>
</div>
</nav>
);
}
import Navbar from '../components/navbar.js';
export function Index() {
return (
<>
<Navbar></Navbar>
<section className="">
<div className="container col-xxl-8 px-4 py-5 position-absolute top-50 start-50 translate-middle">
<div className="row flex-lg-row-reverse align-items-center g-5 py-5">
<div className="col-10 col-sm-8 col-lg-6">
<img src={"./test.jpg"} className="d-none d-sm-block mx-lg-auto img-fluid" alt="Bootstrap Themes" width="500" height="250" loading="lazy" />
</div>
<div className="col-lg-6 text-start">
<h1 className="display-5 fw-bold lh-1 mb-3" style={{ fontSize: '72px'}}>TEST HEADER</h1>
<p className="lead">
Quickly design and customize responsive mobile-first
sites with Bootstrap, the world's most popular front-end open
source toolkit, featuring Sass variables and mixins, responsive grid system,
extensive prebuilt components, and powerful JavaScript plugins.
A powerful enterprise-grade infrastructure
</p>
<div className="d-grid gap-2 d-md-flex justify-content-md-start">
<button type="button" className="btn btn-primary btn-lg px-4 me-md-2">Try For Free</button>
{/* <button type="button" className="btn btn-outline-secondary btn-lg px-4">Default</button> */}
</div>
</div>
</div>
</div>
</section>
</>
);
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
#media only screen and (max-width: 576px) {
.navbar .btn-toolbar {
position: absolute;
top: 8px;
right: 12px;
}
}
#settings {
border-radius: 5px;
}
#settings:hover {
/* background: #e1e1e1; */
background: var(--bs-tertiary-bg);
border-radius: 5px;
}
/* html[data-bs-theme="dark"] #settings:hover {
background: var(--bs-tertiary-bg);
border-radius: 5px;
} */
.navbar a.nav-link {
margin: 0px 8px;
border-radius: 5px;
}
.navbar a.nav-link:hover {
/* background: #e1e1e1; */
background: var(--bs-tertiary-bg);
border-radius: 5px;
}
/* html[data-bs-theme="dark"] .navbar a.nav-link:hover {
background: var(--bs-tertiary-bg);
border-radius: 5px;
} */
#settings {
color: var(--bs-navbar-color);
}
#sign_in_button {
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
/* outline: webkit-focus-ring-color auto 1px; */
outline: none;
border: none;
}
#sign_in_button:hover {
transform: scale(1.05);
/* background: none; */
outline: none;
border: none;
}
I am using Scss for styling the page and need to set scroll for specific parts of a HTML page.
when a user doing a scroll I need to keep the Categories(left) & Cart (Right) area to be strick in their position. But the center part needs to be scroll till the filtered items are reaching the top (bottom of the breadcrumb). If the user scroll further the filtered items will scroll underneath the filter and search bar section.
Can Anyone help me to fix it.
HTML :
<div class="container-fluid px-5">
<div class="row pt-4 pr-0">
<div class="col-sm-12 px-4 pt-2">
<app-gropcard-breadcrumb></app-gropcard-breadcrumb>
</div>
<div class="col-sm-12">
<div class="row">
<div class="col-sm-3">
<mat-card class="col-sm-12 p-0 mat-elevation-z10" style="background-color: #0084FF;color: white;">
<mat-card-header class="d-flex justify-content-center p-2">
<mat-card-title class="mb-0">Categories</mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" class="tree mt-3 pl-3 ">
<!-- This is the tree node template for leaf nodes -->
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle>
<li class="mat-tree-node">
<!-- use a disabled button to provide padding for tree leaf -->
<button class="TreeButton" mat-icon-button disabled></button>
<span (click)="Category(node)">{{node.name}}</span>
</li>
</mat-tree-node>
<!-- This is the tree node template for expandable nodes -->
<mat-nested-tree-node *matTreeNodeDef="let node; when: hasChild">
<li>
<div class="mat-tree-node" [attr.aria-label]="'toggle ' + node.name">
<button class="TreeButton" mat-icon-button matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<span matTreeNodeToggle (click)="Category(node)">{{node.name}}</span>
</div>
<ul class="pl-2" [class.tree-invisible]="!treeControl.isExpanded(node)">
<ng-container matTreeNodeOutlet></ng-container>
</ul>
</li>
</mat-nested-tree-node>
</mat-tree>
</mat-card-content>
</mat-card>
</div>
<div class="col-sm-6 containerbackground">
<div class="col-sm-12 p-0 d-flex justify-content-center">
<img class="w-100 banner"
[src]="mListedPartyBanner">
</div>
<div class="col-sm-12">
<div class="row">
<div class="col-sm-3">
<div class="row">
<h5 class="mt-4 mb-2">Filtered Items</h5>
</div>
</div>
<div class="col-sm-5 search pt-4" fxShow="true" fxHide.gt-sm="false">
<form class="search" >
<mat-form-field class="w-100" appearance="outline">
<input type="text" #myInput matInput placeholder="Search" maxlength="50" (input)="Search(myInput.value)" autocomplete='null' [formControl]="myControl">
<button matTooltip="Search" matSuffix mat-icon-button>
<mat-icon>
search
</mat-icon>
</button>
</mat-form-field>
</form>
</div>
<div class="col-sm-4 d-flex justify-content-end">
<div class="View mt-4 mb-2 mr-4">
<div class="row">
<button matTooltip="Filter"[matMenuTriggerFor]="menu" mat-icon-button>
<mat-icon>filter_list</mat-icon>
</button>
<mat-menu #menu="matMenu">
<button (click)="sortBy(data?.id)" mat-menu-item *ngFor="let data of sortList" [value]="data?.id">
<span>{{data?.value}}</span>
</button>
</mat-menu>
<button [ngClass]="{'ActiveButton': displayMode === 1}" (click)="onDisplayModeChange(1)"
matTooltip="List view" mat-icon-button>
<mat-icon>view_headline</mat-icon>
</button>
<button [ngClass]="{'ActiveButton': displayMode === 2}" (click)="onDisplayModeChange(2)"
matTooltip="Grid view" mat-icon-button>
<mat-icon>view_module</mat-icon>
</button>
</div>
</div>
</div>
</div>
</div>
<hr>
<div class="col-sm-12" *ngIf='displayMode==1'>
<div class="row d-flex justify-content-center">
<div class="col-sm-6 p-2 " *ngFor="let prod of ListedPartyItems; let ind = index">
<mat-card class="py-1" matRipple>
<div class="corner-ribbon top-right sticky blue shadow" *ngIf='prod?.PROMO_PRICE'>
{{((prod?.PRODUCT_PRICE-prod?.PROMO_PRICE)/prod?.PRODUCT_PRICE)*100 | number: '1.0-0'}}% Off</div>
<div class="row">
<div class="ImageDiv">
<img class="w-100 Img p-1" [src]="prod['IMAGE_PATH_1']">
</div>
<div class="row NameDiv d-flex ProductData justify-content-center">
<div class="Name mt-2">
<span>{{prod?.ITEM_DESCRIPTION}}</span>
</div>
<div class="Price mt-2">
<span class="ProductPrice">{{prod?.PROMO_PRICE ? (prod?.PROMO_PRICE | number:'.1-2') :
(prod?.PRODUCT_PRICE | number:'.1-2')}}<span class="pl-1"
[innerHtml]="mCurrencyCode"></span></span>
<span class="PromotionPrice mt-1 pl-1" *ngIf='prod?.PROMO_PRICE'>{{prod?.PRODUCT_PRICE |
number:'.1-2'}}<span class="pl-1" [innerHtml]="mCurrencyCode"></span></span>
</div>
<div class="col-sm-12">
<div class="row">
<div class="d-flex justify-content-center mt-2 w-100">
<button type="button" (click)="Decrement( ind)" class="btnStyles">–</button>
<input type="text" readonly class="quantityBox" [(ngModel)]="prod.qty">
<button type="button" (click)="Increment(ind)" class="btnStyles">+</button>
</div>
<div class="col-sm-12 mt-2 d-flex justify-content-center">
<div class="row">
<div class="col-sm-6">
<button (click)="AddToCart(prod?.PRODUCT_CODE,prod?.UOM,prod?.qty, ind)"
class="col-sm-12 ProductButton " mat-raised-button>
<mat-icon class="iconSize Cursor">shopping_cart</mat-icon>
</button>
</div>
<div class="col-sm-6">
<button (click)="SelectedProduct(prod?.PRODUCT_CODE)" class="col-sm-12 ProductButton"
mat-raised-button>More</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</mat-card>
</div>
</div>
</div>
<div class="col-sm-12" *ngIf='displayMode==2'>
<div class="row">
<div *ngIf="IsItemFound" style="display:block;margin:auto;">
<img src="../../../../assets/oops.png" alt="">
</div>
<div class="col-sm-4 p-2" *ngFor="let prod of ListedPartyItems; let ind = index">
<mat-card matRipple class="p-0 ">
<div class="corner-ribbon top-right sticky blue shadow" *ngIf='prod?.PROMO_PRICE'>
{{((prod?.PRODUCT_PRICE-prod?.PROMO_PRICE)/prod?.PRODUCT_PRICE)*100 | number: '1.0-0'}}% Off</div>
<img class="d-block w-100 Img p-1" [src]="prod['IMAGE_PATH_1']">
<div class="w-100 d-flex ProductData justify-content-center">{{prod?.ITEM_DESCRIPTION}}</div>
<div class="col-sm-12 mt-2 d-flex justify-content-center">
<span class="ProductPrice">{{prod?.PROMO_PRICE ? (prod?.PROMO_PRICE | number:'.1-2') :
(prod?.PRODUCT_PRICE | number:'.1-2')}}<span class="pl-1"
[innerHtml]="mCurrencyCode"></span></span>
<span class="PromotionPrice mt-1 pl-1" *ngIf='prod?.PROMO_PRICE'>{{prod?.PRODUCT_PRICE |
number:'.1-2'}}<span class="pl-1" [innerHtml]="mCurrencyCode"></span></span>
</div>
<div class="d-flex justify-content-center mt-2">
<button type="button" (click)="Decrement( ind)" class="btnStyles">–</button>
<input type="text" readonly class="quantityBox" [(ngModel)]="prod.qty">
<button type="button" (click)="Increment(ind)" class="btnStyles">+</button>
</div>
<div class="w-100 mt-2">
<div class="row">
<div class="w-50 ">
<button (click)="AddToCart(prod?.PRODUCT_CODE,prod?.UOM,prod?.qty, ind)"
class="col-sm-12 ProductButton p-0" mat-raised-button>Add To Cart</button>
</div>
<div class="w-50">
<button (click)="SelectedProduct(prod?.PRODUCT_CODE)" class="col-sm-12 ProductButton p-0"
mat-raised-button>More</button>
</div>
</div>
</div>
</mat-card>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<mat-card class="col-sm-12 p-0 mat-elevation-z10 YourCartheight">
<mat-card-header class="d-flex justify-content-center p-2" style="background-color: #0084FF;color: white;">
<mat-card-title class="mb-0">Your Cart</mat-card-title>
</mat-card-header>
<mat-card-content>
<div class="col-sm-12" *ngIf="!IsMyCartHasItems">
<div class="row">
<div class="col-sm-12 d-flex justify-content-center mt-4">
<img class="d-block w-100 emptycart p-1" src="../../../../../assets/cart.png" alt="No Data">
</div>
<div class="col-sm-12 pb-4 d-flex justify-content-center">
<span>There are no items in your cart.</span>
</div>
</div>
</div>
<div class="col-sm-12 p-2" *ngIf="IsMyCartHasItems">
<div class="row" *ngFor="let prod of MyCart; let i = index">
<div class="col-sm-4 p-2">
<div class="col-sm-12 p-2">
<span style="font-size: 12px;">{{prod.ITEM_DESC}}</span>
</div>
</div>
<div class="col-sm-4 p-0 d-flex justify-content-center">
<div class="col-sm-12 p-2 mt-2">
<button type="button" (click)="Decrementsub(prod?.ITEM_CODE,prod?.ITEM_PACK_SIZE,prod?.TOTAL_QTY,i)" class="cartBtn">–</button>
<input type="text" readonly class="quantityBox1" [value]="prod.TOTAL_QTY">
<button type="button" (click)="Incrementsub(prod?.ITEM_CODE,prod?.ITEM_PACK_SIZE,prod?.TOTAL_QTY,i)" class="cartBtn">+</button>
</div>
</div>
<div class="col-sm-2 p-0 d-flex justify-content-center">
<div class="col-sm-12 p-2 mt-2">
<span>{{prod?.TOTAL_AMT | number}} <span class="pl-1 Price"
[innerHtml]="mCurrencyCode"></span></span>
</div>
</div>
<div class="col-sm-2 p-0 d-flex justify-content-center">
<div class="col-sm-12 p-1">
<button matTooltip="Remove"
(click)="RemoveCartProduct(prod?.ITEM_CODE,prod?.ITEM_PACK_SIZE)" mat-icon-button
color="warn">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</div>
<div class="col-sm-12 p-0 d-flex justify-content-center">
<button (click)='GoToCheckout()' class="col-sm-12 p-0 checkout" color="warn" mat-raised-button>CHECK
OUT <strong *ngIf='mCartCount > 0' class="pl-4" style="font-size: 20px;">{{TotalAmount | number}}<span class="pl-1 Price"
[innerHtml]="mCurrencyCode"></span></strong></button>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
</div>
</div>
</div>
SCSS:
.Img{
height: 200px;
#include desktop{
height: 250px;
}
}
.Caption{
font-size: 1em;
font-weight: bold;
#include desktop{
font-size: 1.5em;
}
}
.ProductButton{
background-color: color(messengerBlue);
color: color(basic);
font-weight: bold;
font-size: 1em;
border-radius: 0;
margin-left: 10px;
}
.ProductData{
font-weight: lighter;
font-size: 12px !important;
white-space: normal;
word-wrap: break-word;
color: color(gray);
}
.containerbackground{
background-color:#f1f3f6;
}
.ActiveButton{
background-color: color(primary);
color: color(basic);
}
// Change text colour when inputting text
.search {
//-----Input Field Size----------
::ng-deep .mat-form-field-flex > .mat-form-field-infix {
padding: 0.4em 0px !important;
// padding-bottom: 8px !important;
}
::ng-deep .mat-form-field-label-wrapper {
top: -1.5em;
}
::ng-deep
.mat-form-field-appearance-outline.mat-form-field-can-float.mat-form-field-should-float
.mat-form-field-label {
transform: translateY(-1.1em) scale(0.75);
width: 133.33333%;
}
::ng-deep .mat-form-field {
background-color: white;
::ng-deep .mat-form-field-wrapper {
padding-bottom: 0;
}
::ng-deep .mat-form-field-wrapper {
margin: 0 0;
}
::ng-deep .mat-form-field-outline-start,
.mat-form-field-outline-end {
border-radius: 0 !important;
}
// ::ng-deep .mat-form-field-underline {
// height: 0px;
// }
// ::ng-deep .mat-form-field-infix {
// padding-top: 0px;
// position: relative;
// }
.mat-form-field-underline {
background-color: transparent;
}
.mat-form-field-ripple {
background-color: transparent;
}
}
}
.tree-invisible {
display: none;
}
.tree ul,
.tree li {
margin-top: 0;
margin-bottom: 0;
list-style-type: none;
cursor: pointer;
}
.mat-tree-node {
min-height: 0px;
max-height: 30px;
.TreeButton{
outline: none;
}
}
.Title{
font-size: 1.5em;
font-weight: bold;
}
.banner{
height: 250px;
}
.ImageDiv{
width: 40%;
}
.Img{
height: 130px;
#include desktop{
height: 150px;
}
}
.NameDiv{
width: 60%;
.Name{
width: 100%;
text-align: center;
font-weight: lighter;
font-size: 12px !important;
white-space: normal;
word-wrap: break-word;
color: color(gray);
}
.Price{
width: 100%;
font-weight: bold;
font-size: 1.5em;
color: color(primary);
text-align: center;
}
}
.imgButton{
background-color: color(messengerBlue);
color: color(basic);
font-weight: bold;
font-size: 1em;
border-radius: 0;
}
.btnStyles{
width: 28px;
height: 28px;
background: linear-gradient(#fff, #f9f9f9);
display: inline-block;
border: 1px solid #c2c2c2;
cursor: pointer;
font-size: 16px;
border-radius: 50%;
padding-top: 1px;
line-height: 1;
}
.cartBtn{
width: 20px;
height: 20px;
background: linear-gradient(#fff, #f9f9f9);
display: inline-block;
border: 1px solid #c2c2c2;
cursor: pointer;
font-size: 12px;
border-radius: 50%;
padding-top: 1px;
line-height: 1;
}
.quantityBox{
display: inline-block;
padding: 3px 6px;
width: calc(100% - 60px);
height: 100%;
width: 46px;
height: 28px;
border-radius: 2px;
background-color: #fff;
border: 1px solid #c2c2c2;
margin: 0 9px;
font-weight: bold;
text-align: center
}
.quantityBox1{
display: inline-block;
padding: 3px 6px;
width: calc(100% - 60px);
height: 100%;
width: 25px;
height: 20px;
border-radius: 2px;
background-color: #fff;
border: 1px solid #c2c2c2;
margin: 0 9px;
font-weight: bold;
text-align: center
}
.iconSize {
font-size: 30px;
}
.cursor {
cursor: pointer;
}
.ItemPromotionPrice {
display: inline-block;
text-decoration: line-through;
opacity: .5;
font-size: 20px !important;
color: color(gray);
}
.ProductPrice{
font-weight: bold;
font-size: 1em;
color: color(primary);
}
::ng-deep .mat-form-field {
font-size: 12px; // example
}
.emptycart{
height: 100px !important;
width: 100px !important;
}
.YourCartheight{
min-height: 150px!important;
max-height:500px !important;
}
I have a suggestion to use html:not
It should be looked like this:
html:not([data-scroll='0']) /*class name for category section*/ {
position: fixed;
top: 0;
}
In order to make the middle container's content scroll, it must first overflow. That can be achieved by applying either a fixed or max height. Then you need to specify the overflow behaviour:
.containerbackground {
background-color:#f1f3f6;
max-height: 100vh;
overflow-y: auto;
}
I want to try to make a div page with an icon around the text and button but it won't make an icon beside the text just like this(It also affects the button). I already tried using Flex documentation d-flex justify-content-around in div class but it doesn't work. I'm using Bootstrap 4. Here's the result :
The Result:
The Result I wanted:
Here's the coding :
Home.html
div.page {
padding: 10px 20px;
background: #FDFDFD;
width: 280px;
height: 180px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 32px;
}
p.page {
color: #252525;
margin-left: 20px;
font-size: 30px;
font-weight: bold;
font-family: 'Roboto',sans-serif;
}
button.show {
border-radius: 32px;
font-weight:bold;
margin-right: 80px;
margin-top: 30px;
border: 3px solid #3379E4;
text-align:center;
padding: 5px;
background: #3379E4;
width: 50%;
color: #FDFDFD;
font-family:'Roboto', sans-serif;
}
i.page {
font-size: 36px;
color: #3379E4;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" crossorigin="anonymous" />
<div class="container mt-5">
<div class="row">
<div class="col text-center">
<div class="d-flex">
<div class="page mr-auto p-2">
<i class="page fas fa-calculator text-right"></i>
<p class="page text-left">AK</p>
<button class="show">Show</button>
</div>
<div class="page p-2">
<i class="page fas fa-laptop text-right"></i>
<p class="page text-left">TKJ</p>
<button class="show">Show</button>
</div>
</div>
<img src="https://cdn.pixabay.com/photo/2016/09/18/14/21/swimmer-1678307__340.jpg" class="img-fluid" width="500">
<div class="d-flex">
<div class="page mr-auto p-2">
<i class="page fas fa-store text-right"></i>
<p class="page text-left">PM</p>
<button class="show">Show</button>
</div>
</div>
</div>
</div>
</div>
Thank you for helping.
I add custom css that you could see by the bottom of the css:
/**** CSS ADDED ****/
.img-fluid {
margin: -10vh auto;
}
.z-index-1{
z-index:1;
}
I recommand to not use class: .img-fluid as I did but to create another class with this negative margin. Here it is really just for the demo
Then I added classes in follow:
<div class="col text-center">
<div class="d-flex">
To make it like:
<div class="col text-center d-flex flex-column">
<div class="d-flex z-index-1">
Edit:
Rework structure of your card this way by dividing in 2 cols and some correction in CSS for icon font-size :
<div class="page p-2 row">
<div class="col-8">
<p class="page text-left">TKJ</p>
<button class="show">Show</button>
</div>
<div class="col-4 d-flex">
<i class="page fas fa-laptop m-auto"></i>
</div>
</div>
DEMO:
div.page {
padding: 10px 20px;
background: #FDFDFD;
width: 280px;
height: 180px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 32px;
}
p.page {
color: #252525;
margin-left: 20px;
font-size: 30px;
font-weight: bold;
font-family: 'Roboto',sans-serif;
}
button.show {
border-radius: 32px;
font-weight:bold;
margin-right: 80px;
margin-top: 30px;
border: 3px solid #3379E4;
text-align:center;
padding: 5px;
background: #3379E4;
width: 100%; /* CAHNGED FROM 50% TO 100% */
color: #FDFDFD;
font-family:'Roboto', sans-serif;
}
i.page {
font-size: 4em; /* Changed from 36px to 4em */
color: #3379E4;
}
/**** CSS ADDED ****/
.img-fluid {
margin: -10vh auto;
}
.z-index-1{
z-index:1;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" crossorigin="anonymous" />
<div class="container mt-5">
<div class="row">
<div class="col text-center d-flex flex-column">
<div class="d-flex z-index-1">
<div class="page mr-auto p-2 row">
<div class="col-8">
<p class="page text-left">AK</p>
<button class="show">Show</button>
</div>
<div class="col-4 d-flex">
<i class="page fas fa-calculator m-auto"></i>
</div>
</div>
<div class="page p-2 row">
<div class="col-8">
<p class="page text-left">TKJ</p>
<button class="show">Show</button>
</div>
<div class="col-4 d-flex">
<i class="page fas fa-laptop m-auto"></i>
</div>
</div>
</div>
<img src="https://cdn.pixabay.com/photo/2016/09/18/14/21/swimmer-1678307__340.jpg" class="img-fluid" width="500">
<div class="d-flex z-index-1">
<div class="page mr-auto p-2 row">
<div class="col-8">
<p class="page text-left">PM</p>
<button class="show">Show</button>
</div>
<div class="col-4 d-flex">
<i class="page fas fa-store m-auto"></i>
</div>
</div>
</div>
</div>
</div>
</div>
I'm making a mini sidebar when users decreases their browser's width. I'm getting stuck when I work with height css property. I allow users to scroll the sidebar.
But I don't know how to increase the sidebar's width automatically when the vertically scrollbar appears.
/* START - bootstrap */
.list-unstyled {
padding-left: 0;
list-style: none;
}
.m-auto {
margin: auto;
}
.text-light {
color: rgb(248, 249, 250);
}
.text-center {
text-align: center;
}
.p-3 {
padding: 1rem!important;
}
/* END - bootstrap */
.sidebar-medium {
overflow-x: hidden;
overflow-y: auto;
display: block;
top: 0;
bottom: 0;
width: 60px;
position: fixed;
background-image: linear-gradient(to right, #ff758c 0%, #ff7eb3 100%);
}
li {
cursor: pointer;
user-select: none;
font-size: 20px;
}
li:hover {
background: rgba(255, 255, 255, 0.4);
}
.avatar {
width: 30px;
height: 30px;
background-size: 30px 30px;
clip-path: polygon(50% 0%, 90% 20%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 10% 20%);
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" />
<div class="shadow-sm text-light sidebar-medium">
<ul class="list-unstyled mb-0">
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto avatar" style="background-image: url('https://i.stack.imgur.com/5Jv5C.jpg?s=328&g=1');"></div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-user-tie"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-radiation"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-history"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-envelope"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-bell"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-bookmark"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-exclamation-triangle"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-exclamation-circle"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-cogs"></i>
</div>
</li>
</ul>
</div>
Screenshot (With and without the scrollbar):
How can I increase the sidebar's width automatically in this case (without javascript)?
One possible solution is to query the height.
#media (max-height: 570px) { /* this is when the scrollbar appears */
.sidebar-medium {
width: 100px;
}
}
.list-unstyled {
padding-left: 0;
list-style: none;
}
.m-auto {
margin: auto;
}
.text-light {
color: rgb(248, 249, 250);
}
.text-center {
text-align: center;
}
.p-3 {
padding: 1rem !important;
}
/* END - bootstrap */
.sidebar-medium {
overflow-x: hidden;
overflow-y: auto;
display: block;
top: 0;
bottom: 0;
width: 60px;
position: fixed;
background-image: linear-gradient(to right, #ff758c 0%, #ff7eb3 100%);
transition: width 0.3s;
}
li {
cursor: pointer;
user-select: none;
font-size: 20px;
}
li:hover {
background: rgba(255, 255, 255, 0.4);
}
.avatar {
width: 30px;
height: 30px;
background-size: 30px 30px;
clip-path: polygon( 50% 0%, 90% 20%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 10% 20%);
}
#media (max-height: 570px) {
.sidebar-medium {
width: 100px;
}
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" />
<div class="shadow-sm text-light sidebar-medium">
<ul class="list-unstyled mb-0">
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto avatar" style="
background-image: url('https://i.stack.imgur.com/5Jv5C.jpg?s=328&g=1');
"></div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-user-tie"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-radiation"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-history"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-envelope"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-bell"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-bookmark"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-exclamation-triangle"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-exclamation-circle"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-cogs"></i>
</div>
</li>
</ul>
</div>
You can always use the ::-webkit-scrollbar in order to have a better visual :
/* START - bootstrap */
.list-unstyled {
padding-left: 0;
list-style: none;
}
.m-auto {
margin: auto;
}
.text-light {
color: rgb(248, 249, 250);
}
.text-center {
text-align: center;
}
.p-3 {
padding: 1rem !important;
}
/* END - bootstrap */
.sidebar-medium {
overflow-x: hidden;
overflow-y: auto;
display: block;
top: 0;
bottom: 0;
width: 60px;
position: fixed;
background-image: linear-gradient(to right, #ff758c 0%, #ff7eb3 100%);
}
li {
cursor: pointer;
user-select: none;
font-size: 20px;
}
li:hover {
background: rgba(255, 255, 255, 0.4);
}
.avatar {
width: 30px;
height: 30px;
background-size: 30px 30px;
clip-path: polygon(50% 0%, 90% 20%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 10% 20%);
}
::-webkit-scrollbar {
width: 2px;
}
::-webkit-scrollbar-thumb {
background-color: gray;
border-radius: 5px;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" />
<div class="shadow-sm text-light sidebar-medium">
<ul class="list-unstyled mb-0">
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto avatar" style="background-image: url('https://i.stack.imgur.com/5Jv5C.jpg?s=328&g=1');"></div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-user-tie"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-radiation"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-history"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-envelope"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-bell"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-bookmark"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-exclamation-triangle"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-exclamation-circle"></i>
</div>
</li>
<li class="text-center p-3">
<div class="align-self-center d-inline-block m-auto text-center">
<i class="fas fa-cogs"></i>
</div>
</li>
</ul>
</div>
For some reason, my dropdown in my FORM is not working; nothing happens when it is clicked. I also find it strange because I copied this code from somewhere else, and it isn't working. I have checked for typos multiple times but came up with nothing.
<!DOCTYPE html>
<html>
<head>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<title>My Awesome Login Page</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous">
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
background: #60a3bc !important;
}
.user_card {
height: 430px;
width: 350px;
margin-top: auto;
margin-bottom: auto;
background: #f39c12;
position: relative;
display: flex;
justify-content: center;
flex-direction: column;
padding: 1px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
-webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
-moz-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 5px;
}
.brand_logo_container {
position: absolute;
height: 170px;
width: 170px;
top: -75px;
border-radius: 50%;
background: #60a3bc;
padding: 10px;
text-align: center;
}
.brand_logo {
height: 150px;
width: 150px;
border-radius: 50%;
border: 2px solid white;
}
.form_container {
margin-top: 5px;
}
.login_btn {
width: 100%;
background: #c0392b !important;
color: white !important;
}
.login_btn:focus {
box-shadow: none !important;
outline: 0px !important;
}
.login_container {
padding: 0 2rem;
}
.input-group-text {
background: #c0392b !important;
color: white !important;
border: 0 !important;
border-radius: 0.25rem 0 0 0.25rem !important;
}
.input_user,
.input_pass:focus {
box-shadow: none !important;
outline: 0px !important;
}
.custom-checkbox .custom-control-input:checked~.custom-control-label::before {
background-color: #c0392b !important;
}
</style>
</head>
<!--Coded with love by Mutiullah Samim-->
<body>
<div class="container h-100">
<div class="d-flex justify-content-center h-100">
<div class="user_card">
<div class="d-flex justify-content-center form_container">
<form>
<div class="input-group mb-3">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-user"></i></span>
</div>
<input type="text" name="" class="form-control input_user" value="" placeholder="username">
</div>
<div class="input-group mb-3">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-envelope"></i></span>
</div>
<input type="email" name="" class="form-control input_user" value="" placeholder="email.">
</div>
<div class="input-group mb-2">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-key"></i></span>
</div>
<input type="password" name="" class="form-control input_pass" value="" placeholder="password">
</div>
<div class="input-group mb-2">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-flag"></i></span>
</div>
<div class="dropdown show">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Country.
</button>
***
/*HERE IS THE PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEMPROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM PROBLEM*/
------------------------------------------------------------------------
***
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
</div>
<div class="input-group mb-2">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-genderless"></i></span>
</div>
<div class="dropdown show">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Gender
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Male</a>
<a class="dropdown-item" href="#">Female</a>
</div>
</div>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customControlInline">
<label class="custom-control-label" for="customControlInline">Remember me</label>
</div>
</div>
<div class="d-flex justify-content-center mt-3 login_container">
<button type="button" name="button" class="btn login_btn">Sign Up</button>
</div>
</form>
</div>
<div class="mt-4">
<div class="d-flex justify-content-center links">
Already have an account? Login.
</div>
<div class="d-flex justify-content-center links">
Forgot your password?
</div>
</div>
</div>
</div>
</div>
</body>
</html>
According to the Bootstrap introduction, you will need to include the the popper.js script for some bootstrap feature like dropdown, tooltip, etc. to work.
Here is the script you need to include:
<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>
On a side note, you seem to have imported the jQuery script twice, please consider removing one of them.