Notification bar with countdown timer - html

I am trying to build a responsive notification bar with bootstrap, however my media query are not behaving properly,
I have some text with tag which I want to decrease size on smaller screen but only my timer text is changing size. also I want to add some margin between my text and button on smaller screen, but its not working.
Please look at my code and suggest some changes :|
$(function() {
var endDate = new Date();
endDate = new Date(2016, 12 - 1, 31);
$('#dcountdown').countdown({
until: endDate
});
$('#dclose').click(function() {
$(this).parent().slideUp();
});
});
#import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic);
#media only screen and (max-width: 700px){.dcontent strong{font-size: 50%;}.countdown-section{font-size: 80%;padding-bottom: 10%;} .mybutton{padding: 2px;}}
#dbanner {
position: top;
bottom: 0px;
height: auto;
width: 100%;
padding: 10px 0 10px 0;
color: #fff;
text-align: center;
font-family: "Open Sans";
text-shadow: 1px 2px 2px rgba(0, 0, 0, 0.8);
}
.dcontent {
padding: 0px 30px 0px 30px;
font-size: 16px;
}
.dcontent strong {
font-size: 20px;
color: #fff;
white-space: nowrap;
margin-right: 30%;
text-align: center;
}
#dclose {
position: absolute;
font-size: 8px;
height: 20px;
line-height: 10px;
top: 5px;
right: 10px;
color: #fff;
}
#dclose:hover {
cursor: pointer;
}
.change-color {
background-color: #000000;
color: #FFF;
text-align: center;
}
.mybutton{
padding: 5px;
background: #006622;
background-size: 100%;
border-radius: 0px;
color: #fff;
}
.countdown-section {
padding: 0 5px 0 5px;
text-align: center;
}
.countdown-amount {
padding: 0 5px 0 0;
}
.countdown-period {
text-transform: none;
}
.countdown-descr {
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script>
<div id="dbanner" class="change-color">
<div class="dcontent">
<strong>Some Text Here Some Text Here Some </strong> <span id="dcountdown"></span> Apply Now
</div>
<div id="dclose">close me!</div>
</div>
<script src="https://lizatom.com/wp-content/themes/lizatom2015/banner/jquery.countdown.min.js"></script>
<script src="https://lizatom.com/wp-content/themes/lizatom2015/banner/jquery.plugin.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
Thank you
Mobile View
The previous issue has been fixed now, but on mobile view there is some white space on the right side, how do I fix that
Mobile View new

Move whole statement #media only screen and (max-width: 700px) {... ...} down of your rules. Then it should work right.
$(function() {
var endDate = new Date();
endDate = new Date(2016, 12 - 1, 31);
$('#dcountdown').countdown({
until: endDate
});
$('#dclose').click(function() {
$(this).parent().slideUp();
});
});
#import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic);
#dbanner {
position: top;
bottom: 0px;
height: auto;
width: 100%;
padding: 10px 0 10px 0;
color: #fff;
text-align: center;
font-family: "Open Sans";
text-shadow: 1px 2px 2px rgba(0, 0, 0, 0.8);
}
.dcontent {
padding: 0px 30px 0px 30px;
font-size: 16px;
}
.dcontent strong {
font-size: 20px;
color: #fff;
white-space: nowrap;
margin-right: 30%;
text-align: center;
}
#dclose {
position: absolute;
font-size: 8px;
height: 20px;
line-height: 10px;
top: 5px;
right: 10px;
color: #fff;
}
#dclose:hover {
cursor: pointer;
}
.change-color {
background-color: #000000;
color: #FFF;
text-align: center;
}
.mybutton{
padding: 5px;
background: #006622;
background-size: 100%;
border-radius: 0px;
color: #fff;
}
.countdown-section {
padding: 0 5px 0 5px;
text-align: center;
}
.countdown-amount {
padding: 0 5px 0 0;
}
.countdown-period {
text-transform: none;
}
.countdown-descr {
}
#media only screen and (max-width: 700px){
.dcontent strong {
font-size: 50%;
}
.countdown-section {
font-size: 80%;
padding-bottom: 10%;
}
.mybutton {
padding: 2px;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script>
<div id="dbanner" class="change-color">
<div class="dcontent">
<strong>Some Text Here Some Text Here Some </strong> <span id="dcountdown"></span> Apply Now
</div>
<div id="dclose">close me!</div>
</div>
<script src="https://lizatom.com/wp-content/themes/lizatom2015/banner/jquery.countdown.min.js"></script>
<script src="https://lizatom.com/wp-content/themes/lizatom2015/banner/jquery.plugin.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

Related

Sign Board like Buttons design via css

Buttons design link down below
I need this design tried via before after but need the arrow softer
used skew and all.
also found references but that didn't work out, it seems very easy and similar design but couldn't find similar ones on the internet via examples.
https://i.stack.imgur.com/BCRNb.png
#import url('https://fonts.googleapis.com/css2?family=Montserrat:wght#100&family=Poppins:wght#300&display=swap');
body {
background: #fff;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Montserrat', sans-serif;
font-family: 'Poppins', sans-serif;
}
/* ------------------------- Separate line ------------------------- */
:root {
--breadcrumb-theme-1: #398AB9;
--breadcrumb-theme-2: #DFDFDE;
--breadcrumb-theme-3: #1C658C;
--breadcrumb-theme-4: #FFF;
}
a{
font-size: medium;
}
.breadcrumb {
text-align: center;
display: inline-block;
box-shadow: 0 2px 5px rgba(0,0,0,0.25);
overflow: hidden;
border-radius: 5px;
counter-reset: flag;
}
.breadcrumb__step {
text-decoration: none;
outline: none;
display: block;
float: left;
font-size: 14px;
font-weight:bold;
line-height: 36px;
padding: 0 10px 0 30px;
position: relative;
background: var(--breadcrumb-theme-2);
color: var(--breadcrumb-theme-1);
transition: background 0.5s;
}
.breadcrumb__step:first-child {
border-radius: 5px 0 0 5px;
}
.breadcrumb__step:first-child::before {
left: 14px;
}
.breadcrumb__step:last-child {
border-radius: 0 5px 5px 0;
padding-right: 20px;
}
.breadcrumb__step:last-child::after {
content: none;
}
.breadcrumb__step::after {
content: '';
position: absolute;
top: 0;
right: -18px;
width: 36px;
height: 36px;
transform: scale(0.707) rotate(45deg);
z-index: 1;
border-radius: 0 5px 0 50px;
background: var(--breadcrumb-theme-2);
transition: background 0.5s;
box-shadow: 2px -2px 0 2px var(--breadcrumb-theme-4);
}
.breadcrumb__step--active {
color: var(--breadcrumb-theme-2);
background: var(--breadcrumb-theme-1);
}
.breadcrumb__step--active::before {
color: var(--breadcrumb-theme-1);
}
.breadcrumb__step--active::after {
background: var(--breadcrumb-theme-1);
}
.breadcrumb__step:hover {
color: var(--breadcrumb-theme-2);
background: var(--breadcrumb-theme-3);
}
.breadcrumb__step:hover::before {
color: var(--breadcrumb-theme-1);
}
.breadcrumb__step:hover::after {
color: var(--breadcrumb-theme-1);
background: var(--breadcrumb-theme-3);
}
<div class="breadcrumb">
<a class="breadcrumb__step breadcrumb__step--active" href="#">Choose product</a>
<a class="breadcrumb__step" href="#">Place order</a>
<a class="breadcrumb__step" href="#">Shiping</a>
<a class="breadcrumb__step" href="#">Booking</a>
<a class="breadcrumb__step" href="#">Complete</a>
</div>

The video element is not showing on the page

Recently I used app.js as the framework to design the layout of my web app. The web app is to stream from webcam and show on the webpage html video element.
The webcam is working and running, however the video doesn't show on my webpage, in fact the whole video element like being hidden underneath something.
Could anyone point to me where is my error? at first I though it is about the z-index of the elements, but I couldn't solve it,so it might not be the case.
I will attach snippets of my html and Css files below.
thanks in advance
HTML:
<!DOCTYPE html>
<html>
<head>
<title>PasarOnline</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="../appjsFile/app.min.css">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="manifest" href="../manifest.json">
<!-- Add to home screen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="PasarOnline">
<link rel="apple-touch-icon" href="../images/icons/icon-152x152.png">
<meta name="msapplication-TileImage" content="../images/icons/icon-144x144.png">
<meta name="msapplication-TileColor" content="#2F3BA2">
<style>
.navbar {
background-color: #000;
overflow: hidden;
position: fixed;
bottom: 0;
width: 100%;
z-index: 3000;
}
/* Style the links inside the navigation bar */
.navbar a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.navbar a:hover {
background-color: #ddd;
color: black;
}
.navbar a.active {
background-color: #4CAF50;
color: white;
}
.navbar .icon {
display: none;
}
.form-popup {
display: none;
position: fixed;
bottom: 0;
right: 15px;
border: 3px solid #f1f1f1;
z-index: 1001;
}
.form-container {
max-width: 300px;
padding: 10px;
background-color: white;
}
/* Full-width input fields */
.form-container input[type=text],
input[type=number] {
width: 100%;
padding: 15px;
margin: 5px 0 10px 0;
border: none;
background: #f1f1f1;
}
.form-container input[type=text]:focus {
background-color: #ddd;
outline: none;
}
.form-container .btn {
background-color: #4CAF50;
color: white;
padding: 16px 20px;
border: none;
cursor: pointer;
width: 40%;
margin-left: 10px;
margin-bottom: 10px;
opacity: 0.8;
}
.form-container .cancel {
background-color: red;
}
.centerVideo {
margin: 0 auto;
display: block;
position: relative;
width: 350px;
margin-top: 20px;
}
b {
margin: 0 auto;
}
hr {
margin-top: 32px;
}
.bottom1 {
margin-bottom: 16px;
margin: 0 auto;
}
.card {
/* Add shadows to create the "card" effect */
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
}
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
.container {
padding: 2px 16px;
}
.semi-square {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.wrap {
right: 0;
width: 0 auto;
left: 0;
margin: 16px auto;
}
/* select starting stylings ------------------------------*/
.select {
font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
position: relative;
width: 350px;
margin-top: 20px;
}
.select-text {
position: relative;
font-family: inherit;
background-color: transparent;
width: 350px;
padding: 10px 10px 10px 0;
font-size: 18px;
border-radius: 0;
border: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
/* Remove focus */
.select-text:focus {
outline: none;
border-bottom: 1px solid rgba(0, 0, 0, 0);
}
/* Use custom arrow */
.select .select-text {
appearance: none;
-webkit-appearance: none
}
.select:after {
position: absolute;
top: 18px;
right: 10px;
/* Styling the down arrow */
width: 0;
height: 0;
padding: 0;
content: '';
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid rgba(0, 0, 0, 0.12);
pointer-events: none;
}
/* LABEL ======================================= */
.select-label {
color: rgba(0, 0, 0, 0.26);
font-size: 18px;
font-weight: normal;
position: absolute;
pointer-events: none;
left: 0;
top: 10px;
transition: 0.2s ease all;
}
/* active state */
.select-text:focus~.select-label,
.select-text:valid~.select-label {
color: #228B22;
top: -5px;
transition: 0.2s ease all;
font-size: 14px;
}
/* BOTTOM BARS ================================= */
.select-bar {
position: relative;
display: block;
width: 350px;
}
.select-bar:before,
.select-bar:after {
content: '';
height: 2px;
width: 0;
bottom: 1px;
position: absolute;
background: #228B22;
transition: 0.2s ease all;
}
.select-bar:before {
left: 50%;
}
.select-bar:after {
right: 50%;
}
/* active state */
.select-text:focus~.select-bar:before,
.select-text:focus~.select-bar:after {
width: 50%;
}
/* HIGHLIGHTER ================================== */
.select-highlight {
position: absolute;
height: 60%;
width: 100px;
top: 25%;
left: 0;
pointer-events: none;
opacity: 0.5;
}
.center {
margin: 0 auto;
}
</style>
</head>
<body>
<div class="app-page" data-page="addItemPage">
<div class="app-topbar">
<div class="app-title">Add Item Page</div>
</div>
<div class="app-content">
<div class="app-section">
<h1>Scan Item Barcode:</h1>
<div class="card" >
<video muted playsinline id="qr-video" width="60%" height="60%" class="centerVideo">Video not showing</video>
</div>
<div class="select">
<select id="inversion-mode-select" class="select-text">
<option value="original" selected="original">Scan original</option>
<option value="invert">Scan with inverted colors</option>
<option value="both">Scan both</option>
</select>
<label class="select-label"><b>Select Barcode Type:</b></label>
<span class="select-highlight"></span>
<span class="select-bar"></span>
<br>
</div>
</div>
</div>
</div>
<div class="app-page" data-page="deleteItemPage">
<div class="app-topbar">
<div class="app-button left" data-back data-autotitle></div>
<div class="app-title">Delete Item</div>
</div>
<div class="app-content">
Page 2 is delete item
</div>
</div>
<div class="app-page" data-page="listItemPage">
<div class="app-topbar">
<div class="app-button left" data-back data-autotitle></div>
<div class="app-title">List Item</div>
</div>
<div class="app-content">
Page 3 is list item
</div>
</div>
<div class="form-popup" id="myForm">
<form action="/action_page.php" class="form-container">
<h1>Add Item</h1>
<b>Serial</b>
<input type="number" placeholder="Enter Serial Number" name="vSerial" id="vSerialID" required>
<b>Veggie Name</b>
<input type="text" placeholder="Enter Veggie Name" name="vName" required>
<b>Weight</b>
<input type="number" placeholder="Enter Weight(KG)" name="vWeight" required>
<div align="center">
<button type="submit" class="btn">Add Item</button>
<span><button type="button" class="btn cancel" id="closeBut">Close</button></span>
</div>
</form>
</div>
<div class="navbar" id="bottomNavbar">
Add Item
Delete Item
List Item
</div>
<script src="../appjsFile/zepto.js"></script>
<script src="../appjsFile/app.min.js"></script>
<script type="module">
import QrScanner from "../qr-scanner.min.js";
QrScanner.WORKER_PATH = '../qr-scanner-worker.min.js';
const video = document.getElementById('qr-video');
// const camHasCamera = document.getElementById('cam-has-camera');
const camQrResult = document.getElementById('cam-qr-result');
const closeFormButton = document.getElementById('closeBut');
const deleteBut = document.getElementById("deleteItemBut");
const addBut = document.getElementById("addItemBut");
const listBut = document.getElementById("listItemBut");
const scanner = new QrScanner(video, result => setResult(camQrResult, result));
scanner.start();
App.controller('addItemPage', function(page) {
// put stuff here
});
App.controller('deleteItemPage', function(page) {
// put stuff here
});
App.controller('listItemPage', function(page) {
// put stuff here
});
deleteBut.addEventListener("click", function() {
App.load('deleteItemPage');
});
addBut.addEventListener("click", function() {
App.load('addItemPage');
});
listBut.addEventListener("click", function() {
App.load('listItemPage');
});
closeFormButton.addEventListener("click",closeForm);
// QRManualBut.addEventListener('click',function(){
// document.getElementById("myForm").style.display = "block";
// });
//########## check result #############//
function setResult(label, result) {
openForm(result);
label.textContent = result;
label.style.color = 'teal';
clearTimeout(label.highlightTimeout);
label.highlightTimeout = setTimeout(() => label.style.color = 'inherit', 100);
}
// ####### Web Cam Scanning #######//
document.getElementById('inversion-mode-select').addEventListener('change', event => {
scanner.setInversionMode(event.target.value);
});
//################pop up form ###########//
function openForm(serialNum) {
document.getElementById("myForm").style.display = "block";
document.getElementById("vSerialID").value = serialNum;
}
function closeForm() {
document.getElementById("myForm").style.display = "none";
}
//##########install pop up in homescreen########//
// if (location.protocol != 'https:')
// {
// location.href = 'https:' + window.location.href.substring(window.location.protocol.length);
// }
try {
App.restore();
} catch (err) {
App.load('addItemPage');
}
</script>
</body>
</html>
app.min.css:
html,
body,
div,
form,
p,
ul,
li,
span,
label,
img {
margin: 0;
padding: 0;
outline: 0
}
html,
body {
height: 100%;
width: 100%
}
body {
position: relative;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
overflow: hidden
}
.app-android {
font-family: "Roboto", sans-serif
}
.app-no-scrollbar ::-webkit-scrollbar {
height: 0 !important;
width: 0 !important
}
* {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
tap-highlight-color: rgba(0, 0, 0, 0) !important
}
.clear {
clear: both
}
.app-android .app-ios-only,
.app-ios .app-android-only {
display: none
}
.app-clickblocker {
z-index: 9000;
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: #FFF;
opacity: 0
}
.app-page {
display: none;
position: relative;
height: 100%;
width: 100%;
overflow: hidden
}
.app-loaded .app-page {
display: block
}
.app-ios-7 .app-page,
.app-ios-8 .app-page {
box-shadow: 0 0 12px rgba(0, 0, 0, 0.2)
}
.app-topbar {
z-index: 3000;
position: relative;
height: 44px;
width: 100%;
background-color: #000;
color: #FFF;
-webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.15);
box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.15)
}
.app-android .app-topbar {
height: 56px;
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3)
}
.app-topbar .app-button {
position: absolute;
bottom: 0;
padding: 0 16px;
height: 100%;
line-height: 44px
}
.app-android .app-topbar .app-button {
line-height: 56px
}
.app-topbar .app-button.left {
left: 0
}
.app-topbar .app-button.right {
right: 0
}
.app-topbar .app-title {
margin: 0 auto;
height: 100%;
width: 100%;
line-height: 44px;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
.app-android .app-topbar .app-title {
line-height: 56px
}
.app-ios-statusbar .app-topbar {
padding-top: 20px
}
.app-android-statusbar .app-topbar {
padding-top: 24px
}
.app-android-statusbar .app-topbar:before {
position: absolute;
top: 0;
height: 24px;
width: 100%;
background-color: rgba(0, 0, 0, 0.3);
content: ""
}
.app-ios-statusbar .app-topbar .app-button {
height: 44px
}
.app-android-statusbar .app-topbar .app-button {
height: 56px
}
.app-content {
z-index: 2000;
position: relative;
background-color: #FFF;
overflow: auto;
-webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 12px rgba(0, 0, 0, 0.2)
}
.app-android-2 .app-content {
-webkit-box-shadow: none;
box-shadow: none
}
.app-scrollhack>* {
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0)
}
.app-section {
position: relative;
margin: 8px;
border: 1px solid #AAA
}
.app-list {
list-style: none
}
.app-list>li,
.app-list>li.app-button {
padding-left: 20px;
padding-right: 8px;
height: 43px;
border-bottom: 1px solid #AAA;
line-height: 43px;
overflow: hidden;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap
}
.app-android .app-list>li,
.app-android .app-list>li.app-button {
padding-top: 2px;
padding-bottom: 2px
}
.app-section .app-list>li:last-child,
.app-section .app-list>li.app-button:last-child {
border-bottom: 0
}
.app-list>label {
display: block;
padding-left: 12px;
height: 24px;
background-color: #000;
color: #FFF;
line-height: 24px
}
.app-list>li+label {
margin-top: -1px
}
.app-content .app-button {
margin: 0 auto;
height: 40px;
border-bottom: 1px solid #AAA;
line-height: 40px;
overflow: hidden;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap
}
.app-button:last-child {
border-bottom: 0
}
.app-content .app-button.green {
background-color: #7F7
}
.app-content .app-button.red {
background-color: #F77
}
.app-content .app-button.blue {
background-color: #77F
}
.app-topbar.teal {
background-color: #2B9;
color: #f3f4f5
}
.app-topbar.green {
background-color: #3C7;
color: #f3f4f5
}
.app-topbar.yellow {
background-color: #EC1;
color: #f3f4f5
}
.app-topbar.orange {
background-color: #E82;
color: #f3f4f5
}
.app-topbar.red {
background-color: #dd4539;
color: #f3f4f5
}
.app-topbar.blue {
background-color: #4486f0;
color: #f3f4f5
}
.app-topbar.dark-blue {
background-color: #345;
color: #f3f4f5
}
.app-topbar .app-title {
font-size: 17px;
font-weight: 500
}
.app-android .app-topbar .app-title {
float: left;
padding-left: 15px;
padding-right: 8px;
width: auto;
font-size: 19px;
font-weight: 700;
text-align: left
}
.app-android .app-topbar .app-button.left~.app-title {
padding-left: 60px
}
.app-topbar .app-button {
font-weight: 300;
-webkit-transition: opacity .25s ease-out;
transition: opacity .25s ease-out
}
.app-android .app-topbar .app-button {
padding: 0 13px;
font-weight: 400;
-webkit-transition: background-color .25s ease-out;
transition: background-color .25s ease-out
}
.app-topbar .app-button.active {
opacity: .65
}
.app-android .app-topbar .app-button.active {
opacity: 1;
background-color: rgba(0, 0, 0, 0.2)
}
.app-topbar .app-button.active,
.app-android .app-topbar .app-button.active,
.app-android-2 .app-topbar .app-button,
.app-android-4 .app-topbar .app-button {
-webkit-transition: none;
transition: none
}
.app-topbar .app-button[data-back].left {
padding: 15px 0 15px 27px;
height: 14px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAoCAYAAADkDTpVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAxJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RUQxQ0FCN0VGMjJGMTFFMjg0REFDNDBBRUVBRjJBNDkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RUQxQ0FCN0RGMjJGMTFFMjg0REFDNDBBRUVBRjJBNDkiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiBNYWNpbnRvc2giPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0iNTNBQzg4QkE2OTc3M0MxNDg4ODc1M0VDNzc3ODcwMDUiIHN0UmVmOmRvY3VtZW50SUQ9IjUzQUM4OEJBNjk3NzNDMTQ4ODg3NTNFQzc3Nzg3MDA1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+dT5F6gAAAcNJREFUeNqslz8sA1Ecx+9UKi1ispkwMAgbs5XYTCJhlLB3uxrETsLGUgMbutaqJg0Jg5pqqqVCm1TaPt+X3ONp7n53fb/3kk/Su8v7fq/v3u/Pc4UQjsWRAQNg9/eONLDEtvgbnrpvS3wDdMT/4dkyWAUtETy8PuaaL4EcSIQ8T3HefBHURfg4Bq6p+Dz4JMTPQML0G8yCGiF+BZKmu2gKVAnxG5DW5/QiPg4qhPgdGOmeF1d8DJQJ8UcwGjQ3jric+ESIl/0XcEwM5F++J8TfwCSlQYkPgltC/B3MRK1A2IMUKBDiH34sOCYGcg9fE+INP4odEwMZfeeE+DdY6SV29AsXnBDibbDWa+TrFweCHlsmeUv92IsQz5hm3bj1wLxwx1yiDneJ1Ec+JUxa3I+stukFYdLkbFM90PKESZ0TaIp0RKqocVKFYggUCZMqJ9np6bpEmFQ46VovOM+EyQun4Ogl85UweeCUTMVERNEvcoq+YjqibSlw2hbFXETjdclpvBQL4IswyXFaR735bRAmR5zmV7Hs56ewsc89H+TBOmiHPG/aOkJtBhyhsjbPaJKdbnFJv8Uj7CEYBkmQVTd/BBgAAQDbZCXVLesAAAAASUVORK5CYII=);
background-repeat: no-repeat;
-webkit-background-size: 12px 20px;
background-size: 12px 20px;
background-position: 8px center;
line-height: 14px
}
.app-android .app-topbar .app-button[data-back].left {
padding: 0 16px;
height: 56px;
width: 24px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAABCRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyI+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDx0aWZmOkNvbXByZXNzaW9uPjU8L3RpZmY6Q29tcHJlc3Npb24+CiAgICAgICAgIDx0aWZmOlhSZXNvbHV0aW9uPjcyPC90aWZmOlhSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj43MjwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjcyPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj43MjwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgICAgIDxkYzpzdWJqZWN0PgogICAgICAgICAgICA8cmRmOkJhZy8+CiAgICAgICAgIDwvZGM6c3ViamVjdD4KICAgICAgICAgPHhtcDpNb2RpZnlEYXRlPjIwMTU6MDI6MTMgMjI6MDI6MzU8L3htcDpNb2RpZnlEYXRlPgogICAgICAgICA8eG1wOkNyZWF0b3JUb29sPlBpeGVsbWF0b3IgMy4zLjE8L3htcDpDcmVhdG9yVG9vbD4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+ChTTdgYAAAF3SURBVHgB7dtBCsIwFIRh69o7eAhdiQdw53U9gFsP4dqt4LK+QANF6Dgp1FbyCyXCG2nz8aKQ1tWKFwIIIIAAAggggAACCCCAQNUCbdte0lE1wtDkO5xnjOkAqQ/1gQOSgbMYpHX/Yn/9vltKR3HeXWS2oj55aTYgA+cVsz83TXOfXGFpJxj4zsnLKo2POA5Lu+6fXA84ghkccISAKNE54AgBUaJzwBECokTngCMERInOAUcIiBKdA44QEKUaOqcR85elhBMBtdklPz9XMfaXNiXnHrVh9q84JTA5WwxUE05CKgbKsrWMxUCxhk+BcwVICNSGJCh0qYafeS1gVEECyRAwInQSSIaAEaGTQDIEjAidBJIhYEToJJAMASNCJ4FkCBgROgkkQ8CI/Esnjb6rYRh8jSSkCKk7I+lJ1/2cT7oWb7l+nXVBwNiZvM2JUzCVaaMDy43/a/TZP5DA6ePk9x0SOBmEEQEEEEAAAQQQQAABBBCoVOANecdGRmb5/CMAAAAASUVORK5CYII=);
-webkit-background-size: 24px 24px;
background-size: 24px 24px;
background-position: center;
color: transparent
}
.app-android .app-topbar>:last-child:after {
content: "";
clear: both
}
.app-page,
.app-content {
background-color: #efeff4
}
.app-section,
.app-list>li,
.app-list>li.app-button,
.app-content .app-button,
.app-input {
border: 0
}
.app-section {
margin: 16px;
padding: 8px;
background: #FFF;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
-webkit-border-radius: 6px;
border-radius: 6px
}
.app-ios-7 .app-section,
.app-ios-8 .app-section {
border-bottom: 0
}
.app-section.app-button {
margin: 16px;
padding: 0
}
p.app-section {
padding: 12px 16px;
color: #665
}
.app-content .app-section>* {
margin: 8px 0 0;
-webkit-border-radius: 4px;
border-radius: 4px
}
.app-content .app-section>:first-child {
margin-top: 0
}
.app-list>label {
height: 28px;
background-color: #d5e5e6;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: #778;
font-size: 14px;
font-weight: 600;
line-height: 28px
}
.app-android .app-list>label {
font-size: 11px;
font-weight: 700;
text-transform: uppercase
}
.app-list>li {
background-color: #FFF;
color: #444
}
.app-list>li,
.app-list>li.app-button {
border-top: 1px solid rgba(0, 0, 0, 0.05);
-webkit-box-sizing: border-box;
box-sizing: border-box
}
.app-android .app-list>li,
.app-android .app-list>li.app-button {
padding-top: 0;
padding-bottom: 0;
height: 47px;
line-height: 47px
}
.app-list>li.app-button.active {
border-top: 1px solid rgba(0, 0, 0, 0.0)
}
.app-list>li:first-child,
.app-list>li.app-button:first-child,
.app-list>label+li,
.app-list>label+li.app-button,
.app-list>label+li.app-button.active,
.app-list>li.app-button.active+li,
.app-list>li.app-button.active+li.app-button {
border-top-color: transparent
}
.app-input[type="search"].no-icon,
.app-android .app-input[type="search"].no-icon-android,
.app-ios .app-input[type="search"].no-icon-ios {
padding-left: 12px;
background-image: none
}
You can check this blog post regarding accessing the webcam in html5.
Here is the basic code for this:
HTML file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="stuff, to, help, search, engines, not" name="keywords">
<meta content="What this page is about." name="description">
<meta content="Display Webcam Stream" name="title">
<title>Display Webcam Stream</title>
<style>
#container {
margin: 0px auto;
width: 500px;
height: 375px;
border: 10px #333 solid;
}
#videoElement {
width: 500px;
height: 375px;
background-color: #666;
}
</style>
</head>
<body>
<div id="container">
<video autoplay="true" id="videoElement">
</video>
</div>
<script>
</script>
</body>
</html>
JS file:
var video = document.querySelector("#videoElement");
if (navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({video: true})
.then(function(stream) {
video.srcObject = stream;
})
.catch(function(err0r) {
console.log("Something went wrong!");
});
}
Try and implement the following using the getUserMedia method. All we are telling getUserMedia is to specify a constraints object whose video property is set to true. This means that default settings will be used in capturing the visuals and displaying them.

