How to fix responsive layout width problem - css

screenshotI'm quite new to coding. I have this responsive width problem which is probably a simple solution but I can't yet find. Every time I reduce the screen past around 580px the layout reduces at twice the rate of the viewport, leaving me with half of my project on the left and whitespace on the right.
Can someone please help me?
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
.clear {
clear: both;
}
body {
line-height: 1.5;
background-color: whitesmoke;
}
.width-container {
width: 80%;
margin: auto;
}
/* Responsive */
#media(max-width: 1100px) {
.flex-form-container {
flex-direction: column;
align-items: center;
}
.flex-list-and-images-container {
flex-direction: column;
align-items: center;
}
.why-me-list {
width: 60%;
}
.flex-reviews {
flex-direction: column;
padding: 4em;
}
.quote1 {
top: 20%;
}
.quote2 {
top: 40%;
}
.quote3 {
top: 62.5%
}
}
#media screen and (max-width: 768px) {
.flex-header-container {
flex-direction: column;
align-items: center;
}
.flexbox-1 {
order: 1;
}
.flexbox-2 {
order: 3;
}
.flexbox-3 {
order: 2;
}
/*
.contact-message {
float: none;
}
.contact-numbers {
float: none;
}
*/
.width-container {
width: 100%;
}
.nav-tab {
display: block;
}
}
/*
#media screen and (max-width: 580px) {
body {
position: absolute;
}
}
*/
/* Header */
header {
background-image: url(Images/jaye-haych-7tkDoo2L_Eg-unsplash.jpg);
background-position: center;
background-size: cover;
}
.flex-header-container {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: -o-flex;
display: flex;
justify-content: space-between;
}
.flex-header-container div {
padding: 0.5em;
margin: 0.5em;
}
.flexbox-1 {
flex-basis: 33%;
}
.flexbox-2 {
background-color: rgb(255, 255, 255);
flex-basis: 22.5%;
border-radius: 10px;
display: flex;
flex-direction: column-reverse;
align-items: center;
}
.flexbox-2 .ncfe {
margin: 1.4em;
padding: em;
}
.flexbox-2 .CG {
margin:
}
.flexbox-3 {
flex-basis: 33%;
color: white;
text-shadow: 1px 1px 1px black;
font-family: 'Satisfy', cursive;
}
.flexbox-3 h4 {
font-size: 2.5em;
padding: 0.3em;
text-align: center;
font-style: italic;
font-family: 'Satisfy', cursive;
}
.flexbox-3 span {
display: block;
text-align: center;
font-size: 1.35em;
}
.logo {
width: 165px;
height: 220px;
}
.CG {
width: 130px;
}
.ncfe {
width: 100px;
}
/* Nav section */
nav {
text-align: center;
background-color: #1A98BE;
color: white;
padding: 0.7em;
border-top: 1px solid black;
border-bottom: 1px solid black;
}
.nav-tab {
display: inline-block;
margin: 0.5em;
padding: 0.4em;
font-size: 1.5em;
text-shadow: 1px 1px 1px black;
background-color: #F3CA4F;
border-radius: 10px;
box-shadow: 0.5px 0.5px 0.5px 0.5px black;
text-transform: uppercase;
}
nav ul li a {
text-decoration: none;
color: white;
font-style: italic;
transition: 1.5s;
}
nav ul li a:hover {
color: #E85522;
font-size: 2em;
}
/* About Section */
.about {
}
h1 {
padding: 1em;
font-size: 4.4em;
background-color: #E85522;
color: white;
text-shadow: 5px 1px 1px black;
text-align: center;
font-style: italic;
font-family: 'Satisfy', cursive;
border-radius: 0 0 5px 5px;
box-shadow: 1px 1px 1px 1px black;
transition: 1.5s;
}
.why-choose-me {
padding: 1em;
font-size: 2.3em;
background-color: #E85522;
color: white;
text-shadow: 3px 1px 1px black;
font-family: 'Satisfy', cursive;
border-radius: 5px;
box-shadow: 1px 1px 1px 1px black;
font-style: italic;
}
.about p {
padding: 1.5em;
font-size: 1.2em;
}
/* Why Me Section */
.flex-list-and-images-container {
display: flex;
justify-content: space-around;
}
.why-me-images {
display: flex;
flex-basis: 30%;
justify-content: center;
align-self: center;
/* border: 1px solid black;*/
}
.why-me-images .ncfe {
margin-left: 1em;
margin-top: 1em;
width: 100%;
height: 7em;
}
.why-me-list {
flex-basis: 40%;
margin: 2em;
padding: 1em;
border: 1px solid black;
background-color: #B0B0B3;
color: white;
border-radius: 5px;
box-shadow: 1px 1px 1px black;
}
.why-me-item {
padding: 1em;
list-style-type: none;
text-shadow: 1px 1px 1px black;
font-size: 1.2em;
}
.why-me-item:before {
content: '✓';
padding: 0.3em;
}
/* Reviews */
.flex-reviews {
border: 1px solid black;
display: flex;
justify-content: space-around;
background-image: url(Images/amol-tyagi-TUbhfdomGsY-unsplash.jpg);
background-position: center;
background-size: cover;
align-items: center;
}
.customer-review {
font-size: 1.4em;
flex-basis: 30%;
text-align: center;
color: white;
text-shadow: 1px 1px 1px black;
padding: 2.5em;
}
.reviews h2 {
padding: 1em;
background-color: #E85522;
color: white;
font-family: 'Satisfy', cursive;
font-style: italic;
font-size: 2.2em;
text-align: center;
text-shadow: 1px 1px 1px black;
}
.reviews {
position: relative;
}
.reviews-button {
padding: 0.4em;
cursor: pointer;
background-color: #B0B0B3;
color: white;
display: block;
text-align: center;
font-size: 1.4em;
font-style: italic;
transition: 1s;
text-shadow: 1px 1px 1px black;
}
.reviews-button:hover {
color: #E85522;
font-size: 1.5em;
text-shadow: 0.5px 0.5px 0.5px black;
}
.quote1 {
position: absolute;
bottom: 60%;
left: 14%;
text-shadow: 2px 2px 2px black;
}
.quote2 {
position: absolute;
bottom: 60%;
left: 48%;
text-shadow: 2px 2px 2px black;
}
.quote3 {
position: absolute;
bottom: 60%;
left: 80%;
text-shadow: 2px 2px 2px black;
}
/* Contact */
.contact {
padding: 4em;
border: 1px solid black;
background-color: #E85522;
color: white;
}
.contact-message {
float: left;
width: 60%;
padding: 1em;
text-align: center;
}
.contact-message p {
font-size: 3.8vw;
}
.contact-heading {
font-size: 3em;
text-shadow: 1px 1px 1px black;
padding: 0.3em;
font-family: 'Satisfy', cursive;
font-style: italic;
}
.contact-numbers {
float: left;
padding: 1em;
width: 31%;
text-align: center;
}
.contact-numbers p {
font-size: 2.8em;
}
/* Form */
form {
padding: 5em;
text-align: center;
}
.flex-form-container {
display: flex;
justify-content: space-around;
background-image: url(Images/maria-ziegler-jJnZg7vBfMs-unsplash.jpg);
background-size: cover;
background-position: center;
}
.form-left {
flex-basis: 50%;
}
.form-right {
flex-basis: 30%;
padding: 5em;
}
.form-right h3 {
color: white;
font-size: 3em;
text-shadow: 1px 1px 1px black;
text-align: center;
padding: 0.4em;
font-family: 'Satisfy', cursive;
font-style: italic;
}
.form-right p {
text-align: center;
font-size: 1.4em;
text-decoration: underline;
text-shadow: 0.5px 0.1px black;
font-style: italic;
}
.form-right p a {
color: #1A98BE;
}
.form-right p a:hover {
color: white;
text-shadow: 2px 1px 1px black;
}
input {
display: inline-block;
padding: 0.6em;
margin: 0.2em;
font-size: 1em;
border-radius: 5px;
}
input[type="submit"] {
color: #1A98BE;
transition: 0.5s;
cursor: pointer;
}
input[type="submit"]:hover {
color: #E85522;
font-size: 1.5em;
box-shadow: 1px 1px 1px 1px black;
}
textarea {
display: inline-block;
padding: 0.4em;
margin: 1em;
width: 373px;
font-size: 1.6em;
border-radius: 5px;
}
/* Footer */
footer {
border: 1px solid black;
text-align: center;
padding: 1em;
background-color: #B0B0B3;
color: white;
}
footer > * {
padding: 0.4em;
}
footer p a {
color: #E85522;
}
.fa {
padding: 1em;
transition: 1s;
color: #E85522;
}
.fa:hover {
color: white;
font-size: 25px;
}
https://codepen.io/jared-parsons/pen/LYGexBY?editors=1100

