shrinking set of buttons when minimizing page css - html - html

I have a set of buttons in html:
<div class="controls">
<div id="s-controls">
<button class="control-btn" style="background-color: #2de7f6">1</button>
<button class="control-btn" style="background-color: #69a6ea">2</button>
<button class="control-btn" style="background-color: #736ace">3</button>
<button class="control-btn" style="background-color: #372ac3">4</button>
</div>
</div>
that I want to shrink when minimizing the page. Right now when doing that, the buttons mantain their size and the design looks messy.
I have tried many things with css but I am not really good at it. This is what I have so far:
.controls {
background-color: #1F1F1F;
min-height: 50px;
}
button {
margin: 20px auto;
max-width: 100%;
}
#s-controls, #p-controls {
text-align: center;
}
#s-controls > *, #p-controls > * {
font-family: "Titillium Web", sans-serif;
font-weight: 600;
color: white;
cursor: pointer;
}
.control-btn {
display: inline-block;
/*border-radius: 4px;*/
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
line-height: 2.5em;
padding: 0 3em;
text-decoration: none;
}
line-height: 1.75em;
padding: 0 0.75em;
}
.control-btn:hover {
box-shadow: inset 0 1px 1px rgba(255,255,255,0.5),
inset 0 1.5em 1em rgba(255,255,255,0.3);
}
I intend to do this in pure html and css. The idea is to shrink the buttons at some point that they mantain the original one row design.
Any help would be appreciatted!

Try setting a width for the all of the containers (#s-controls, div.controls), and setting the actual width for the buttons, not just the max-width.
div.controls { width: 100%; }
#s-controls { width: 100%; }
button { width: 100%; max-width: 100%; }

Using media queries will give you the manipulation you are looking for at different devices and/or shrinking your browser.
Do this for all widths you are looking for and adjust the padding accordingly:
#media (max-width:991px){ //change this number to 768px, 560px, 480px, etc
.control-btn {
padding: 0 2em;
}
}

For different devices alignments you can use media query. For example for mobile width I have added button {width: 100% !important;} so that it will not collapse..
Please let me know if you are not looking for this
#media screen and (max-width: 480px) {
button {
padding: 0 2em !important;
}
}
controls {
background-color: #1F1F1F;
min-height: 50px;
}
button {
margin: 20px auto;
max-width: 100%;
}
#s-controls, #p-controls {
text-align: center;
}
#s-controls > *, #p-controls > * {
font-family: "Titillium Web", sans-serif;
font-weight: 600;
color: white;
cursor: pointer;
}
.control-btn {
display: inline-block;
/*border-radius: 4px;*/
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
line-height: 2.5em;
padding: 0 3em;
text-decoration: none;
}
line-height: 1.75em;
padding: 0 0.75em;
}
.control-btn:hover {
box-shadow: inset 0 1px 1px rgba(255,255,255,0.5),
inset 0 1.5em 1em rgba(255,255,255,0.3);
}
<div class="controls">
<div id="s-controls">
<button class="control-btn" style="background-color: #2de7f6">1</button>
<button class="control-btn" style="background-color: #69a6ea">2</button>
<button class="control-btn" style="background-color: #736ace">3</button>
<button class="control-btn" style="background-color: #372ac3">4</button>
</div>
</div>
.

What you want is to add nowrap to the container for buttons:
#s-controls { white-space: nowrap; }
but you also need to define button width:
.control-btn {
max-width: 90px;
width: 24%;
}
You can play with those values to fine-tune them.
Also, you have an extra closing curly bracket in .control-btn that messes up the code. Delete it.
padding: 0 3em;
text-decoration: none;
/* } extra bracket */
line-height: 1.75em;
padding: 0 0.75em;
See it in the fiddle

Related

How to show the breadcrumbs in a single line in wordpress?