Firefox not showing full HTML page - CSS

I have a website with bootstrap CSS.
I tested it on chrome and edge browsers, the CSS seems perfectly fine.
On firefox, everything looks zoomed in. When i go to the settings of the browser and zoom out, I can see the full HTML.
On chrome :
https://imgur.com/a/bRdLT4C
Firefox normal size:
https://imgur.com/a/CDNwKCG
Firefox zoomed out :
https://imgur.com/a/w5X8nOb
I am completely new to CSS, any help would be appreciated.
Sample of my code: https://jsfiddle.net/hewp0q2j/
HTML
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="container app">
<div class="row app-one">
<div class="col-sm-4 side">
<div class="side-one">
<div class="row sideBar" id="users">
<div class="row sideBar-body">
<div class="col-sm-3 col-xs-3 sideBar-avatar">
<div class="avatar-icon">
<img src="img/user_away.png">
</div>
</div>
<div class="col-sm-9 col-xs-9 sideBar-main">
<div class="row">
<div class="col-sm-8 col-xs-8 sideBar-name">
<span class="name-meta">David Leff</span><br><span class="time-meta">Last Active 1h 51m ago.</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-8 conversation">
<div id="chatdiv">
<div class="row message" id="conversation">
<div class="row message-body">
<div class="col-sm-12 message-main-receiver">
<div class="receiver">
<div class="message-text">
Hi, what are you doing?!
</div>
<span class="message-time pull-right">
Sun
</span>
</div>
</div>
</div>
</div>
</div>
<div class="row reply">
<div class="col-sm-9 col-xs-9 reply-main">
<textarea class="form-control" rows="1" id="comment" onkeypress="processKeyPress(event, this)"></textarea>
</div>
<div class="col-sm-1 col-xs-1 reply-send">
<span onclick="SendMessage()">
<i class="fa fa-send fa-2x" aria-hidden="true"></i>
</span>
<span class="error" id ="error"></span>
</div>
</div>
</div>
</div>
</div>
CSS
html,
body,
div,
span {
/** height: 100%;*/
width: 100%;
overflow: hidden;
padding: 0;
margin: 0;
box-sizing: border-box;
}
.fa-2x {
font-size: 1.5em;
}
.app {
position: relative;
overflow: hidden;
top: 19px;
height: calc(100% - 38px);
margin: auto;
padding: 0;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .06), 0 2px 5px 0 rgba(0, 0, 0, .2);
}
.app-one {
background-color: #f7f7f7;
height: 100%;
overflow: hidden;
margin: 0;
padding: 0;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .06), 0 2px 5px 0 rgba(0, 0, 0, .2);
}
.side {
padding: 0;
margin: 0;
height: 100%;
}
.side-one {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
z-index: 1;
position: relative;
display: block;
top: 0;
}
.side-two {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
z-index: 2;
position: relative;
top: -100%;
left: -100%;
-webkit-transition: left 0.3s ease;
transition: left 0.3s ease;
}
.heading {
padding: 10px 16px 10px 15px;
margin: 0;
height: 60px;
width: 100%;
background-color: #eee;
z-index: 1000;
}
.heading-avatar {
padding: 0;
cursor: pointer;
}
.heading-avatar-icon img {
border-radius: 50%;
height: 40px;
width: 40px;
}
.heading-name {
padding: 0 !important;
cursor: pointer;
}
.heading-name-meta {
font-weight: 700;
font-size: 100%;
padding: 5px;
padding-bottom: 0;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
color: #000;
display: block;
}
.heading-online {
display: none;
padding: 0 5px;
font-size: 12px;
color: #93918f;
}
.heading-compose {
padding: 0;
}
.heading-compose i {
text-align: center;
padding: 5px;
color: #93918f;
cursor: pointer;
}
.heading-dot {
padding: 0;
margin-left: 10px;
}
.heading-dot i {
text-align: right;
padding: 5px;
color: #93918f;
cursor: pointer;
}
.searchBox {
padding: 0 !important;
margin: 0 !important;
height: 60px;
width: 100%;
}
.searchBox-inner {
height: 100%;
width: 100%;
padding: 10px !important;
background-color: #fbfbfb;
}
/*#searchBox-inner input {
box-shadow: none;
}*/
.searchBox-inner input:focus {
outline: none;
border: none;
box-shadow: none;
}
.sideBar {
padding: 0 !important;
margin: 0 !important;
background-color: #fff;
overflow-y: auto;
border: 1px solid #f7f7f7;
height: calc(100% - 20px);
}
.sideBar-body {
position: relative;
padding: 10px !important;
/**border-bottom: 1px solid #f7f7f7;*/
height: 72px;
margin: 0 !important;
/*cursor: pointer;*/
}
/*.sideBar-body:hover {
background-color: #f2f2f2;
}*/
.sideBar-avatar {
text-align: center;
padding: 0 !important;
}
.avatar-icon img {
border-radius: 50%;
height: 49px;
width: 49px;
}
.sideBar-main {
padding: 0 !important;
}
.sideBar-main .row {
padding: 0 !important;
margin: 0 !important;
}
.sideBar-name {
padding: 10px !important;
}
.name-meta {
font-size: 100%;
padding: 1% !important;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
color: #000;
}
.sideBar-time {
padding: 10px !important;
}
.time-meta {
text-align: right;
font-size: 12px;
padding: 1% !important;
color: rgba(0, 0, 0, .4);
vertical-align: baseline;
}
/*New Message*/
.newMessage {
padding: 0 !important;
margin: 0 !important;
height: 100%;
position: relative;
left: -100%;
}
.newMessage-heading {
padding: 10px 16px 10px 15px !important;
margin: 0 !important;
height: 100px;
width: 100%;
background-color: #00bfa5;
z-index: 1001;
}
.newMessage-main {
padding: 10px 16px 0 15px !important;
margin: 0 !important;
height: 60px;
margin-top: 30px !important;
width: 100%;
z-index: 1001;
color: #fff;
}
.newMessage-title {
font-size: 18px;
font-weight: 700;
padding: 10px 5px !important;
}
.newMessage-back {
text-align: center;
vertical-align: baseline;
padding: 12px 5px !important;
display: block;
cursor: pointer;
}
.newMessage-back i {
margin: auto !important;
}
.composeBox {
padding: 0 !important;
margin: 0 !important;
height: 60px;
width: 100%;
}
.composeBox-inner {
height: 100%;
width: 100%;
padding: 10px !important;
background-color: #fbfbfb;
}
.composeBox-inner input:focus {
outline: none;
border: none;
box-shadow: none;
}
.compose-sideBar {
padding: 0 !important;
margin: 0 !important;
background-color: #fff;
overflow-y: auto;
border: 1px solid #f7f7f7;
height: calc(100% - 160px);
}
/*Conversation*/
.conversation {
padding: 0 !important;
margin: 0 !important;
height: 100%;
/*width: 100%;*/
border-left: 1px solid rgba(0, 0, 0, .08);
/*overflow-y: auto;*/
}
.message {
padding: 0 !important;
margin: 0 !important;
background: url("w.jpg") no-repeat fixed center;
background-size: cover;
overflow-y: auto;
border: 1px solid #f7f7f7;
height: calc(100% - 120px);
}
.message-previous {
margin : 0 !important;
padding: 0 !important;
height: auto;
width: 100%;
}
.previous {
font-size: 15px;
text-align: center;
padding: 10px !important;
cursor: pointer;
}
.previous a {
text-decoration: none;
font-weight: 700;
}
.message-body {
margin: 0px 0px 3px 0px !important;
padding: 0 !important;
width: auto;
height: auto;
}
.message-main-receiver {
/*padding: 10px 20px !important;*/
max-width: 60%;
}
.message-main-sender {
/* padding: 3px 20px !important;*/
margin-left: 40% !important;
max-width: 60%;
}
.message-text {
margin: 0 !important;
padding: 5px !important;
word-wrap:break-word;
font-weight: 200;
font-size: 14px;
padding-bottom: 0 !important;
}
.message-time {
margin: 0 !important;
margin-left: 50px !important;
font-size: 12px;
text-align: right;
color: #9a9a9a;
}
.receiver {
width: auto !important;
padding: 4px 10px 7px !important;
border-radius: 10px 10px 10px 0;
background: #dae4f1;
font-size: 12px;
text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
word-wrap: break-word;
display: inline-block;
}
.sender {
float: right;
width: auto !important;
background: #2b4871; /**#ffdb99;**/
color:white;
border-radius: 10px 10px 0 10px;
padding: 4px 10px 7px !important;
font-size: 12px;
text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
display: inline-block;
word-wrap: break-word;
}
/*Reply*/
.reply {
height: 117px;
width: 100%;
background-color: #f5f1ee;
padding: 10px 5px 10px 5px !important;
margin: 0 !important;
z-index: 1000;
}
.reply-emojis {
padding: 5px !important;
}
.reply-emojis i {
text-align: center;
padding: 5px 5px 5px 5px !important;
color: #93918f;
cursor: pointer;
}
.reply-recording {
padding: 5px !important;
}
.reply-recording i {
text-align: center;
padding: 5px !important;
color: #93918f;
cursor: pointer;
}
.reply-send {
padding: 5px !important;
}
.reply-send i {
text-align: center;
padding: 5px !important;
color: #93918f;
cursor: pointer;
}
.reply-main {
padding: 2px 5px !important;
}
.reply-main textarea {
width: 100%;
resize: none;
overflow: hidden;
padding: 5px !important;
outline: none;
border: none;
text-indent: 5px;
box-shadow: none;
height: 100%;
font-size: 16px;
}
.reply-main textarea:focus {
outline: none;
border: none;
text-indent: 5px;
box-shadow: none;
}
#media screen and (max-width: 700px) {
.app {
top: 0;
height: 100%;
}
.heading {
height: 70px;
background-color: #009688;
}
.fa-2x {
font-size: 2.3em !important;
}
.heading-avatar {
padding: 0 !important;
}
.heading-avatar-icon img {
height: 50px;
width: 50px;
}
.heading-compose {
padding: 5px !important;
}
.heading-compose i {
color: #fff;
cursor: pointer;
}
.heading-dot {
padding: 5px !important;
margin-left: 10px !important;
}
.heading-dot i {
color: #fff;
cursor: pointer;
}
.sideBar {
height: calc(100% - 130px);
}
.sideBar-body {
height: 80px;
}
.sideBar-avatar {
text-align: left;
padding: 0 8px !important;
}
.avatar-icon img {
height: 55px;
width: 55px;
}
.sideBar-main {
padding: 0 !important;
}
.sideBar-main .row {
padding: 0 !important;
margin: 0 !important;
}
.sideBar-name {
padding: 10px 5px !important;
}
.name-meta {
font-size: 16px;
padding: 5% !important;
}
.sideBar-time {
padding: 10px !important;
}
.time-meta {
text-align: right;
font-size: 14px;
padding: 4% !important;
color: rgba(0, 0, 0, .4);
vertical-align: baseline;
}
/*Conversation*/
.conversation {
padding: 0 !important;
margin: 0 !important;
height: 100%;
/*width: 100%;*/
border-left: 1px solid rgba(0, 0, 0, .08);
/*overflow-y: auto;*/
}
.message {
height: calc(100% - 140px);
}
.reply {
height: 70px;
}
.reply-emojis {
padding: 5px 0 !important;
}
.reply-emojis i {
padding: 5px 2px !important;
font-size: 1.8em !important;
}
.reply-main {
padding: 2px 8px !important;
}
.reply-main textarea {
padding: 8px !important;
font-size: 18px;
}
.reply-recording {
padding: 5px 0 !important;
}
.reply-recording i {
padding: 5px 0 !important;
font-size: 1.8em !important;
}
.reply-send {
padding: 5px 0 !important;
}
.reply-send i {
padding: 5px 2px 5px 0 !important;
font-size: 1.8em !important;
}
}
#HelpASisterOut you should really rethink your HTML and CSS formats. The website doesn't need to be as complicated. General styling recomendations are:
avoid setting styles in CSS to html/body/div/span tags
avoid repeated CSS code, use classes instead (padding, margin, etc.)
avoid using calc() and mixes of percentages and pixels (breaks responsiveness of the page)
think another solution (inheritance, classes, ids) instead of using !important everywhere
avoid using overflow and setting positions manually as each browser may render different things/sizes
other things like repeating same-width bootstrap classes are unnecessary:
col-sm-9 col-xs-9
bootstrap takes the smaller one and applies to all bigger sizes.
This is not a direct answer and I apologize for not pointing the exact mistake, but I promise you that with this things in mind your app will be rightly rendered on all mayor browsers and even on mobile. You just need to look at things differently, maybe explore some webpages done by others. Hope this helps.
Good learning!