I think I found a solution:
html, body {
max-width: 100%;
overflow-x: hidden;
}
Got rid of the ugly whitespace and scroll bar.

As I understood from your question, that you having an issue with the dimension of the page. If this is the issue, have tried to use % or ration to indicate the dimension of the page or the layout?

Related

Mkdocs with material theme: extra css not working on mobile devices

I'm using Mkdocs with material theme for products documentation on my company. I'd made some customize on the original theme using the extra.css file.
When people navigate on my site on web browser it's working ok.
When they navigate on mobile devices, the extra.css is not working, or having a very strange behavior.
On the images of mobile devices, the left side is when I open the menu. The right side is when I click in a link in the menu.
Here is my extra.css file.
.md-header__button.md-logo :-webkit-any(img,svg) {
display: block;
width: auto;
height: 2rem;
fill: currentColor;
}
.md-nav--primary {
font-size: .75rem;
line-height: 1.5;
background-color: #0000cc;
border-color: #eee;
border-width: thin;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
padding-top: .6rem;
padding-bottom: .6rem;
}
.md-header {
background-color: #0000cc;
}
input.md-search__input {
width: 100%;
height: 1.8rem;
padding-left: 2.2rem;
font-size: .8rem;
opacity: 1;
background-color: rgba(0,0,0,1);
border-radius: 16px;
text-align: left;
letter-spacing: 0px;
color: #ffffff;
opacity: 1;
}
.md-search__input:hover {
background-color: rgba(0,0,0,1);
}
.md-search-result__teaser {
display: -webkit-box;
max-height: 2rem;
color: #00348b;
margin: .5em 0;
overflow: hidden;
font-size: .64rem;
line-height: 1.6;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
[data-md-toggle=search]:checked~.md-header .md-search__input {
text-overflow: clip;
background-color: var(--md-default-bg-color);
border-radius: .1rem .1rem 0 0;
color: #00348b;
}
.md-search-result__meta {
padding: 0 .8rem;
color: #00348b;
font-size: .64rem;
line-height: 1.8rem;
scroll-snap-align: start;
}
.md-nav--primary, .md-nav--secondary {
font-size: .75rem;
line-height: 1.5;
background-color: #eee;
-moz-border-radius: 8px;
border-radius: 8px;
padding-top: .6rem;
padding-bottom: .6rem;
background: #00348B 0% 0% no-repeat padding-box;
}
.md-nav__title {
display: block;
padding: 0 .6rem;
overflow: hidden;
font-weight: 700;
text-overflow: ellipsis;
color: #ffffff;
}
.md-nav__item .md-nav__link--active {
text-align: left;
font: normal normal normal 14px/18px Open Sans;
letter-spacing: 0.35px;
color: #FFFFFF;
opacity: 1;
}
.md-nav__item--nested>.md-nav__link {
color: #FFFFFF;
}
.md-nav__link {
display: block;
margin-top: .625em;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
transition: color 125ms;
scroll-snap-align: start;
text-align: left;
letter-spacing: 0.33px;
color: #FFFFFF;
opacity: 1;
}
.md-nav__link[data-md-state=blur] {
color: #d5d5d5;
}
.md-footer {
color: #FFFFFF;
background : #00348B 0% 0% no-repeat padding-box;
}
.md-float-right {
height: 100%;
margin: 430px 0 0 650px;
display: inline-block;
align-items: flex-end;
position: fixed;
}
p {
display: block;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
text-align: justify;
}

How to print page exactly how it looks on screen?

I'm creating a scheduling page through ASP.NET Web Forms using custom CSS. I have added a print button and would like it to print the page exactly how it looks on screen, however it's seems to be ignoring all my CSS when I go to print. How can I fix this?
My schedule layout:
How it currently prints:
My CSS:
.board-layout {
background-color: #173F5F;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
display: grid;
grid-gap: 6px;
padding: 6px;
width: 100%;
height: auto;
border-radius: 6px;
overflow: auto;
box-shadow: 0 3px 0 rgba(9,30,66,.25);
border: 3px solid black;
transition: all .2s ease-in-out;
}
.board-layout:hover {
/*transform: scale(1.005);*/
border: 3px solid lightgrey;
}
.list-layout {
display: grid;
grid-gap: 10px;
}
.board-text {
font-size: 14px;
padding: 6px;
color: #EEFBFB;
}
.board-lists {
display: grid;
grid-auto-columns: 13.9%;
grid-auto-flow: column;
grid-gap: 6px;
height: auto;
}
.crew-board-lists {
display: grid;
grid-auto-columns: 49.72%;
grid-auto-flow: column;
grid-gap: 6px;
height: auto;
font-weight: bold;
}
.Job-lists {
display: grid;
grid-auto-columns: auto;
grid-auto-flow: column;
grid-gap: 10px;
height: auto;
}
.board-list {
background-color: rgb(235, 236, 240);
border-radius: 4px;
display: grid;
grid-auto-rows: max-content;
grid-gap: 10px; /* Chrome use a fixed height */
min-height: 40px;
height: max-content;
padding: 6px;
cursor: pointer;
}
.day-board-list {
background-color: #EBEBEB;
border-radius: 4px;
display: grid;
grid-auto-rows: max-content;
grid-gap: 10px; /* Chrome use a fixed height */
min-height: 40px;
height: max-content;
padding: 6px;
cursor: pointer;
}
.day-board-list:hover, .crew-board-list:hover, .equipment-board-list:hover, .card:hover, .cardEmployee:hover, .cardEquipment:hover {
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
transform: scale(1.01);
border: 1px solid white;
}
.day-board-list, .crew-board-list, .equipment-board-list, .card, .cardEmployee, .cardEquipment {
transition: all .1s ease-in-out;
}
.DragHoverCustom {
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
transform: scale(1.01);
border: 1px solid white;
}
.date-list {
background-color: #EBEBEB;
border-radius: 4px;
display: grid;
grid-auto-rows: max-content;
grid-gap: 10px; /* Chrome use a fixed height */
height: auto;
padding: 4px;
text-align: center;
}
.crew-board-list {
background-color: #3C99DC;
border-radius: 4px;
display: grid;
grid-auto-rows: max-content;
grid-gap: 10px; /* Chrome use a fixed height */
height: max-content;
min-height: 34px;
padding: 6px;
cursor: pointer;
}
.equipment-board-list {
background-color: #70D1D0;
border-radius: 4px;
display: grid;
grid-auto-rows: max-content;
grid-gap: 10px; /* Chrome use a fixed height */
height: max-content;
min-height: 34px;
padding: 6px;
cursor: pointer;
}
.list-title {
font-size: 15px;
font-weight: bold;
}
.schedule-dates {
font-size: 18px;
font-weight: bold;
}
.card {
background-color: #EEFBFB;
border-radius: 4px;
box-shadow: 0 2px 0 rgba(9,30,66,.25);
padding: 2px;
cursor: pointer;
}
.cardEquipment {
background-color: #70D1D0;
border-radius: 4px;
box-shadow: 0 2px 0 rgba(9,30,66,.25);
padding: 2px;
cursor: pointer;
}
.cardEmployee {
background-color: #3C99DC;
border-radius: 4px;
box-shadow: 0 2px 0 rgba(9,30,66,.25);
padding: 2px;
cursor: pointer;
}
.tabs {
width: 100%;
height: 800px;
margin: 0 auto;
}
/* tab list item */
.tabs .tabs-list {
list-style: none;
margin: 0px;
padding: 0px;
}
.tabs .tabs-list li {
width: 30%;
float: left;
margin: 0px;
margin-right: 2px;
padding: 10px 5px;
text-align: center;
background-color: #173F5F;
border-radius: 4px;
}
.tabs .tabs-list li:hover {
cursor: pointer;
}
.tabs .tabs-list li a {
text-decoration: none;
color: white;
}
/* Tab content section */
.tabs .tab {
display: none;
width: 96%;
min-height: 200px;
height: auto;
border-radius: 4px;
padding: 20px 15px;
background-color: #EBEBEB;
clear: both;
}
.tabs .tab h3 {
border-bottom: 3px solid cornflowerblue;
letter-spacing: 1px;
font-weight: normal;
padding: 5px;
}
.tabs .tab p {
line-height: 20px;
letter-spacing: 1px;
}
/* When active state */
.active {
display: block !important;
}
.tabs .tabs-list li.active {
background-color: #EBEBEB !important;
color: black !important;
}
.active a {
color: black !important;
}
/* media query */
#media screen and (max-width:360px) {
.tabs {
margin: 0;
width: 96%;
}
.tabs .tabs-list li {
width: 80px;
}
}
/* Context menu */
.context-menu {
display: none;
position: absolute;
border: 1px solid black;
border-radius: 3px;
width: 200px;
background: white;
box-shadow: 10px 10px 10px black;
z-index: 10000;
}
.context-menu ul {
list-style: none;
padding: 2px;
}
.context-menu ul li {
padding: 5px 2px;
margin-bottom: 3px;
color: white;
font-weight: bold;
background-color: darkturquoise;
}
.context-menu ul li:hover {
cursor: pointer;
background-color: #7fffd4;
}
Normal CSS link on my page:
<link rel="stylesheet" href="Content/CustomCSS.css" type="text/css">
Just checked, and what I actually did was added media styles:
#media print {
* { color:#333; }
html { height:auto; }
h1:before { content:"Site Name - "; }
.pageTitle { font-size:20pt; }
#selectedTitleWrapper { text-align: left !important; }
.mainContentColumn { margin-bottom: 0; }
}
These styles are used on print and override existing styles. Experiment with a few. For ex, remove the scroll bar in your top row:
.container { overflow-x: hidden; } /* for example. */
I have found a solution called html2canvas which rebuilds any element or the entire page as an image. My JavaScript code ended up looking like this and produces a perfect copy of my schedule!
function customPrint() {
document.getElementById('scheduleArea').style.maxHeight = 'max-content';
html2canvas(document.querySelector("#scheduleArea")).then(canvas => {
document.body.appendChild(canvas)
}).then(() => {
let canvas = document.querySelector('canvas');
canvas.style.display = 'none';
let image = canvas.toDataURL("image/png");
let tWindow = window.open("");
$(tWindow.document.body)
.html("<img id='Image' src=" + image + " style='width:100%; height:auto;'></img>")
.ready(function () {
tWindow.focus();
tWindow.print();
});
document.getElementById('scheduleArea').style.maxHeight = '800px';
document.body.removeChild(canvas);
});
};