I have a code in php to show the breadcrumb it outputs like this
the link i found the php code
output
<div id="crumbs">Home » About The Tests » <span class="current">Page Image Alignment</span></div>
and it looks like this
#crumbs a,
#crumbs span {
border-radius: 0px 10px 10px 0px;
box-shadow: -3px 2px 18px -3px #000;
background: #4489ff;
width: max-content;
display: inline-block;
color: white;
font-size: 17px;
padding: 6px;
font-weight: bolder;
margin-left: -1px;
margin-top: 1rem;
text-decoration: none;
}
#crumbs span.current{
background: #eef5ff !important;
color: black !important;
}
<center>
<!-- Do Not use <center> tag ! !-->
<div id="crumbs">Home About The Tests <span class="current">Page Image Alignment</span></div>
<!-- Do Not use </center> tag ! !-->
</center>
i want to make the breadcrumbs a single line and fancy like this .
i have made 90% percent of it but i don't know how to show the box shadow like the image down
Please tell how to. thanks for your help !
image desktop
image mobile
EDIT: I removed the absolute positioning method, centered it and made it responsive.
.crumbswrapper {text-align: center;}
#crumbs {
text-align: left;
display: inline-block;
font-family: roboto;
font-weight: 400;
letter-spacing: 1px;
text-transform: uppercase;
font-size: 12px;
}
.innerwrap {
display: inline-block;
background:#4489ff;
padding-right: 10px;
margin: 0 0 0 -5px;
}
.innerwrap:last-child {
background: none;
}
.innerwrap:nth-last-child(2) {
background: #eef5ff;
}
#crumbs a, #crumbs span {
background:#4489ff;
border-radius: 0 20px 20px 0;
box-shadow: 5px 0 10px -4px #444;
color: white;
padding: 10px 25px 10px 20px;
text-decoration: none;
white-space: nowrap;
line-height: 34px;
}
.innerwrap:nth-last-child(2) a {
box-shadow: none!important;
}
#crumbs span.current{
background: #eef5ff !important;
box-shadow: none!important;
white-space: nowrap;
color: #4489ff!important;
}
<div class="crumbswrapper">
<div id="crumbs">
<div class="innerwrap">Home</div>
<div class="innerwrap">About The Tests</div>
<div class="innerwrap"><span class="current">Page Image Alignment</span></div>
</div>
</div>

set fixed spacing for flexbox list