Div keeps overflowing onto other elements when zoomed in

I'm trying to make a small web page with a search bar and an accounts menu (currently just a circle), but I've noticed, when I zoom in, or resize the page, the accounts menu overflows onto the search bar. I've tried changing from absolute positioning, to relative and adjusting the right: 30px accordingly, but this didn't work. I'm incredibly stuck, can anyone offer any advice/code?
body {
font-family: "PT-Sans", sans-serif;
background-color: #bbb;
}
input:focus {
outline: none;
}
.search-btn {
border: none;
padding: 12px;
font-size: 18px;
background-color: #009AFF;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
color: white;
width: 70px;
position: relative;
right: 5px;
cursor: pointer;
}
.input {
width: 500px;
padding: 11px;
font-size: 18px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
border: 1px solid #777;
}
.search {
width: 600px;
position: absolute;
left: 200px;
top: 15px;
}
.logo a {
color: #009AFF;
font-size: 38px;
text-decoration: none;
}
.logo {
position: absolute;
left: 0;
top: 12px;
width: 200px;
}
.content {
width: 300px;
border: 2px solid #eee;
background-color: #fff;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
top: 65px;
padding: 5px;
}
#account-items {
display: none;
background-color: #fff;
width: 300px;
border: 2px solid #eee;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
position: absolute;
right: 0px;
top: 72px;
padding: 5px;
}
/*.accounts:hover #account-items {
display: inline;
}*/
#account-items a {
color: #009AFF;
text-decoration: none;
display: block;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
}
#account-items a:hover {
background-color: #eee;
}
.accounts {
cursor: pointer;
position: absolute;
right: 30px;
width: 66px;
height: 66px;
top: 4px;
padding: 0px;
border-radius: 100%;
}
.accounts .image {
background-image: url("/email/scripts/profile.png");
background-size: 100%;
background-repeat: no-repeat;
border: 1px solid #777;
border-radius: 100%;
width: 63px;
height: 63px;
}
a {
color: #009AFF;
text-decoration: none;
}
.js-is-hidden {
display: none;
}
<head>
<title>Test</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="body">
<div class="header">
<div class="logo">
<center>Unnamed</center>
</div>
<div class="search">
<form action="search.php" method="GET">
<input type="text" name="q" class="input" autocomplete="off" />
<button type="submit" class="search-btn">Go</button>
</form>
</div>
<div class="accounts">
<div class="image">
</div>
</div>
</div>
</div>
If you remove the absolute positioning and stick with the default relative, then use a display of inline-block (Read up on what it does here: https://www.w3schools.com/css/css_inline-block.asp) and use dynamic widths instead of static ones, you should get your desired result.
See the updated code below;
body {
font-family: "PT-Sans", sans-serif;
background-color: #bbb;
}
input:focus {
outline: none;
}
.search-btn {
border: none;
padding: 12px;
font-size: 18px;
background-color: #009AFF;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
color: white;
width: 70px;
position: relative;
right: 5px;
cursor: pointer;
}
.input {
width: calc(100% - 100px); /* CHANGED */
padding: 11px;
font-size: 18px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
border: 1px solid #777;
}
.search {
max-width: 600px; /* CHANGED */
width: calc(100% - 300px); /* ADDED */
/* position: absolute; REMOVED */
/* left: 200px; REMOVED */
/*top: 15px; REMOVED */
display: inline-block; /* ADDED */
vertical-align: middle; /* ADDED */
}
.logo a {
color: #009AFF;
font-size: 38px;
text-decoration: none;
}
.logo {
/*position: absolute; //REMOVED */
/*left: 0; //REMOVED */
display: inline-block; /* ADDED */
vertical-align: middle; /* ADDED */
top: 12px;
width: 200px;
}
.content {
width: 300px;
border: 2px solid #eee;
background-color: #fff;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
top: 65px;
padding: 5px;
}
#account-items {
display: none;
background-color: #fff;
width: 300px;
border: 2px solid #eee;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
position: absolute;
right: 0px;
top: 72px;
padding: 5px;
}
/*.accounts:hover #account-items {
display: inline;
}*/
#account-items a {
color: #009AFF;
text-decoration: none;
display: block;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
}
#account-items a:hover {
background-color: #eee;
}
.accounts {
cursor: pointer;
/* position: absolute; REMOVED */
/* right: 30px; REMOVED */
width: calc(100% - 809px); /* CHANGED */
height: 66px;
/* top: 4px; REMOVED */
padding: 0px;
border-radius: 100%;
display: inline-block; /* ADDED */
vertical-align: middle; /* ADDED */
text-align: right; /* ADDED */
}
.accounts .image {
background-image: url("/email/scripts/profile.png");
background-size: 100%;
background-repeat: no-repeat;
border: 1px solid #777;
border-radius: 100%;
width: 63px;
height: 63px;
display: inline-block; /* ADDED */
}
a {
color: #009AFF;
text-decoration: none;
}
.js-is-hidden {
display: none;
}
<head>
<title>Test</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="body">
<div class="header">
<div class="logo">
<center>Unnamed</center>
</div>
<div class="search">
<form action="search.php" method="GET">
<input type="text" name="q" class="input" autocomplete="off" />
<button type="submit" class="search-btn">Go</button>
</form>
</div>
<div class="accounts">
<div class="image">
</div>
</div>
</div>
</div>
try this
.header {
position: relative;
min-width: 900px;
}
https://jsfiddle.net/59ncte3m/1/
It will avoid the issue where your menu gets drawn on top of the search by making the header a positioned element, the menu absolute position will be relative to the header. giving it a min-width will make sure all elements fit within.
This is still not a good responsive design, as it should avoid pixel dimentions, but it is enough to fix the overflowing issue.