Change text hover

How change text when I push cursor in button? If I push cursor in button with price, will show text: "Add to basket".
This is Code:
body {
font-family: 'Roboto', sans-serif;
}
.price {
font-size: 1em;
border-radius: 50px;
background-color: #f00;
text-align: center;
color: #fff;
padding: 5px;
width: 10%;
margin: 20px auto;
}
.price:hover {
background-color: #fff;
border: 1px solid #bfbfbf;
color: #f00;
cursor: pointer;
}
.info {
display: none;
}
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"/>
<div class="price">$50</div>
<div class="info">Add to basket</div>
How solve this problem?
You can use a wrapper div to catch the over, I think is more maintainable if you change the html in the future:
body {
font-family: 'Roboto', sans-serif;
}
.price {
font-size: 1em;
border-radius: 50px;
background-color: #f00;
text-align: center;
color: #fff;
padding: 5px;
width: 10%;
margin: 20px auto;
}
.price:hover {
background-color: #fff;
border: 1px solid #bfbfbf;
color: #f00;
cursor: pointer;
}
.info {
display: none;
width: 20%;
margin: 20px auto;
cursor: pointer;
}
.wrapper:hover .info {
display: block;
}
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"/>
<div class="wrapper">
<div class="price">$50</div>
<div class="info">Add to basket</div>
</div>
you can use :active to show text when mouse is clicking down on the price like so:
.price {
font-size: 1em;
border-radius: 50px;
background-color: #f00;
text-align: center;
color: #fff;
padding: 5px;
width: 10%;
margin: 20px auto;
}
.price:hover {
background-color: #fff;
border: 1px solid #bfbfbf;
color: #f00;
cursor: pointer;
}
.info {
display: none;
}
.price:active + .info {
display: block;
}
<div class="price">$50</div>
<div class="info">Add to basket</div>
if you are trying to show the text on :hover like the title of the question says the unser :hover like so:
.price {
font-size: 1em;
border-radius: 50px;
background-color: #f00;
text-align: center;
color: #fff;
padding: 5px;
width: 10%;
margin: 20px auto;
}
.price:hover {
background-color: #fff;
border: 1px solid #bfbfbf;
color: #f00;
cursor: pointer;
}
.info {
display: none;
}
.price:hover + .info {
display: block;
}
<div class="price">$50</div>
<div class="info">Add to basket</div>
Update 3:
.price {
font-size: 1em;
border-radius: 50px;
background-color: #f00;
text-align: center;
color: #fff;
padding: 5px;
width: 10%;
margin: 20px auto;
}
.price:hover {
background-color: #fff;
border: 1px solid #bfbfbf;
color: #f00;
cursor: pointer;
}
.info,
.price:hover .amount {
display: none;
}
.price:hover .info {
display: block;
}
<div class="price">
<div class="amount">$50</div>
<div class="info">Add to basket</div>
</div>