i noticed that on my firefox the distance between the bottom of the website and the list for links(terms,about...) is really large, i cannot seem to figure out what to specify in my .ul style to adjust the spacing. i am using firefox. The mobile view is okay, i haven't checked it on my phone, i just used devtools.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>Home - Brand</title>
<link rel="stylesheet" href="css/navr.css">
<link href="https://fonts.googleapis.com/css2?family=Montserrat&family=Roboto&display=swap" rel="stylesheet">
</head>
<body>
<header>
<span class="iconify" data-inline="false" data-icon="eva:arrow-back-fill" style="color: #63ba86; font-size: 24px; padding-top: 10px;">
</span>
<h1>Forgot password</h1>
</header>
<div class="line"></div>
<h1 class="big">Change your password</h1>
<h1 class="cer">Confirm your email address</h1>
<form action="#" class="formstyle" style="padding-top:10px;padding-left: 10px">
<input type=" text " placeholder="Enter your email address" required>
<li class="btnn"><button type="submit" class="conf">Confirm</button></li>
</form>
<footer class="cl">
<div class="liner"></div>
<ul>
<li>
Terms
Privacy
About
</li>
</ul>
</footer>
</div>
</body>
<script src="https://code.iconify.design/1/1.0.6/iconify.min.js "></script>
</html>
My css
body {
background-color: #FFFFFF;
margin: 0;
}
#media screen and (max-width: 30em) {
.line {
width: auto;
height: 0px;
border: 1px solid #E5E5E5;
}
.liner {
width: auto;
height: 0px;
border: 1px solid #E5E5E5;
}
header {
display: flex;
}
h1.cer {
font-style: normal;
font-weight: 300;
font-size: 12px;
line-height: 10px;
color: #356B51;
padding-left: 10px;
}
h1.big {
font-style: normal;
font-weight: 500;
font-size: 20px;
line-height: 29px;
color: #63BA86;
padding-left: 10px;
}
h1 {
font-family: Montserrat;
font-style: normal;
font-weight: 500;
font-size: 18px;
line-height: 22px;
color: #63BA86;
padding-left: 70px;
margin-top: 10px;
}
a {
font-family: Montserrat;
font-style: normal;
font-weight: 500;
font-size: 14px;
line-height: 17px;
color: #63BA86;
text-decoration: none;
margin: 4px;
}
ul {
display: flex;
justify-content: flex-end;
text-decoration: none;
list-style: none;
}
h2 {
font-family: Montserrat;
font-style: normal;
font-weight: 500;
font-size: 18px;
line-height: 29px;
color: #63BA86;
padding-left: 10px;
}
input {
width: 300px;
height: 35px;
border: 0.5px solid #63BA86;
border-radius: 5px;
font-family: Montserrat;
padding-left: 5px;
}
input:required {
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05), 0px -4px 4px rgba(0, 0, 0, 0.05);
}
/* ::-webkit-input-placeholder {
text-align: center;
}
input::-moz-placeholder {
margin-left: 5px;
}
input:-moz-placeholder {
padding-left: 40px;
} */
button {
margin-top: 10px;
height: 25px;
width: 87px;
border: 0.5px solid #63BA86;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05), 0px -4px 4px rgba(0, 0, 0, 0.05);
border-radius: 4px;
}
button.conf {
font-family: Montserrat;
font-style: normal;
font-weight: bold;
font-size: 12px;
line-height: 17px;
color: #FFFFFF;
background-color: #67E298;
}
footer.cl {
padding-top: 400px;
}
main {
flex: 1;
}
li.btnn {
list-style: none;
}
}
#media screen and (min-width: 30em) {
.line {
width: auto;
height: 0px;
border: 1px solid #E5E5E5;
}
header {
display: flex;
}
h1 {
font-family: Montserrat;
font-style: normal;
font-weight: 500;
font-size: 18px;
line-height: 22px;
color: #63BA86;
margin-top: 10px;
padding-left: 500px;
}
h1.cer {
font-style: normal;
font-weight: 300;
font-size: 12px;
line-height: 10px;
color: #356B51;
padding-left: 460px;
}
h1.big {
font-style: normal;
font-weight: 500;
font-size: 40px;
line-height: 29px;
color: #63BA86;
padding-top: 200px;
padding-left: 450px;
}
li.btnn {
list-style: none;
display: block;
padding-left: 440px;
}
a {
font-family: Montserrat;
font-style: normal;
font-weight: 500;
font-size: 14px;
line-height: 17px;
color: #63BA86;
text-decoration: none;
margin: 1rem;
}
ul {
display: flex;
justify-content: flex-end;
text-decoration: none;
padding-left: 10rem;
list-style: none;
}
li {
text-align: left;
margin: 10px;
}
link {
margin: 10px;
font-size: large;
}
input {
width: 300px;
height: 35px;
border: 0.5px solid #63BA86;
border-radius: 5px;
font-family: Montserrat;
padding-left: 5px;
margin-left: 450px;
}
input:required {
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05), 0px -4px 4px rgba(0, 0, 0, 0.05);
}
/* ::-webkit-input-placeholder {
text-align: center;
}
input::-moz-placeholder {
margin-left: 5px;
}
input:-moz-placeholder {
padding-left: 40px;
} */
button {
margin-top: 10px;
height: 25px;
width: 87px;
border: 0.5px solid #63BA86;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05), 0px -4px 4px rgba(0, 0, 0, 0.05);
border-radius: 4px;
}
button.conf {
font-family: Montserrat;
font-style: normal;
font-weight: bold;
font-size: 12px;
line-height: 17px;
color: #FFFFFF;
background-color: #67E298;
}
.liner {
width: auto;
height: 0px;
border: 1px solid #E5E5E5;
margin-top: 40px;
}
}
i noticed that on my firefox the distance between the bottom of the
website and the list for links(terms,about...) is really large
This is the nature of the webpage you have created because the content only goes as far as that height. In order for your footer element to stay at the bottom: I recommend utilizing Flexbox & setting margin-top: auto to your footer. In order for the margin to kick in, simply give your container (in this case, .body) the flex display property & a minimum height of 100vh (so that it takes at least 100% of the viewport in terms of height) and assign column as it's flex-direction. This way, the footer can always stay at the bottom on your given layout.
body {
display: flex;
flex-flow: column;
min-height: 100vh;
}
footer.cl {
margin-top: auto;
}
I have made a few changes in your code. hope this will help you.
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>Home - Brand</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Montserrat&family=Roboto&display=swap" rel="stylesheet">
</head>
<body>
<div class="container">
<header>
<span class="iconify" data-inline="false" data-icon="eva:arrow-back-fill"
style="color: #63ba86; font-size: 24px; padding-top: 10px;">
</span>
<h1>Forgot password</h1>
<div class="dummy"></div>
</header>
<div class="content">
<h1 class="big">Change your password</h1>
<h1 class="cer">Confirm your email address</h1>
<form action="#" class="formstyle" style="padding-top:10px;padding-left: 10px">
<input type=" text " placeholder="Enter your email address" required>
<div class="btnn"><button type="submit" class="conf">Confirm</button></div>
</form>
</div>
<footer class="cl">
<div class="liner"></div>
<ul>
<li>
Terms
Privacy
About
</li>
</ul>
</footer>
</div>
</body>
<script src="https://code.iconify.design/1/1.0.6/iconify.min.js "></script>
</html>
CSS:
body {
background-color: #FFFFFF;
margin: 0;
}
.container {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-between;
}
header {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #E5E5E5;
}
h1 {
font-family: Montserrat;
font-style: normal;
font-weight: 500;
color: #63BA86;
}
h1.big {
font-style: normal;
font-weight: 500;
color: #63BA86;
text-align: center;
}
h1.cer {
font-style: normal;
font-weight: 300;
color: #356B51;
text-align: center;
}
h2 {
font-family: Montserrat;
font-style: normal;
font-weight: 500;
color: #63BA86;
}
form {
margin: auto;
text-align: center;
}
input {
width: 300px;
height: 35px;
border: 0.5px solid #63BA86;
border-radius: 5px;
font-family: Montserrat;
padding-left: 5px;
}
input:required {
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05), 0px -4px 4px rgba(0, 0, 0, 0.05);
}
button {
margin-top: 10px;
padding: 10px 35px;
border: 0.5px solid #63BA86;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05), 0px -4px 4px rgba(0, 0, 0, 0.05);
border-radius: 4px;
}
.btnn {
text-align: center;
}
button.conf {
font-family: Montserrat;
font-style: normal;
font-weight: bold;
color: #FFFFFF;
background-color: #67E298;
}
ul {
display: flex;
justify-content: flex-end;
text-decoration: none;
list-style: none;
}
li {
text-align: left;
margin: 10px;
}
link {
margin: 10px;
font-size: large;
}
a {
font-family: Montserrat;
font-style: normal;
font-weight: 500;
font-size: 14px;
line-height: 17px;
color: #63BA86;
text-decoration: none;
margin: 1rem;
}
#media screen and (max-width: 30em) {
h1.big {
font-size: 20px;
line-height: 29px;
}
h1 {
font-size: 18px;
line-height: 22px;
}
h1.cer {
font-size: 12px;
line-height: 10px;
}
h2 {
font-size: 18px;
line-height: 29px;
}
form {
width: 90%;
}
button.conf {
font-size: 12px;
line-height: 17px;
}
footer.cl {
border-top: 1px solid #E5E5E5;
}
}
#media screen and (min-width: 30em) {
h1 {
font-size: 18px;
line-height: 22px;
}
h1.big {
font-size: 40px;
line-height: 29px;
}
h1.cer {
font-size: 12px;
line-height: 10px;
}
form {
width: 50%;
}
button.conf {
font-size: 12px;
line-height: 17px;
}
.liner {
width: auto;
height: 0px;
border: 1px solid #E5E5E5;
margin-top: 40px;
}
}
JSFiddle:
https://jsfiddle.net/Danielprabhakaran_N/7t8qk69b/3/
As promised, a complete overhaul of your code. Essentially I simplified your HTML a bit and fully recreated the CSS to make the page fully responsive without the use of #media queries or any external framework.
introduced use of box-sizing: border-box for all elements
main structure uses flexbox layout
introduced banding attributes ([band]) for easy construction of 'Landing Page' layout
inserted responsive page T/L/B/R spacing
used linear equations (y=mx+b) to calculate sizes for responsiveness (mainly fontsizes and element spacing)
now only uses em and rem for sizes where applicably, removed all uses of px
etc... (completion of this list with external references is pending)
Examples of
hover manipulation
using predefined Unicode icon as alternative to iconify JS (prevents load delay)
used inline SVG as an alternative icon to serve Android
Tested both landscape and portrait layout
Works on latest Chrome, Edge, Firefox and IE11 (and IE10 simulated)
And Android 9+, Samsung Galaxy J4+, 360x740 (Chrome, Firefox and default browser)
With minimum fit 320x320, maximum fit 1920x1200
Update
Use of Unicode does not seem to work on Android (or with some workaround), added inline SVG as an alternative. Idea behind it: loading some JS which in turn loads a single icon seems a bit overkill (not to mention s l o w)... SVG works on Android!
The Snippet (on SO full-page view required)
<!--
<script src="https://code.iconify.design/1/1.0.6/iconify.min.js">// this JS disabled</script>
-->
/*****************************/
/* my preferred global rules */
/*****************************/
html,body { box-sizing: border-box; width: 100%; max-width: 100% }
*::before,*::after, * { box-sizing: inherit }
/*
Above CSS defines ALL elements to use 'border-box'
Defining `box-sizing: border-box` will make calculation/manipulating element sizes
much easier as (usually) you would want to know the width/height of an element
including its inner spacing ('padding') and border.
=> element width/height = content width/height + padding + border
Default CSS is 'box-sizing: content-box'
=> element width/height = content width/height
'margin' is never part of an element width/height, so use sparsely!
Own the boxmodel knowledge (MDN): https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/The_box_model
w3schools 'CSS box-sizing Property': https://www.w3schools.com/cssref/css3_pr_box-sizing.asp
*/
/*
All math reference: https://www.mathsisfun.com/equation_of_line.html
*/
/* responsive base font size using y = mx + b */
html { font-size: calc(0.625vmin + 0.75rem) } /* (320,14)(1280,20) */
/* Simple banding attribute for use in 'Landing Page' layout */
[band] { display: flex; flex-flow: column wrap; }
[band*="cols"] { flex-direction: row } /* horizontally oriented container */
[band*="rows"] { flex-direction: column } /* vertically oriented container */
[band],[centered] { justify-content: center; align-content: center; align-items: center }
body[padded="1"],
body[padded="0"] [band*="padded"] {
/*
responsive page padding
and responsive band padding (same as responsive page padding, but at band level)
Top/Bottom padding: p1(320,16) p2(1920, 72) => 0.035x + 4.8 => vary from 16 to 72px
Left/Right padding: p3(320, 8) p4(1920,320) => 0.195x - 54.4 => vary from 8 to 320px
'Band padding' is only active when 'page padding' is off (0)
*/
padding: calc(3.5vh + 4.8px) calc(19.5vw - 54.4px);
}
/* prohibit user from selecting text (put in <body>), esp. convenient for 'click-happy' users... */
[no-select] { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none }
[do-select] { -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text; cursor: auto }
/* enable user to select text (put in specific elements) */
/* for debugging */
[outlines="1"] * { outline: 1px dashed }
/* YOUR CODE */
/*
Favouring 'mobile' only requires #media queries when you need
to override/modify CSS values for other (larger) devices.
- for the main design I used my Samsung J4+, 360x740
- and as large device my desktop display, 1920x1200
- smallest fit test 320x320 (Smartwatch? With a browser??? Okay...)
- and width 480px
*/
/*************************************/
/* First: setup the main page layout */
/*************************************/
/*
<body> contains a main 'page-wrapper'
with three distinct zones below each other,
(which I have designated to be a [band]):
- header
- content
- footer
[band] is a vertically oriented flexbox container
which centers all its child elements.
<body padded="0"> which means that page spacing is
done at [band="padded"] level.
*/
/******************************/
/* override some CSS defaults */
/******************************/
body { margin: 0 } /* remove default <body> spacing */
a { margin: 0; color: inherit; text-decoration: none }
button { display: block }
body {
height: 100vh; /* full viewport height */
/* all elements inherit below style */
font-size: 1rem; /* make it :root fontsize dependend */
/* which, in turn, is viewport size dependend */
font-family: Montserrat, Arial, Helvetica, sans-serif;
/* with fallbacks for slow/none loading fonts */
font-weight: 500; /* the preference for 'Montserrat' */
color: rgba(99,186,134,1);
/* default is 'Black', but most text is (#63ba86 greenish) */
/* converted to rgba so its transparency can be changed/manipulated */
}
.page-wrapper { /* main container holding all page content */
display: flex; /* it's not a [band], so define FBL */
flex-direction: column; /* of 3 container rows */
justify-content: space-between; /* pushes header/footer apart */
height: 100%; /* full parent height (<body>) */
}
/* .page-wrapper row 1 */
header {
padding: 0.25rem 0; /* instead of '[band="padded"]' */
font-size: 1.125em;
border-bottom: 1px solid rgba(0,0,0,0.1); /* #e5e5e5 */
}
header .text, header .iconify {
margin-right: auto
}
header .iconify {
font-size: 0.9em; margin-left: .5rem;
}
/* Unicode font assignment, does not show on Android! */
[utf] { font-family: serif }
/* icons from Unicode Group 'Supplemental Arrows-C' (https://unicode.org/charts/nameslist/) */
.iconify[utf="1F804"]:before {
content: '\1F804'; /* 1F804 🠄 Leftwards Arrow With Medium Triangle Arrowhead */
}
/* some other arrow, same Group */
.iconify[utf="1F808"]:before {
content: '\1F808'; /* 1F808 🠈 Leftwards Arrow With Large Triangle Arrowhead */
}
/* Inline SVG alternative (see end of document) */
.iconify.svg {
display: inline-block;
width : 0.9em;
height: 0.9em;
vertical-align: -0.1125em; /* 0.9 * -0.125 */
fill: currentColor; /* CSS color keyword */
}
/* .page-wrapper row 2 */
.content {
height: 100%; /* full available vertical FBL space (between header/footer) */
}
form {
padding: calc(3.5vh + 4.8px); /* inner spacing */
}
form>* {
margin: .6rem 0; /* element T/B outer spacing */
width: 100%;
}
.big {
font-size: calc(2.5vmin + 12px); /* (320,20)(1280,44) */
line-height: 1.45; /* original 29/20 */
}
.cer {
margin-bottom: .0625rem;
font-weight: 300;
font-size: 0.631rem; /* was 12px */
line-height: 1;
color: rgba(53,107,81,1); /* #356B51 */
}
button, input {
height: 1.875rem;
line-height: 1.45;
font-weight: bold;
border: 1px solid rgba(99,186,134,1);
border-radius: 0.25rem; /* 5px-ish */
}
button, input:required {
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05), 0px -4px 4px rgba(0, 0, 0, 0.05);
}
input { padding: 0 .25rem }
button { height: 1.875em; margin-left: auto }
button.conf {
width: 4.5rem;
color: rgba(255,255,255,1); /* White */
background-color: rgba(103,226,152,1) /* lighter green */
}
/* .page-wrapper row 3 */
footer {
border-top: 1px solid rgba(0,0,0,0.1); /* #e5e5e5 */
}
footer a {
font-size: 0.75em;
line-height: 1.214; /* original 17/14 */
margin: calc(1.25vmin + 2px); /* (320,6)(1280,18) */
}
/* for testing (and a bit of fun...just put dots before 'form' to disable) */
form {
background-color: rgba(0,0,0,.05);
/* GMC elevation 1dp */
box-shadow: 0px 2px 1px -1px rgba(0,0,0,.20),
0px 1px 1px 0px rgba(0,0,0,.14),
0px 1px 3px 0px rgba(0,0,0,.12);
}
form:hover {
transform: scale(1.01);
/* GMC elevation 3dp */
box-shadow: 0px 3px 3px -2px rgba(0,0,0,.20),
0px 3px 4px 0px rgba(0,0,0,.14),
0px 1px 8px 0px rgba(0,0,0,.12);
}
form:active { transform: scale(1) }
/**/
<body outlines="0" padded="0" no-select>
<div class="page-wrapper">
<header band="cols">
<!-- div class="iconify" data-inline="false" data-icon="eva:arrow-back-fill"></div -->
<!-- div class="iconify" utf="1F804"></div -->
<svg class="iconify svg"><use xlink:href="#eva-arrow-back-fill"/></svg>
<div class="text">Forgot password</div>
</header>
<div class="content" band>
<form action="#" class="formstyle">
<div class="big">Change your password</div>
<div class="cer">Confirm your email address</div>
<input type="text" placeholder="Enter your email address" required>
<button type="submit" class="conf">Confirm</button>
</form>
</div>
<footer band="padded.cols">
Terms <!-- javascript:void(0) puts no entry in browser history -->
Privacy
About
</footer>
</div>
<!-- 'display: none' to hide this part of the document from view, definition only -->
<!-- usage of a 'symbol' is <use href="#symbol-ID"> in HTML -->
<svg style="display: none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<symbol id="eva-arrow-back-fill" viewBox="0 0 24 24">
<path d="M19 11H7.14l3.63-4.36a1 1 0 1 0-1.54-1.28l-5 6a1.19 1.19 0 0 0-.09.15c0 .05 0 .08-.07.13A1 1 0 0 0 4 12a1 1 0 0 0 .07.36c0 .05 0 .08.07.13a1.19 1.19 0 0 0 .09.15l5 6A1 1 0 0 0 10 19a1 1 0 0 0 .64-.23a1 1 0 0 0 .13-1.41L7.14 13H19a1 1 0 0 0 0-2z"/>
</symbol>
</svg>
</body>
Check out the MDN Post on these topics too.
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
https://css-tricks.com/snippets/css/complete-guide-grid/
It would be easier to create this entire page than to fix each and every css bugs !
Add this at the very top of your Css below body styling
footer {
position: fixed;
bottom: 0;
margin-bottom: 2vh;
width: 100%;
}
Well i couldnt perform the surgery but applied a little band aid on the injury ! this will stop the bleeding for a while until you walk again .

