I have the following component in my application
.call-support {
display: flex;
justify-content: center;
padding: 20px 0 20px 0;
}
.container-support {
display: flex;
align-items: center;
}
.support-text {
text-align: center;
margin-left: 10px;
}
.title-text {
font-family: "RalewayRegular";
font-weight: bold;
font-size: 16px;
}
.subtitle-text {
font-family: "RalewayRegular";
font-weight: normal;
font-size: 16px;
}
.customer-service-request {
display: flex;
flex-direction: column;
align-items: center;
padding: 10% 0 20% 0;
}
.request-text {
display: flex;
}
.number {
font-size: 18px;
color: #D53865;
font-weight: bold;
background-color: #f9f4f1;
width: 340px;
height: 130px;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.number:before {
content: "";
position: absolute;
top: 0;
right: 0;
border-top: 65px solid #666B74;
border-left: 65px solid #f9f4f1;
width: 0;
border-bottom: 65px solid #666B74;
}
.subtitle-number {
position: absolute;
font-family: "RalewayRegular";
font-weight: normal;
font-size: 12px;
display: flex;
margin-top: 40px;
}
.number-request {
font-family: "RalewayRegular";
color: #fff;
font-size: 18px;
font-weight: bold;
background-color: #666B74;
height: 40px;
width: 340px;
height: 130px;
display: flex;
justify-content: center;
align-items: center;
}
<div class="call-support">
<div class="container-support">
<div class="request-text">
<p class="number">000 000 000<span class="subtitle-number">(local call)</span></p>
<p class="number-request">Customer Service</p>
</div>
</div>
</div>
It is well laid out with this css in all browsers, except in Internet Explorer where the margin top of "subtitle-number" shows it almost stuck to the margin-bottom of the box it belongs to.
Here I leave a link to a codepen with the design.
https://codepen.io/CharlieJS/pen/dyXyBBe
and an image of how it looks in Internet Explorer
How can I adjust the design to display in all browsers?
Why is the margin-bottom higher in IE?
thank you all for your time and help
This is created by display: flex; in class .subtitle-number. So just remove it and it will work fine.
Try to set this class wit top & left like:
.subtitle-number {
position: absolute;
font-family: "RalewayRegular";
font-weight: normal;
font-size: 12px;
/*display: flex;
margin-top: 40px;*/
top:70%;
left:50%;
transform: translate(-50%, 30%);
}
As position absolute is better set with top, right, bottom, left. It seems to work fine by me on w3schools on IE11.
DEMO
.call-support {
display: flex;
justify-content: center;
padding: 20px 0 20px 0;
}
.container-support {
display: flex;
align-items: center;
}
.support-text {
text-align: center;
margin-left: 10px;
}
.title-text {
font-family: "RalewayRegular";
font-weight: bold;
font-size: 16px;
}
.subtitle-text {
font-family: "RalewayRegular";
font-weight: normal;
font-size: 16px;
}
.customer-service-request {
display: flex;
flex-direction: column;
align-items: center;
padding: 10% 0 20% 0;
}
.request-text {
display: flex;
}
.number {
font-size: 18px;
color: #D53865;
font-weight: bold;
background-color: #f9f4f1;
width: 340px;
height: 130px;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.number:before {
content: "";
position: absolute;
top: 0;
right: 0;
border-top: 65px solid #666B74;
border-left: 65px solid #f9f4f1;
width: 0;
border-bottom: 65px solid #666B74;
}
.subtitle-number {
position: absolute;
font-family: "RalewayRegular";
font-weight: normal;
font-size: 12px;
/*display: flex;
margin-top: 40px;*/
top:70%;
left:50%;
transform: translate(-50%, 30%);
}
.number-request {
font-family: "RalewayRegular";
color: #fff;
font-size: 18px;
font-weight: bold;
background-color: #666B74;
height: 40px;
width: 340px;
height: 130px;
display: flex;
justify-content: center;
align-items: center;
}
<div class="call-support">
<div class="container-support">
<div class="request-text">
<p class="number">000 000 000<span class="subtitle-number">(local call)</span></p>
<p class="number-request">Customer Service</p>
</div>
</div>
</div>
The absolute property is set in this style but the coordinate value is not set. Because of the different calculation methods such as element position parameters in different browsers, the results are not the same in different browsers.
At this time, it is not necessary to use relative positioning, but to have a certain coordinate. Please modify the .subtitle-number style as following:
.subtitle-number {
position: absolute;
font-family: "RalewayRegular";
font-weight: normal;
font-size: 12px;
top: 80px;
left: 145px;
}
Result in IE:
Related
As the title suggests I got an insanely weird error code which barely describes the error itself (shown below)
error message I got
I can't really pinpoint to the culprit, but I suspect it has something to do with the webpack or imports in my CSS code. I tried reverting back to before I had this error but it still appeared.
Searching for answers I found none as no one seems to have this specific problem.
http://localhost:8000/commons.css
#import url(https://fonts.googleapis.com/css2?family=Karantina:wght#700&display=swap);
#import url(https://fonts.googleapis.com/css2?family=Heebo:wght#400;800&display=swap);
#import url(https://fonts.googleapis.com/css2?family=M+PLUS+1p:wght#600&display=swap);
#import url(https://fonts.googleapis.com/css2?family=Karantina:wght#700&display=swap);
#import url(https://fonts.googleapis.com/css2?family=Heebo:wght#400;800&display=swap);
#import url(https://fonts.googleapis.com/css2?family=Miriam+Libre:wght#700&display=swap);
html{
margin: 0;
padding: 0;
background-color: whitesmoke;
}
body{
margin: 0;
padding: 0;
}
input{
font-size: 1rem;
}
.hide{
display: none;
}
.layout-module--heading--8VjLO{
display: flex;
justify-content: space-between;
align-items: center;
padding: 2rem 5%;
margin-bottom: 5rem;
background-color: #2F4F4F;
border-bottom: 5px solid #C4F0C4;
border-radius: 0px 0px 15px 15px;
}
.layout-module--menubtn--xDRG0{
border: 0;
padding: 0;
}
.layout-module--menu--P1Nbr{
display: none;
}
.layout-module--menudropdown--81ZJJ{
display: none;
position: absolute;
font-family: 'Karantina', cursive;
font-weight: 700;
text-decoration: none;
color: #D4F0AA;
font-size: 32px;
min-width: 160px;
z-index: 1;
}
.layout-module--menuimg--MXGBY{
display: block!important;
background-color: #2F4F4F;
height: 50px;
width: 50px;
padding: 0;
border: 0;
}
.layout-module--mainlogo--JD3jr{
width: 12.5rem;
height: 12.5rem;
}
#media only screen and (max-width: 992px) {
.layout-module--mainlogo--JD3jr{
display: none!important;
}
.layout-module--menu--P1Nbr{
display: block;
}
.layout-module--heading--8VjLO ul{
display: none;
}
.layout-module--menu--P1Nbr:hover > .layout-module--menudropdown--81ZJJ{
background-color: blue;
}
}
.layout-module--heading--8VjLO ul{
list-style: none;
}
.layout-module--heading--8VjLO ul li{
display: inline-block;
padding: 0 .8rem;
}
.layout-module--navlink--odahv{
font-family: 'Karantina', cursive;
font-weight: 700;
text-decoration: none;
color: #D4F0AA;
font-size: 32px;
}
.layout-module--navlink--odahv::after{
content: "";
background-color: #C4F0C4;
height: 3px;
width: 0%;
display: block;
transition: 0.3s ease-in;
}
.layout-module--navlink--odahv:hover::after, .layout-module--navlink--odahv:active::after{
width: 100%;
}
.index-module--flexcont--E5tVn{
position: relative;
display: flex;
flex-wrap: wrap;
gap: 2em;
margin-left: 10%;
margin-right: 10%;
flex-wrap: wrap;
}
.index-module--flexcont--E5tVn article{
margin: 1em;
flex: 1 1 20rem;
box-shadow: 5px 5px 30px 2px rgba(0,0,0,0.66);
border-bottom: 5px solid #C4F0C4;
border-radius: 0px 0px 25px 25px;
transition-property: all;
transition-duration: 0.3s ;
transition-timing-function: ease;
}
.index-module--under--t50Wv{
width: 100%;
font-size: 1em;
color: black;
text-align: center;
font-family: 'M PLUS 1p', sans-serif;
font-weight: 600;
letter-spacing: 1.5px;
text-overflow: ellipsis;
overflow: hidden;
line-clamp: 2;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.index-module--flexcont--E5tVn article h2{
text-align: center;
margin-top: 12.5px;
margin-bottom: 5px;
font-family: 'Heebo', sans-serif;
font-weight: 800;
padding-left: 10px;
padding-right: 10px;
letter-spacing: 1.5px;
}
.index-module--flexcont--E5tVn article a{
text-decoration: none;
color: black;
}
.index-module--showthumb--jLQ1t{
width: 100%;
height: auto;
}
.index-module--flexcont--E5tVn article:hover, .index-module--flexcont--E5tVn article:active{
cursor: pointer;
-webkit-transform: scale(1.15);
transform: scale(1.15);
/*transform: translate(0, -20px);*/
}
#media only screen and (max-width: 992px){
.index-module--flexcont--E5tVn{
gap: 1em;
margin-left: 5%;
margin-right: 5%;
}
.index-module--flexcont--E5tVn article{
flex: 1 1 10rem;
margin: 0.5rem;
}
.index-module--under--t50Wv{
display: none;
}
/*.under p{
margin: 0.5rem, 0;
}*/
.index-module--flexcont--E5tVn article h2{
min-width: 6ch;
line-break: auto;
}
}
.footer-module--wrapper--iAZv8{
background-color: #2F4F4F;
margin-top: 5rem;
padding: 2rem 5%;
border-top: 5px solid #C4F0C4;
border-radius: 15px 15px 0 0;
display: flex;
justify-content: space-between;
}
.footer-module--wrapper--iAZv8 div{
display: flex;
justify-content: end;
}
.footer-module--wrapper--iAZv8 div p{
font-family: 'Karantina', sans-serif;
font-weight: 700;
font-size: 40px;
color: #D4F0AA;
text-align: right;
}
.footer-module--tglogo--fTM1x{
margin: 1rem;
width: 12.5rem;
height: 12.5rem;
}
.slug-module--title--g3-bA{
font-family: 'Heebo', sans-serif;
font-weight: 800;
font-size: 54px;
text-align: center;
}
.slug-module--label--ZZRK6{
font-family: 'Heebo', sans-serif;
font-weight: 400;
font-size: 36px;
text-align: center;
}
.slug-module--main--4LR6u{
display: flex;
height: 25rem;
justify-content: space-between;
margin: 0 3rem;
}
.slug-module--ads--JOrBO{
display: block;
}
.slug-module--main--4LR6u div{
min-width: 30%;
min-height: 15rem;
}
.slug-module--desc--jV-dL{
font-family: 'Miriam Libre', sans-serif;
font-weight: 700;
text-align: center;
font-size: 2rem;
margin: 5rem;
}
.slug-module--desc--jV-dL li{
list-style: none;
}
#media only screen and (max-width: 992px){
.slug-module--ads--JOrBO{
display: none;
}
.slug-module--main--4LR6u{
justify-content: center;
}
.slug-module--main--4LR6u div{
min-width: 100%;
}
}
I would really appreciate any help with the matter as it is mind-boggling.
Thanks!
I figured it out on my own, I think (Seems to work for now at least). I moved all my imports to HTML after checking they're indeed correct. Deleted all the cookies from the site and restarted the development server. Seems to do the trick for now. Hope this helps anyone cause I struggled with it for a bit there!
I am currently creating a bit of a fun project. For some reason, my text and check / radio boxes do not align with the text. They seem to be off to one side and higher than the text.
Here is my pen - https://codepen.io/Amnesia180/pen/RwKQOKP
html,
body {
line-height: 1.5;
height: 100%;
margin: 0 auto;
font-family: 'Quicksand', sans-serif;
color: #070707;
}
header {
position: relative;
top: 0;
padding: 0;
background-color: #EFEFEF;
width: 100%;
height: 60px;
}
.material-icons {
color: #505050;
}
#nav-bar {
position: relative;
display: flex;
justify-content: space-between;
padding: 10px;
}
ul {
display: flex;
padding: 0;
list-style: none;
}
li {
padding: 0px 20px;
}
.nav-link-left {
float: left;
text-decoration: none;
color: #070707;
font-weight: 800;
}
.nav-link {
float: right;
text-decoration: none;
color: #070707;
font-weight: 800;
}
.nav-link:hover {
float: right;
color: #5873D9;
border-bottom: 3px solid #5873D9;
padding-bottom: 5px;
}
#intro {
display: flex;
flex-direction: column;
align-items: center;
height: 470px;
margin-top: 50px;
max-width: 90em;
}
h1 {
font-size: 4em;
color: #34D1BF;
}
h2 {
color: #5873D9;
margin-top: 20px;
}
form {
display: flex;
flex-direction: column;
}
label {
font-size: 1.5em;
padding: 10px 0;
}
input {
width: 100%;
height: 30px;
border: 2px solid #34D1BF;
padding: 5px;
}
#submit {
background-color: #34D1BF;
width: 40%;
height: 40px;
margin-top: 15px;
margin-left: 30%;
margin-right: 30%;
border: 2px solid #34D1BF;
color: white;
}
#about,
#promo-image,
#burger {
max-width: 50em;
width: 90vw;
margin: 0 auto;
padding: 5px;
text-align: left;
}
#promoimage {
display: block;
margin: 0 auto;
max-width: 518px;
width: 100%;
}
#burgers {
margin-top: 40px;
flex-direction: column;
align-items: center;
text-align: center;
justify-content: space-around;
}
.box {
border: 2px solid #EFEFEF;
border-radius: 5px;
margin: 2px;
text-align: center;
}
.price {
display: flex;
flex-direction: column;
margin: 0;
padding: 0;
}
.price li {
padding: 30px;
border: 0.5px solid #EFEFEF;
}
.card-header {
background-color: rgba(52, 209, 191, 1);
color: white;
}
footer {
width: 100%;
background-color: #EFEFEF;
height: 80px;
text-align: center;
}
footer p {
padding-top: 20px;
}
.burgerform {
text-align: left;
display: inline;
}
.burgerform label {
font-size: 1.5em;
font-weight: bold;
}
.burgerform legend {
font-weight: bold;
}
#media (min-width: 600px) {
#intro {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-evenly;
}
#burgers {
display: flex;
flex-direction: row;
align-items: center;
text-align: center;
justify-content: space-between;
}
}
<label>Sauces</label>
<p/> Burger Sauce <input type="checkbox" id="burgersauce" name="burgersauce" onclick="calculateTotal()"> Dirty Mayo Sauce
Can anyone advise?
Thanks!
Your inputs have width: 100%; which means it'll occupy entire width. And the "label" is just plain text so they are just flowing into the next line.
If you want to align them then you need proper elements (label>) aligned within 100% of the same line.
That is because you have given your inputs a width of 100%, so now each checkbox and radiobutton spans the whole width of the screen.
input {
width: 100%;
height: 30px;
border: 2px solid #34D1BF;
padding: 5px;
}
You can debug CSS issues using the CSS developer tools of your browser, as in the attached screenshot
Wrap both label (eg. Burger Mayo Sauce) and checkbox within a Flex-box, apply 100% width to it, and justify-content:space-between.
.menu-item{
witdh: 100%;
display:flex;
justify-content:space-between;
}
input[type=checkbox]{
//Whatever styling you want to apply to the checkbox.
}
Do not add the 100% width to the input, flexbox will manage the space for you.
I am currently working on a website and I have an element that I have explicitly declared: display: inline-block and visibility: visible however, the element is still invisible. This is only occurring on mobile devices. The invisible element is <div id="clock">.
#font-face {
font-family: 'bitwise';
src: url('bitwise.ttf');
font-display: swap;
}
* {
font-family: 'bitwise', monospace;
margin: 0;
padding: 0;
outline: 0;
}
:root {
background-color: #008080;
}
body,
html,
.wrapper {
width: 100%;
height: 100%;
}
span {
color: #FFFFFF;
font-size: 18pt;
text-align: center;
display: inline-block;
}
h1 {
color: #FFFFFF;
text-align: center;
display: inline-block;
}
input {
font-family: 'bitwise', monospace;
background-color: #535353;
color: #FFFFFF;
font-size: 18pt;
overflow: hidden;
text-align: center;
line-height: inherit;
height: inherit;
}
img:not(.noresize) {
width: 35%;
height: 35%;
}
video {
width: 35%;
height: 35%;
}
a:link {
color: #EFCF7C;
}
a:visited {
color: #105733;
}
button {
background-color: #105733;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
margin: 4px 2px;
}
#back {
background-color: #660000;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
margin: 4px 2px;
}
#taskbar {
position: absolute;
overflow: hidden;
bottom: 0;
width: 100%;
height: 27px;
background-color: silver;
box-shadow: inset 0px 1px #dfdfdf, inset 0px 2px #ffffff;
}
.center {
display: flex;
flex-wrap: wrap;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
text-align: center;
align-items: center;
justify-content: center;
}
#start {
float: left;
}
#clock {
float: right;
position: relative;
text-align: center;
}
#clocktime {
font-family: 'Arial', serif;
font-size: 13px;
color: #000000;
position: relative;
bottom: 23px;
left: 17px;
}
#icons {
padding-top: 8px;
}
#content {
padding-top: 10px;
}
.break {
flex-basis: 100%;
height: 0;
}
#content {
width: 675px;
height: 300px;
}
#media screen and (max-width: 1079px) {
html,
body {
overflow: hidden;
}
#clock {
float: right;
position: relative;
bottom: 100px;
text-align: center;
display: inline-block;
visibility: visible;
}
#clocktime {
font-family: 'Arial', serif;
font-size: 13px;
color: #000000;
position: relative;
bottom: 23px;
left: 17px;
}
}
<div id="taskbar">
<div id="start"><img class="noresize" src="/assets/start.png"></div>
<div id="clock"><img class="noresize" src="/assets/clock.png">
<div id="clocktime"></div>
</div>
</div>
<div id="icons"><img class="noresize" src="/assets/icons.png"></div>
<div class="center"><img class="noresize" src="/assets/ie.png"></div>
<div class="center" id="content">
Content here.
</div>
Screenshot 1 - What the page should look like. Note the clock in the lower-right corner.
Screenshot 2 - What the page actually looks like on mobile.
Screenshot 3 - Chrome DevTools showing the element as being in a visible spot, but still not being visible.
I see that that css is only appliable when max-width is equal to 1079px.
Try to increase that number in inspector element to see what happens.
So it turns out I had overflow: hidden set on #taskbar and this means that any children inside of the taskbar will not display, even if they are in a "visible" area. Adding bottom: 32px to set it inside of the taskbar worked.
Updated CSS:
#taskbar {
position: absolute;
overflow: hidden;
bottom: 0;
width: 100%;
height: 27px;
background-color: silver;
box-shadow: inset 0px 1px #dfdfdf, inset 0px 2px #ffffff;
}
<snip>
#media screen and (max-width: 1079px) {
#clock {
bottom: 32px;
}
}
I wrote the CSS code for the desktop version of my website in my website's style.css file. Then, at the end of the css file, I wrote
body, html { /*the outer layer of the site and global style attributes*/
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 0px;
height: 100%;
width: 100%;
font-size: 100%; /*16px*/
background-color: #383c5f;
/*background-image: linear-gradient(#191e4d, white);*/
display: flex;
background-repeat: no-repeat;
background-attachment: fixed;
}
/*
* {
border: 1px solid red;
} */
#website {
width: 100%;
}
#logo {
height: 20px;
}
/* NAV BAR */
.nav-bar {
width: 100%;
position: fixed;
display: flex;
background-color: #232754;
flex-direction: horizontal;
justify-content: center;
z-index: 3;
}
a {
text-decoration: none;
}
.nav-bar-item {
margin-right: 20px;
margin-left: 20px;
font-family: Lucida Grande, sans-serif;
color: white;
font-size: /*1.40vw*/ 1.25em;
padding-top: 7px;
padding-bottom: 5px;
margin-top: 1.75vh;
}
img {
height: 100%;
left: 50%
}
/* Slideshow */
* {
box-sizing: border-box
}
/* Slideshow container */
.slideshow-container {
max-width: 100%;
position: relative;
margin: auto;
height: 85%;
overflow: hidden;
display: flex;
align-items: center;
top: -1.5%;
}
/* Hide the images by default */
.mySlides {
display: none;
}
/* Next & previous buttons */
.prev, .next {
cursor: pointer;
position: absolute;
top: 30%;
width: auto;
margin-top: -22px;
padding: 16px;
color: white;
font-weight: bold;
font-size: 1.125em;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
user-select: none;
}
/* Position the "next button" to the right */
.next {
right: 0;
border-radius: 3px 0 0 3px;
}
/* On hover, add a black background color with a little bit see-through */
.prev:hover, .next:hover {
background-color: rgba(0,0,0,0.8);
}
/* Caption text */
.text {
color: #f2f2f2;
font-size: 15px;
padding: 8px 12px;
position: absolute;
bottom: 8px;
width: 100%;
text-align: center;
}
/* Number text (1/4 etc) */
.numbertext {
color: #f2f2f2;
font-size: 12px;
padding: 8px 12px;
position: absolute;
top: 2.5%;
}
/* The dots/bullets/indicators */
.dot {
cursor: pointer;
height: 15px;
width: 15px;
margin: 0 2px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
transition: background-color 0.6s ease;
}
.active, .dot:hover {
background-color: #717171;
}
/* Fading animation */
.fade {
-webkit-animation-name: fade;
-webkit-animation-duration: 1.5s;
animation-name: fade;
animation-duration: 1.5s;
}
#-webkit-keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
#keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
/*Content*/
.content {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.title {
position: absolute;
left: 16%;
font-size: /*3em*/ 6vh;
color: white;
font-family: Futura, sans-serif;
text-align: center;
text-shadow: 8px 8px 10px #000000;
}
/*HOMEPAGE*/
.container {
width: 80%;
height: 100%;
display: flex;
flex-direction: horizontal;
align-items: center;
justify-content: center;
}
.container.home {
width: 100%;
height: 100%;
display: flex;
flex-direction: horizontal;
align-items: center;
justify-content: center;
}
#name {
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
font-size: /*8.75em*/ 9.75vw;
color: white;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -105%);
text-align: center;
text-shadow: 8px 8px 10px #000000;
display: none;
}
#quote {
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
font-size: /*2.5em*/ 2.75vw;
color:/* #191e4d;*/ white;
position: absolute;
top: 70%;
left: 50%;
transform: translate(-50%, 0%);
-webkit-text-stroke: 1px #5d4f4f;
text-align: center;
text-shadow: 8px 8px 10px #000000;
display: none;
}
/*ABOUT*/
.title.about{
top: 118%;
}
.about-item {
margin: 30px;
width: 350px;
height: 350px;
display: flex;
flex-direction: horizontal;
justify-content: center;
align-items: center;
}
#kristy-picture{
position: relative;
display: flex;
justify-content: center;
width: 80% /*20vw*/;
height: 80% /*20vw*/;
overflow: hidden;
border-radius: 100%;
}
#resume-line {
position: absolute;
font-size: /*1.5em*/ 3.25vh;
color: /*#191e4d;*/ white;
top: 180%;
font-family: Futura, sans-serif;
text-align: center;
}
#rlink:link {
color: white;
}
#rlink:active {
color: rgb(228, 235, 250);
}
#rlink:visited {
color: rgb(186, 206, 250);
}
#about-description {
color: white;
font-family: Futura, sans-serif;
font-size: 1.125em;
}
/* PROJECTS */
.title.projects{
top: 218%;
}
#projects-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
width: inherit;
height: 65%;
position: absolute;
top: 235%;
align-items: center;
}
.project {
cursor: pointer;
height: 50%;
width: 35%;
display: flex;
flex-direction: column;
justify-content: space-around;
overflow: hidden;
margin: 5px;
background: #333454;
align-items: center;
/* box-shadow: 4px 4px 4px #000000a8; */
border-color: white;
}
#byow-img:hover {
animation: enlarge_photo ease-in 0.5s;
animation-fill-mode: both;
animation-iteration-count: 1;
}
#bearmaps-img:hover {
animation: enlarge_photo ease-in 0.5s;
animation-fill-mode: both;
animation-iteration-count: 1;
}
#maps-img:hover {
/* box-shadow: 8px 8px 8px #000000a8;*/
animation: enlarge_photo ease-in 0.5s;
animation-fill-mode: both;
animation-iteration-count: 1;
}
#keyframes enlarge_photo {
from {
width: 85%;
height: 75%
}
to {
width: 95%;
height: 85%;
}
}
.proj-image{
width: 85%;
height: 7M5%;
text-align: center;
overflow: hidden;
}
.proj-label {
color: #f2f2f2;
font-family: Futura, sans-serif;
}
/* EXPERIENCE */
.title.experience{
top: 318%;
}
#experience-container {
display: flex;
flex-direction: column;
justify-content: space-around;
/* flex-wrap: wrap; */
width: inherit;
height: 65%;
position: absolute;
top: 330%;
align-items: center;
}
.expr-item {
height: 50%;
width: 100%;
display: flex;
flex-direction: horizontal;
justify-content: center;
/*overflow: scroll;*/
margin: 5px;
align-items: center;
border-width: 2px;
background-color: #35395d;
border-color: #1f2140;
}
#skills {
/* height: 70%; */
/* width: 35%; */
/* border-radius: 30px; */
border-width: 2px;
background-color: #35395d;
border-color: #1f2140;
color: white;
font-family: Futura, sans-serif;
display: flex;
}
/*
#exp-flex {
height: 65%;
width: 60%;
display: flex;
flex-direction: column;
justify-content: space-around;
}*/
.tex sub, .latex sub, .latex sup {
text-transform: uppercase;
}
.tex sub, .latex sub {
vertical-align: -0.5ex;
margin-left: -0.1667em;
margin-right: -0.125em;
}
.tex, .latex, .tex sub, .latex sub {
font-size: 1em;
}
.latex sup {
font-size: 0.85em;
vertical-align: 0.15em;
margin-left: -0.36em;
margin-right: -0.15em;
}
.textbox {
width: 75%;
height: 80%;
display: flex;
flex-direction: column;
justify-content: center;
font-size: 0.875em;
color: white;
font-family: Futura, sans-serif;
}
.exp-image {
width: 10%;
height: 75%;
display: flex;
flex-direction: column;
justify-content: center;
}
/* CONTACT ME */
.title.contact{
top: 418%;
}
#contact-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
width: inherit;
height: 65%;
position: absolute;
top: 430%;
align-items: center;
}
#contact-line {
width: 100%;
text-align: center;
font-size: 1.5em;
color: white;
font-family: Futura, sans-serif;
}
.contact-box-container {
width: 80%;
height: 60%;
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
}
.contact-box {
width: 40%;
height: 80%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 10px;
background-color: /*rgb(112, 129, 184)*/ #333454;
border-color: #1f2140;
border-width: 2px;
color: white;
font-family: Futura, sans-serif;
text-align: center;
}
/* Popup Box */
#overlay {
background: rgba(0, 0, 0, 0.7);
position: absolute;
height: 500%;
width: 100%;
z-index: 2;
top: 0px;
left: 0px;
}
#lightbox {
display: none;
}
#specific-project-container {
position: fixed;
top: 50%;
left: 50%;
z-index: 3;
transform: translate(-50%, -50%);
background-color: #1e2435;
height: 82%;
width: 70%;
border-color: #1e1e54;
overflow: hidden;
border-width: 3px;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
overflow: scroll;
}
.picture {
margin-top: 10px;
width: 45%;
height: 50%;
overflow: hidden;
text-align: center;
}
.proj-desc {
margin-bottom: 10px;
width: 80%;
/*overflow: scroll; */
display: flex;
justify-content: center;
align-items: center;
color: white;
font-family: Futura, sans-serif;
}
/* BOTTOM BAR */
.bottom-bar {
position: fixed;
bottom: 0;
left: 50%;
width: 100%;
transform: translateX(-50%);
display: flex;
flex-direction: horizontal;
justify-content: center;
align-items: flex-end;
margin-bottom: 40px;
}
.bottom-button {
width: 25px;
height: 25px;
margin-right: 10px;
margin-left: 10px;
position: relative;
display: inline-block;
opacity: 0.6;
z-index: 1;
}
.bottom-button:hover {
animation: opaque ease-in 0.3s;
animation-fill-mode: both;
animation-iteration-count: 1;
/* opacity: 1;*/
}
#keyframes opaque {
from { opacity: 0.6; }
to { opacity: 1}
}
#copyright {
font-size: 0.75em;
position: fixed;
color: /*#191e4d;*/ white;
margin-bottom: 48px;
margin-top: 20px;
z-index: 1;
}
#media only screen and (max-width: 800px) {
#kristy-picture {
width: 100%;
height: 100%;
}
#about-description {
color: white;
font-family: Futura, sans-serif;
font-size: 1.5em;
}
.project {
height: 30%;
}
.exp-image {
width: 20%;
height: 30%;
}
.contact-box-container {
width: 100%;
height: 40%;
}
}
#media only screen and (max-height: 520px) {
.textbox {
font-size: 0.5em;
}
}
to override any of the existing above elements' settings for mobile display. I'm not sure why these settings aren't showing up on my iPhone when I view my website, though. Am I not supposed to put #media at the end of my file? I used this YouTube video https://www.youtube.com/watch?v=2KL-z9A56SQ to learn about responsive design from desktop to downwards.
I just checked your website and it seems that you are missing meta-tags in your web page. <meta> viewport element tells the browser about the page's dimensions and scaling. Include the following tag in your <head> tag and everything will work as expected.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
You can follow this link to know more about meta tags and their importance on a web page. Hope it Helps.
I received help centering an image within a box using a "helper" pseudo element element, which was working until I published it live. I'm not sure what's going on.
you can see whats going on at live link. And this is the code I was using for the layout
Code:
.offer {
width: 288px;
float: left;
margin-right: 25px;
}
.box {
position: relative;
display: block;
border: solid 3px #19468d;
height: 310px;
width: 100%;
margin-top: 11px;
text-align: center;
}
.price span {
font-family: avenir next;
font-weight: 700;
background-color: #19468d;
color: white;
font-size: 21px;
padding: 0px 5px;
left: 0;
padding-left: 0;
}
.price a {
position: relative;
font-family: avenir next;
font-weight: 700;
background-color: #19468d;
color: white;
font-size: 21px;
padding: 1px 7px;
left: 3px;
bottom: 1px;
border-style: solid;
border-color: #19468d;
}
.price a:hover {
color: #19468d;
background-color: white;
border-style: solid;
}
#cost {
position: absolute;
left: 0px
}
#info {
position: absolute;
bottom: 0px;
right: 0px
}
.box img {
display: inline-block;
margin: 0 auto;
text-align: center;
max-width: 252px;
vertical-align: center;
}
#grid {
margin: 0px;
display: flex;
display: -webkit-flex;
/* Safari 8 */
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
/* Safari 8 */
-webkit-justify-content: center;
/* Safari 8 */
margin-left: 20px;
}
.helper {
display: inline-block;
height: 100%;
vertical-align: middle;
}
.price {
text-align: left
}
.price #dollar {
padding-right: 0px;
padding-left: 5px;
}
<div class="offer">
<div class="box">
<div class="price">
<span id="dollar">$</span><span>27</span>
</div>
<span class="helper"></span>
<img src="http://cdn2.hubspot.net/hubfs/75704/JPs-Slices/2016_Yes/img/floorexammat.jpg">
<div class="price" id="info">
Buy Now
</div>
</div>
Rather use flex for the images. On the ".box" you can do
display:flex;
justify-content: center;
and remove the helper.