flex box parent wrappers do not fill height of the page

Here is my JSFiddle...https://jsfiddle.net/5xt7pt7f/
I get that there is a lot going on here, I will try to isolate my issue as best as possible.
There are two parent wrappers...
<div class="video-section">
...
<div class="chat-section">
As you can see in the fiddle, their height is not 100%, it seems to have some sort of max-height because they do not always fill the page. My html structure is something like...
<div id="app">
...
<div class="chat-navbar">....</div>
<div class="chat-wrapper">
<div class="video-section">
<div class="chat-section">
...
#app is the main container. I want .chat-navbar to be at the top and the .chat-wrapper to be below it. I accomplished this through...
div#app {
display: flex;
flex: 1;
flex-direction: column; }
Next I wanted .video-section and .chat-section to be side by side, I accomplished this through...
.chat-wrapper {
display: flex;
flex: 1;
flex-direction: row;
}
However, these two wrappers do not fill the height of the page. I do not care if the canvas elements inside fill the page, but I do need the parent wrappers to fill up the page.
This is what it look like on my local...
As you can see there is a lot of white space at the bottom because the elements do not have full height. I thought flex:1 would have resolved this.
Try using display:flex; on the div containing chat-navbar and chat-wrapper (I gave it id="chatcon") and then use flex-grow:1; on chat-wrapper. I commented one of the canvases and changed navbar color to red, to help notice the difference.
Here's a codepen
body, html {
margin: 0;
font-family: 'Libre Baskerville', serif; }
#chatcon{
min-height:100vh;
display:flex;
flex-direction:column;
}
a {
text-decoration: none;
margin: 5px; }
a:active, a:visited {
color: inherit; }
.chat-wrapper {
display: flex;
flex: 1;
flex-direction: row;
}
.chat-section {
border: none;
border-left: 1px solid #ccc;
box-sizing: border-box;
padding-left: 0.5em;
display: flex;
flex: 1;
flex-direction: column;
margin-left: 5px; }
div#app {
display: flex;
flex: 1;
flex-direction: column; }
.chat-section ul {
overflow-y: auto;
flex: 1;
margin-bottom: 0;
padding-left: 0.5em; }
.chat-section ul li {
text-decoration: none;
list-style-type: none; }
.chat-section ul li + li {
margin-top: 7px; }
.chat-section textarea {
resize: none;
border: none;
border-top: 1px solid #ccc;
box-sizing: border-box;
margin-left: -0.5em; }
.chat-section textarea:focus {
outline: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none; }
.video-section {
display: flex;
flex: 1;
text-align: center; }
.videos {
flex: 1;
display: flex;
max-width: 800px;
flex-direction: column;
align-content: stretch; }
.chat-navbar {
border-left: 1px solid #ccc;
box-sizing: border-box;
padding-top: 1em;
display: flex;
flex: 1; }
.localCanvas, .remoteCanvas {
background-color: black;
margin-left: 5px;
margin-right: 5px;
-webkit-box-shadow: 9px 5px 17px -6px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 9px 5px 17px -6px rgba(0, 0, 0, 0.75);
box-shadow: 9px 5px 17px -6px rgba(0, 0, 0, 0.75); }
.localCanvas {
margin-top: 5px;
margin-bottom: 5px; }
canvas.remoteCanvas {
margin-top: 5px; }
.auth-container {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
flex-direction: column;
background: #004FF9;
/* For browsers that do not support gradients */
background: -webkit-linear-gradient(to right, #FFF94C, #004FF9);
/* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(to right, #FFF94C, #004FF9);
/* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(to right, #FFF94C, #004FF9);
/* For Firefox 3.6 to 15 */
background: linear-gradient(to right, #FFF94C, #004FF9);
/* Standard syntax */
background-size: cover; }
.loginForm, .registerForm {
width: 500px;
height: 600px;
display: block;
margin-left: auto;
margin-right: auto;
position: absolute;
top: 130px;
left: 0;
right: 0; }
.loginWrap {
width: 500px;
float: left;
height: 100%;
background: rgba(255, 255, 255, 0.75);
-webkit-box-shadow: 4px 3px 14px -5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 4px 3px 14px -5px rgba(0, 0, 0, 0.75);
box-shadow: 4px 3px 14px -5px rgba(0, 0, 0, 0.75); }
.bodyLogin {
overflow: hidden;
height: 100%; }
.bg_image {
height: 1000px;
width: 100%; }
h1 {
font-family: 'Roboto', sans-serif;
color: #87909c;
font-weight: bolder;
text-align: center;
font-size: 1.5em;
margin-top: 20px; }
img.logo_image {
width: 500px; }
img.title_image {
width: 200px;
margin-left: auto;
display: block;
margin-right: auto;
margin-top: -90px; }
label {
font-size: 12px;
font-weight: bold;
color: #87909c;
float: left;
clear: both;
font-family: 'Roboto', sans-serif;
margin-left: 30px;
margin-top: 15px; }
input[type="text"], input[type="password"] {
float: left;
margin-top: 15px;
clear: both;
margin-left: 30px;
font-size: 1.3em;
width: 80%;
outline: none;
border: none;
padding: 10px;
padding-left: 10px; }
.login_btn, .register_btn {
float: left;
clear: left;
font-family: 'Roboto', sans-serif;
background: #7289da;
border: solid 1px #7289da;
width: 84%;
margin-left: 30px;
margin-top: 50px;
padding: 20px;
border-radius: 5px;
font-size: 1em;
color: white;
cursor: pointer; }
.registerLinkWrap, .loginLinkWrap {
float: left;
clear: left;
margin-left: 30px; }
a.register_link, a.login_link {
float: left;
margin-top: 11px;
font-size: 13px;
color: black;
font-family: 'Roboto', sans-serif; }
a.register_link:hover, a.login_link:hover {
text-decoration: underline; }
p.register_sentence, p.login_sentence {
clear: left;
float: left;
font-size: 12px;
color: #3e4956;
font-family: 'Roboto', sans-serif; }
.errUsername, .errPassword, .errRegister {
float: left;
margin-left: 30px;
margin-top: 3px;
color: red;
font-size: 0.8em;
font-family: 'Roboto', sans-serif; }
.reg_success {
position: absolute;
background: #f2fae3;
width: 100%;
text-align: center;
padding: 10px;
font-family: 'Roboto', sans-serif;
color: #94b639;
border-bottom: solid 3px #94b639; }
.reg_neutral {
display: none; }
/*# sourceMappingURL=styles.css.map*/
.chat-navbar{
flex-shrink:0;
flex-grow:0;
height:70px;
background-color:red;
}
<div id="app">
<div id="chatcon" data-reactroot="">
<div class="chat-navbar">
Logout
</div>
<div class="chat-wrapper">
<div class="video-section">
<div class="videos">
<canvas class="remoteCanvas" width="320" height="240"></canvas>
<!-- <canvas class="localCanvas" width="320" height="240"></canvas> -->
</div>
</div>
<div class="chat-section">
<ul>No messages</ul>
<textarea placeholder="Type a message" rows="2"></textarea>
</div>
</div></div></div>
To simplify your requirement, add relative heights wherever required so that your wrappers occupy the entirety of the page.
Give html, body { height: 100%; } which resolves the majority of issues and then further on.
Created a fiddle for you: https://jsfiddle.net/nashcheez/u7bmL0nm/
body,
html {
margin: 0;
font-family: 'Libre Baskerville', serif;
height: 100%;
}
a {
text-decoration: none;
margin: 5px;
}
a:active,
a:visited {
color: inherit;
}
.chat-wrapper {
display: flex;
flex: 1;
flex-direction: row;
height: 100%;
}
.chat-section {
border: none;
border-left: 1px solid #ccc;
box-sizing: border-box;
padding-left: 0.5em;
display: flex;
flex: 1;
flex-direction: column;
margin-left: 5px;
}
div#app {
display: flex;
flex: 1;
flex-direction: column;
height: 100%;
}
.chat-section ul {
overflow-y: auto;
flex: 1;
margin-bottom: 0;
padding-left: 0.5em;
}
.chat-section ul li {
text-decoration: none;
list-style-type: none;
}
.chat-section ul li + li {
margin-top: 7px;
}
.chat-section textarea {
resize: none;
border: none;
border-top: 1px solid #ccc;
box-sizing: border-box;
margin-left: -0.5em;
}
.chat-section textarea:focus {
outline: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.video-section {
display: flex;
flex: 1;
text-align: center;
}
.videos {
flex: 1;
display: flex;
max-width: 800px;
flex-direction: column;
align-content: stretch;
}
.chat-navbar {
border-left: 1px solid #ccc;
box-sizing: border-box;
padding-top: 1em;
display: flex;
flex: 1;
}
.localCanvas,
.remoteCanvas {
background-color: black;
margin-left: 5px;
margin-right: 5px;
-webkit-box-shadow: 9px 5px 17px -6px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 9px 5px 17px -6px rgba(0, 0, 0, 0.75);
box-shadow: 9px 5px 17px -6px rgba(0, 0, 0, 0.75);
height: 50%;
}
.localCanvas {
margin-top: 5px;
margin-bottom: 5px;
}
canvas.remoteCanvas {
margin-top: 5px;
}
.auth-container {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
flex-direction: column;
background: #004FF9;
/* For browsers that do not support gradients */
background: -webkit-linear-gradient(to right, #FFF94C, #004FF9);
/* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(to right, #FFF94C, #004FF9);
/* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(to right, #FFF94C, #004FF9);
/* For Firefox 3.6 to 15 */
background: linear-gradient(to right, #FFF94C, #004FF9);
/* Standard syntax */
background-size: cover;
}
.loginForm,
.registerForm {
width: 500px;
height: 600px;
display: block;
margin-left: auto;
margin-right: auto;
position: absolute;
top: 130px;
left: 0;
right: 0;
}
.loginWrap {
width: 500px;
float: left;
height: 100%;
background: rgba(255, 255, 255, 0.75);
-webkit-box-shadow: 4px 3px 14px -5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 4px 3px 14px -5px rgba(0, 0, 0, 0.75);
box-shadow: 4px 3px 14px -5px rgba(0, 0, 0, 0.75);
}
.bodyLogin {
overflow: hidden;
height: 100%;
}
.bg_image {
height: 1000px;
width: 100%;
}
h1 {
font-family: 'Roboto', sans-serif;
color: #87909c;
font-weight: bolder;
text-align: center;
font-size: 1.5em;
margin-top: 20px;
}
img.logo_image {
width: 500px;
}
img.title_image {
width: 200px;
margin-left: auto;
display: block;
margin-right: auto;
margin-top: -90px;
}
label {
font-size: 12px;
font-weight: bold;
color: #87909c;
float: left;
clear: both;
font-family: 'Roboto', sans-serif;
margin-left: 30px;
margin-top: 15px;
}
input[type="text"],
input[type="password"] {
float: left;
margin-top: 15px;
clear: both;
margin-left: 30px;
font-size: 1.3em;
width: 80%;
outline: none;
border: none;
padding: 10px;
padding-left: 10px;
}
.login_btn,
.register_btn {
float: left;
clear: left;
font-family: 'Roboto', sans-serif;
background: #7289da;
border: solid 1px #7289da;
width: 84%;
margin-left: 30px;
margin-top: 50px;
padding: 20px;
border-radius: 5px;
font-size: 1em;
color: white;
cursor: pointer;
}
.registerLinkWrap,
.loginLinkWrap {
float: left;
clear: left;
margin-left: 30px;
}
a.register_link,
a.login_link {
float: left;
margin-top: 11px;
font-size: 13px;
color: black;
font-family: 'Roboto', sans-serif;
}
a.register_link:hover,
a.login_link:hover {
text-decoration: underline;
}
p.register_sentence,
p.login_sentence {
clear: left;
float: left;
font-size: 12px;
color: #3e4956;
font-family: 'Roboto', sans-serif;
}
.errUsername,
.errPassword,
.errRegister {
float: left;
margin-left: 30px;
margin-top: 3px;
color: red;
font-size: 0.8em;
font-family: 'Roboto', sans-serif;
}
.reg_success {
position: absolute;
background: #f2fae3;
width: 100%;
text-align: center;
padding: 10px;
font-family: 'Roboto', sans-serif;
color: #94b639;
border-bottom: solid 3px #94b639;
}
.reg_neutral {
display: none;
}
<div id="app">
<div style="height: 100%;" data-reactroot="">
<div class="chat-navbar">
Logout
</div>
<div class="chat-wrapper">
<div class="video-section">
<div class="videos">
<canvas class="remoteCanvas" width="320" height="240"></canvas>
<canvas class="localCanvas" width="320" height="240"></canvas>
</div>
</div>
<div class="chat-section">
<ul>No messages</ul>
<textarea placeholder="Type a message" rows="2"></textarea>
</div>
</div>
</div>
</div>
I see that you gave div#app both display: flex and flex: 1. Do note that the flex: 1 does not do anything here, it is a flex child property.
So for div#app to fill page it need a height, here given min-height: 100vh. Now you can give for example the <div data-reactroot> element flex: 1 to fill its parent (light blue).
Any child having a parent with display: flex; flex-direction: column only need flex: 1 to fill vertical space, if it has flex-direction: row it will need a height, where height: 100% normally work.
These 2 rules shows how to
div#app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
div[data-reactroot] {
flex: 1;
background: lightblue;
}
Hope this makes it clear how it works, and from here you can apply the same logic your way down in the markup.
body,
html {
margin: 0;
font-family: 'Libre Baskerville', serif;
}
a {
text-decoration: none;
margin: 5px;
}
a:active,
a:visited {
color: inherit;
}
.chat-wrapper {
display: flex;
flex: 1;
flex-direction: row;
}
.chat-section {
border: none;
border-left: 1px solid #ccc;
box-sizing: border-box;
padding-left: 0.5em;
display: flex;
flex: 1;
flex-direction: column;
margin-left: 5px;
}
div#app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
div[data-reactroot] {
flex: 1;
background: lightblue;
}
.chat-section ul {
overflow-y: auto;
flex: 1;
margin-bottom: 0;
padding-left: 0.5em;
}
.chat-section ul li {
text-decoration: none;
list-style-type: none;
}
.chat-section ul li + li {
margin-top: 7px;
}
.chat-section textarea {
resize: none;
border: none;
border-top: 1px solid #ccc;
box-sizing: border-box;
margin-left: -0.5em;
}
.chat-section textarea:focus {
outline: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.video-section {
display: flex;
flex: 1;
text-align: center;
}
.videos {
flex: 1;
display: flex;
max-width: 800px;
flex-direction: column;
align-content: stretch;
}
.chat-navbar {
border-left: 1px solid #ccc;
box-sizing: border-box;
padding-top: 1em;
display: flex;
flex: 1;
}
.localCanvas,
.remoteCanvas {
background-color: black;
margin-left: 5px;
margin-right: 5px;
-webkit-box-shadow: 9px 5px 17px -6px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 9px 5px 17px -6px rgba(0, 0, 0, 0.75);
box-shadow: 9px 5px 17px -6px rgba(0, 0, 0, 0.75);
}
.localCanvas {
margin-top: 5px;
margin-bottom: 5px;
}
canvas.remoteCanvas {
margin-top: 5px;
}
.auth-container {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
flex-direction: column;
background: #004FF9;
/* For browsers that do not support gradients */
background: -webkit-linear-gradient(to right, #FFF94C, #004FF9);
/* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(to right, #FFF94C, #004FF9);
/* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(to right, #FFF94C, #004FF9);
/* For Firefox 3.6 to 15 */
background: linear-gradient(to right, #FFF94C, #004FF9);
/* Standard syntax */
background-size: cover;
}
.loginForm,
.registerForm {
width: 500px;
height: 600px;
display: block;
margin-left: auto;
margin-right: auto;
position: absolute;
top: 130px;
left: 0;
right: 0;
}
.loginWrap {
width: 500px;
float: left;
height: 100%;
background: rgba(255, 255, 255, 0.75);
-webkit-box-shadow: 4px 3px 14px -5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 4px 3px 14px -5px rgba(0, 0, 0, 0.75);
box-shadow: 4px 3px 14px -5px rgba(0, 0, 0, 0.75);
}
.bodyLogin {
overflow: hidden;
height: 100%;
}
.bg_image {
height: 1000px;
width: 100%;
}
h1 {
font-family: 'Roboto', sans-serif;
color: #87909c;
font-weight: bolder;
text-align: center;
font-size: 1.5em;
margin-top: 20px;
}
img.logo_image {
width: 500px;
}
img.title_image {
width: 200px;
margin-left: auto;
display: block;
margin-right: auto;
margin-top: -90px;
}
label {
font-size: 12px;
font-weight: bold;
color: #87909c;
float: left;
clear: both;
font-family: 'Roboto', sans-serif;
margin-left: 30px;
margin-top: 15px;
}
input[type="text"],
input[type="password"] {
float: left;
margin-top: 15px;
clear: both;
margin-left: 30px;
font-size: 1.3em;
width: 80%;
outline: none;
border: none;
padding: 10px;
padding-left: 10px;
}
.login_btn,
.register_btn {
float: left;
clear: left;
font-family: 'Roboto', sans-serif;
background: #7289da;
border: solid 1px #7289da;
width: 84%;
margin-left: 30px;
margin-top: 50px;
padding: 20px;
border-radius: 5px;
font-size: 1em;
color: white;
cursor: pointer;
}
.registerLinkWrap,
.loginLinkWrap {
float: left;
clear: left;
margin-left: 30px;
}
a.register_link,
a.login_link {
float: left;
margin-top: 11px;
font-size: 13px;
color: black;
font-family: 'Roboto', sans-serif;
}
a.register_link:hover,
a.login_link:hover {
text-decoration: underline;
}
p.register_sentence,
p.login_sentence {
clear: left;
float: left;
font-size: 12px;
color: #3e4956;
font-family: 'Roboto', sans-serif;
}
.errUsername,
.errPassword,
.errRegister {
float: left;
margin-left: 30px;
margin-top: 3px;
color: red;
font-size: 0.8em;
font-family: 'Roboto', sans-serif;
}
.reg_success {
position: absolute;
background: #f2fae3;
width: 100%;
text-align: center;
padding: 10px;
font-family: 'Roboto', sans-serif;
color: #94b639;
border-bottom: solid 3px #94b639;
}
.reg_neutral {
display: none;
}
/*# sourceMappingURL=styles.css.map*/
<div id="app">
<div data-reactroot="">
<div class="chat-navbar">
Logout
</div>
<div class="chat-wrapper">
<div class="video-section">
<div class="videos">
<canvas class="remoteCanvas" width="320" height="240"></canvas>
<canvas class="localCanvas" width="320" height="240"></canvas>
</div>
</div>
<div class="chat-section">
<ul>No messages</ul>
<textarea placeholder="Type a message" rows="2"></textarea>
</div>
</div>
</div>
</div>

Button result not as desired

Why is it that when I test my page out on Chrome Canary emulating the iPad I get this result,
But when testing it out on the real device I get this
I'm trying to achieve the top one, but can't for some reason. Any ideas? Also is Chrome Canary reliable? Here's the CSS
#import url(http://fonts.googleapis.com/css?family=Open+Sans:300);
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #fff;
color: #7b8993;
font: 300 87.5%/1.5em 'Open Sans', sans-serif;
}
.form-wrapper {
padding-top: 10%;
border-radius: 2px;
margin: 50px auto;
position: relative;
width: 375px;
}
form {
padding: 30px 20px 0;
}
.form-item {
margin-bottom: 10px;
width: 100%;
}
.form-item input {
border: 1px solid #ccc;
border-radius: 2px;
color: #000;
font-family: 'Open Sans', sans-serif;
font-size: 1em;
height: 50px;
padding: 0 16px;
transition: background 0.3s ease-in-out;
width: 100%;
}
.form-item input:focus {
outline: none;
border-color: #9ecaed;
box-shadow: 0 0 10px #9ecaed;
}
.button-panel {
margin: 20px 0 0;
width: 100%;
}
.button-panel .button {
background: #009dff;
border: none;
border-radius: 2px;
color: #fff;
cursor: pointer;
height: 50px;
font-family: 'Open Sans', sans-serif;
font-size: 1.2em;
letter-spacing: 0.05em;
text-align: center;
text-transform: uppercase;
transition: background 0.3s ease-in-out;
width: 100%;
}
.button:hover {
background: #00c8ff;
}
#media only screen
and (max-width : 320px) {
.form-wrapper {
padding-top: 10%;
border-radius: 2px;
margin: 50px auto;
position: relative;
width: 320px;
}
}
.cent {
text-align: center;
color: #000;
}
.view {
text-align: center;
text-decoration: none;
color: #7b8993;
padding-top: 5px;
}
#ref {
text-align: center;
text-decoration: none;
color: #7b8993;
padding-top: 8px;
font-size: 16px;
}
#ref:hover {
text-align: center;
text-decoration: none;
color: #009dff;
-webkit-animation: hue 60s infinite linear;
padding-top: 8px;
font-size: 16px;
}
You need to add the following to the button element in order to remove the default styling.
-webkit-appearance: none;

Resources