Not able to center align text

I have buttons as active and deactive. These buttons are used as toggle. I want center align text in button. Please help.
Here is code snippet in Plunker
CSS Code
body {
font-family: 'Montserrat', sans-serif;
background-color: #E5E5E5;
min-width: 1280px;
overflow: scroll;
}
/* toggle switch style ======================================= */
.profile_status {
padding: 6px 50px 0px 0px;
}
.active_inactive_container {
display: inline-block;
height: 28px;
border: 1px solid #DFDFDF;
background-color: #FFFFFF;
border-radius: 15px;
padding: 2px 0px 2px 2px;
}
.active_button,
.inactive_button,
.clicked_active_button,
.clicked_inactive_button {
height: 22px;
background-color: #FFFFFF;
border: none !important;
color: #333333;
border-radius: 15px;
outline: none;
font-size: 11px;
padding: 0px 5px 0px 18px;
}
.clicked_active_button {
background-color: #51B151 !important;
color: #FFFFFF !important;
margin-left: 62px;
position: absolute;
opacity: 0;
}
.clicked_active_button1 {
opacity: 1 !important;
-webkit-transform: translateX(-140px);
-ms-transform: translateX(-140px);
transform: translateX(-140px);
transition: .1s;
}
.clicked_inactive_button {
background-color: #f75252 !important;
color: #FFFFFF !important;
margin-left: 6px;
position: absolute;
opacity: 0;
}
.clicked_active_switch {
margin-left: 78px !important;
}
Html Code
<div class="active_inactive_container toggle_switch_container">
<button class="clicked_inactive_button clicked_inactive_switch ng-binding">Inactive</button>
<button class="active_button ng-binding" ng-click="">Active</button>
<button class="clicked_active_button clicked_active_switch ng-binding clicked_active_button1" >Active</button>
<button class="inactive_button ng-binding" >Inactive</button>
</div>
How to centralize the Active and Inactive button text?
change padding
.active_button, .inactive_button, .clicked_active_button, .clicked_inactive_button {
background-color: #ffffff;
border: medium none !important;
border-radius: 15px;
color: #333333;
font-size: 11px;
height: 22px;
outline: medium none;
padding: 0 11px;
}
remove the height and play with the padding of the container it will work .
.active_inactive_container {
display: inline-block;
border: 1px solid #DFDFDF;
background-color: #FFFFFF;
border-radius: 15px;
padding: 6px 10px;
}
Padding for the buttons is the problem padding: 0px 5px 0px 18px;
try changing it like this
padding: 0px 10px 0px 10px;
margin: 0px 0px 0px 23px;
This may not be the best solution out there
Update
Here is a working fiddle: http://codepen.io/anon/pen/WoBVZM?editors=0100
Below is the class I changed, just modified padding and added margin.
I used padding to fix the text alignment issue and margin to center the button.
.active_button, .inactive_button, .clicked_active_button, .clicked_inactive_button
{
height: 22px;
background-color:#FFFFFF;
border:none !important;
color: #333333;
border-radius: 15px;
outline: none;
font-size: 11px;
padding: 0px 10px 0px 10px;
margin: 2px 5px;
}
I found that by adding the padding: 0 11px; to .active_button, .inactive_button, .clicked_active_button, .clicked_inactive_button your problem will be resolved. Also i added some margin to .active_inactive_container button.
Please check the entire CSS Changes below.
.active_inactive_container button{
margin:3px;
}
.active_button, .inactive_button, .clicked_active_button, .clicked_inactive_button
{
height: 22px;
background-color:#FFFFFF;
border:none !important;
color: #333333;
border-radius: 15px;
outline: none;
font-size: 11px;
padding: 0 11px;
}
You mean like this?
body {
font-family: 'Montserrat', sans-serif;
background-color: #E5E5E5;
min-width: 1280px;
overflow: scroll;
}
.profile_status {
padding: 6px 50px 0px 0px;
}
.active_inactive_container {
display: table;
border: 1px solid #DFDFDF;
background-color: #FFFFFF;
border-radius: 15px;
}
.active_button,
.inactive_button,
.clicked_active_button,
.clicked_inactive_button {
display: table-cell;
vertical-align: middle;
padding: 1rem;
background-color: #FFFFFF;
border: none !important;
color: #333333;
border-radius: 15px;
text-align: center;
outline: none;
font-size: 11px;
margin: 0;
}
You need to add the padding to get the text in center. i have created demo for both active and inactive option selected.
edited padding in this class
.active_button,
.inactive_button,
.clicked_active_button,
.clicked_inactive_button {
height: 22px;
background-color: #FFFFFF;
border: none !important;
color: #333333;
border-radius: 15px;
outline: none;
font-size: 11px;
padding: 0px 18px 0px 18px;
}
Example :
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
});
body {
font-family: 'Montserrat', sans-serif;
background-color: #E5E5E5;
min-width: 1280px;
overflow: scroll;
}
/* toggle switch style ======================================= */
.profile_status {
padding: 6px 50px 0px 0px;
}
.active_inactive_container {
display: inline-block;
height: 28px;
border: 1px solid #DFDFDF;
background-color: #FFFFFF;
border-radius: 15px;
padding: 2px 0px 2px 2px;
}
.active_button,
.inactive_button,
.clicked_active_button,
.clicked_inactive_button {
height: 22px;
background-color: #FFFFFF;
border: none !important;
color: #333333;
border-radius: 15px;
outline: none;
font-size: 11px;
padding: 0px 18px 0px 18px;
}
.clicked_active_button {
background-color: #51B151 !important;
color: #FFFFFF !important;
margin-left: 62px;
position: absolute;
opacity: 0;
}
.clicked_active_button1 {
opacity: 1 !important;
-webkit-transform: translateX(-140px);
-ms-transform: translateX(-140px);
transform: translateX(-140px);
transition: .1s;
}
.clicked_inactive_button1 {
opacity: 1 !important;
-webkit-transform: translateX(-140px);
-ms-transform: translateX(-140px);
transform: translateX(-140px);
transition: .1s;
}
.clicked_inactive_button {
background-color: #f75252 !important;
color: #FFFFFF !important;
margin-left: 6px;
position: absolute;
opacity: 0;
}
.clicked_active_switch {
margin-left: 78px !important;
}
.clicked_inactive_switch {
margin-left: 198px !important;
}
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<meta charset="utf-8" />
<title>AngularJS Plunker</title>
<script>document.write('<base href="' + document.location + '" />');</script>
<script data-require="angular.js#1.4.x" src="https://code.angularjs.org/1.4.12/angular.js" data-semver="1.4.9"></script>
<link data-require="bootstrap#4.0.5" data-semver="4.0.5" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script>
<script data-require="bootstrap#4.0.5" data-semver="4.0.5" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl as $ctrl">
<div class="active_inactive_container toggle_switch_container">
<button class="clicked_inactive_button clicked_inactive_switch ng-binding">Inactive</button>
<button class="active_button ng-binding" ng-click="$ctrl.toggleSwitchOn()">Active</button>
<button class="clicked_active_button clicked_active_button1 clicked_active_switch ng-binding " >Active</button>
<button class="inactive_button ng-binding" ng-click="$ctrl.toggleSwitchOff()">Inactive</button>
</div>
<div class="active_inactive_container toggle_switch_container">
<button class="clicked_inactive_button clicked_inactive_switch clicked_inactive_button1 ng-binding">Inactive</button>
<button class="active_button ng-binding" ng-click="$ctrl.toggleSwitchOn()">Active</button>
<button class="clicked_active_button clicked_active_switch ng-binding " >Active</button>
<button class="inactive_button ng-binding" ng-click="$ctrl.toggleSwitchOff()">Inactive</button>
</div>
</body>
</html>