Chrome's inspect device is extremely inaccurate?

I am trying to see how the page looks like on a 1366x768 laptop.
In Inspect device it looks perfectly fine:
But on the actual laptop, it looks like this:
So way off! :-/ It is very frustrating as I work on a big screen, and I cannot check it on the small laptop screen every minute.
How comes the page fits perfectly fine in the 1366x768's chrome device inspect but horribly on the actual 1366x768 screen?
Any tip what may be going on?
CSS:
/* Split the screen in half */
.split {
height: 100%;
width: 50%;
position: fixed;
z-index: 1;
top: 0;
overflow-x: hidden;
padding-top: 20px;
}
/* Control the left side */
.left {
left: 0;
}
/* Control the right side */
.right {
right: 0;
}
/* If you want the content centered horizontally and vertically */
.centered {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.form {
position: relative;
z-index: 1;
background: #FFFFFF;
color:black;
max-width: 560px;
min-width: 500px;
margin: 0 auto 100px;
padding: 45px;
text-align: center;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border-color: #eee;
border-width: 1px;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.Forgot-Password {
font-family: "Roboto";
font-size: 17px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
margin-top:15px;
text-align: center;
color: #555556;
}
.form button {
font-family: "Roboto", sans-serif;
outline: 0;
background:#009bf7;
width: 100%;
border: 0;
padding: 15px;
font-size: 17px;
-webkit-transition: all 0.3 ease;
transition: all 0.3 ease;
cursor: pointer;
color:white;
}
.form button:hover,.form button:active,.form button:focus {
background:#0c6ea7
}
.form button:disabled {
background: #dddddd;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #4CAF50;
text-decoration: none;
}
.form .register-form {
display: none;
}
The HTML markup:
<div class="split left">
<div class="centered">
<div style="margin-bottom:60px">
<img class="img-responsive" src="images/fineon.png" alt="Fineon"> </div>
<style>
.navbar {
display: none;
}
.navbar-primary {
display: none;
}
</style>
<div ng-controller="login-controller" ng-init="initLoginPage()">
<div align="center">{{message}}</div>
<form class="login-form form">
<p class="form-login-title" dir="{{pageInfo.direction}}">{{gs("signIn", "Sign in")}}</p>
<hr style="margin-right:370px;border: 1px solid black;" width="15%">
<div class="form-field">
<input dir="{{pageInfo.direction}}" type="text" name="first_name" id="first_name" required ng-model="user.email">
<label for="first_name">{{gs("emailAddress", "Email Address")}}</label>
</div>
<div class="form-field">
<input dir="{{pageInfo.direction}}" type="text" name="first_name" id="first_name" required ng-model="user.password">
<label for="first_name">{{gs("password", "Password")}}</label>
</div>
<button ng-disabled="crisperSessionId == undefined" dir="{{pageInfo.direction}}" ng-click="login()"
type="submit">{{gs("signInButton", "Sign in")}}</button>
<p class="Forgot-Password"><a class="Forgot-Password" href="#/loginForgot">Forgot my password</a></p>
</form>
</div>
</div>
<div class="split right ">
<div class="centered">
<h4 class="Fineon-Exchange">Fineon</h4> <br>
<p class="Export-Receivable-Finance-Marketplace" >Trade Finance & Marketplace</p>
<div style="width:70px; margin-top:50px">
<hr style="border: 1px solid white;">
</div>
</div>
</div>
</div>
Although I am not a hard core programer or any expert, but I think I know what might be wrong. The Inspect Element of your browser shows your page in a 1366x768 resolution. Whereas on the laptop, you are actually viewing the page in 1366-(top and bottom toolbars pixels) x 768-(scroll bar width pixels) resolution. So, the laptop has resolution of 1366x768 but actual displayable resolution is lesser than that and, in my opinion, is the problem.
Now you can either get the actual displayable resolution from the laptop and set as custom resolution in your chrome inspect tool or press f11 on your laptop to see the page in actual 1366x768 resolution.

How to place navbar menu below logo?

I have built this header using custom CSS and bootstrap class names. I have tried z-index, float: initial properties already. Thanks in advance
.branding-preview {
height: 75px;
margin-left: 15px;
margin-right: 15px;
background-color: #0071bb;
}
.branding-logo {
float: left;
height: 50px;
font-size: 18px;
padding: 15px 15px;
}
.branding-logo img {
width: 300px;
height: 50px;
}
.branding-powered-by-logo {
float: right;
height: 50px;
color: white;
font-size: 15px;
padding: 2px 10px;
}
.preview-menu {
margin: 30px 0 0 0;
}
.preview-menu > li > a {
margin: 0 3px;
color: white;
text-transform: uppercase;
border-bottom: solid 1px transparent;
background-color: transparent !important;
}
<div class="branding-preview">
<div class="branding-logo">
<img id="branding-logo" src="/path/to/logo">
</div>
<div class="branding-powered-by-logo">
<span>Powered By</span>
<img id="branding-powered-by-logo" src="/path/to/logo" height="30">
</div>
<ul class="navbar-nav navbar-right nav preview-menu">
<li><a>Start</a></li>
<li><a>Plan</a></li>
<li><a>Manage</a></li>
<li><a>Learn</a></li>
<li><a>Admin</a></li>
</ul>
</div>
This is the result that I am getting with the current code,
actual result:
This is what I'm hoping it will look like, expected result:
Isn't simple without all the css rules, but the concept is: Create a wrapper floated to right and inside create 2 lines, one for the branding-powered-by-logo and display:block the second line is depend from actual CSS but probably works without modify anything.
If you can post the real page we can help you with more precision.
Hope this help you.
.branding-preview {
display:block;
height: 75px;
margin-left: 15px;
margin-right: 15px;
background-color: #0071bb;
}
.branding-logo {
float: left;
height: 50px;
font-size: 18px;
padding: 15px 15px;
}
.branding-logo img {
width: 300px;
height: 50px;
}
.branding-powered-by-logo {
/* ADDED */
display:block;
text-align:right;
height: 50px;
color: white;
font-size: 15px;
padding: 2px 10px;
}
.preview-menu {
margin: 0px 0 0 0;
}
.preview-menu > li > a {
margin: 0 3px;
color: white;
text-transform: uppercase;
border-bottom: solid 1px transparent;
background-color: transparent !important;
}
/* ADDED */
.wrapper-logo-navbar {
float: right;
}
.preview-menu > li {
display: inline-block;
}
<div class="branding-preview">
<div class="branding-logo">
<img id="branding-logo" src="/path/to/logo">
</div>
<div class="wrapper-logo-navbar">
<div class="branding-powered-by-logo">
<span>Powered By</span>
<img id="branding-powered-by-logo" src="https://cdn.pixabay.com/photo/2012/05/02/19/27/head-46086_960_720.png" height="30">
</div>
<ul class="navbar-nav navbar-right nav preview-menu">
<li><a>Start</a></li>
<li><a>Plan</a></li>
<li><a>Manage</a></li>
<!-- removed some elements for the rendering on StackOverflow -->
</ul>
</div>
</div>
I think you just need add
position:absolute; right:0px;
to your .preview-menu class.

<a> tag showing as a different size on chrome and firefox

My issue is with this code here, you can view it at lapismc.net. for whatever reason it displays differently in chrome than it does in Firefox.
The "w-" classes are from CandyUI.css.
The popup-button classes are below.
.popup {
height: 170px;
min-height: 170px;
background-color: #244753;
border-top: 5px black;
box-shadow: black 0 -1px 3px 0, black 0 1px 3px 0;
}
.popup-container {
height: 120px;
}
.popup-para {
font-family: Raleway, sans-serif;
color: white;
font-size: 16px;
}
.popup-button {
width: 250px;
margin-left: 7px;
font-family: Raleway, sans-serif;
color: white;
font-weight: 400;
text-align: center;
}
.popup-button.youtube {
background-color: #5069ed;
}
.popup-button.youtube:hover {
background-color: #4259c0;
}
.popup-button.facebook {
background-color: #3973ed;
}
.popup-button.facebook:hover {
background-color: #3062ce;
}
.popup-button.forums:hover {
background-color: #2776bb;
}
<div class="w-section w-hidden-medium w-hidden-small w-hidden-tiny popup">
<div class="w-container popup-container">
<h1 class="heading white popup-title">Keep Updated</h1>
<p class="popup-para">Check out our Media Portals</p>
Visit our Facebook Page
Send us an Email
Join our Discord Server
</div>
</div>
The buttons display like this in chrome
and like this in firefox and edge
Any and all help is appreciated, please keep in mind that I am primarily a Java developer and have limited knowledge of CSS. Thanks.
I would wrap the three buttons and use flexbox. I'd also make them full-width on narrow devices. Here's an example. It's a proof of concept. If you need help applying it to your code, consider adding a live snippet to your question, reproducing the problem.
.popup {
height: 170px;
min-height: 170px;
background-color: #244753;
border-top: 5px black;
box-shadow: black 0 -1px 3px 0, black 0 1px 3px 0;
display: inlin-block;
}
.popup-container {
height: 120px;
}
.popup-para {
font-family: Raleway, sans-serif;
color: white;
font-size: 16px;
}
.popup-button {
margin: 0 0 7px 7px;
font-family: Raleway, sans-serif;
color: white;
font-weight: 400;
text-align: center;
}
.popup-button.youtube {
background-color: #5069ed;
}
.popup-button.youtube:hover {
background-color: #4259c0;
}
.popup-button.facebook {
background-color: #3973ed;
}
.popup-button.facebook:hover {
background-color: #3062ce;
}
.popup-button.forums {
background-color: #3585ee;
}
.popup-button.forums:hover {
background-color: #2776bb;
}
.button-bar {
display: flex;
flex-wrap: wrap;
background-color: #244753;
padding: 7px 7px 0 0;
}
.button-bar > * {
padding: 1rem .5rem;
box-sizing: border-box;
flex: 1 0 calc(33.33% - 7px);
text-decoration: none;
}
#media (max-width: 768px) {
.button-bar {
flex-wrap: wrap;
}
.button-bar > * {
flex: 1 0 100%;
max-width: calc(100% - 7px);
}
}
<div class="w-section w-hidden-medium w-hidden-small w-hidden-tiny popup">
<div class="w-container popup-container">
<h1 class="heading white popup-title">Keep Updated</h1>
<p class="popup-para">Check out our Media Portals</p>
<div class="button-bar">
Visit our Facebook Page
Send us an Email
Join our Discord Server
</div>
</div>
</div>