On my site, there is a scrolling container, which contains static cards that display certain data. The user scrolls through the cards one-by-one. On iOS Safari, only the first 2 cards are displaying, and as I scroll through, the other cards are invisible.
From the screenshot you can see that the element is there on the page, but invisible. You can even select the text on the element as if its there. The HTML and CSS behind every card is exactly the same.
.rc_eid-card {
position: relative;
width: 202px;
min-width: 202px;
height: 282px;
border-radius: 8px;
background: white;
padding: 20px;
box-sizing: border-box;
z-index: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
scroll-snap-align: start;
margin-right: 16px;
&:last-child {
margin-right: 0;
}
img {
width: 40px;
margin-bottom: 16px;
}
h3 {
font-family: $font-base;
font-size: 32px;
font-weight: 700;
color: #BE67A1;
}
&--text {
font-size: 16px;
line-height: 1.375;
color: $color-grey--dark;
}
&--bottom {
position: absolute;
bottom: 20px;
width: 100%;
text-align: center;
font-size: 12px;
color: $color-grey--dark;
}
}
This is the CSS for the container if that matters as well:
.rc_eid-container--scrolling {
display: flex;
justify-content: center;
overflow: auto;
max-width: 1074px;
width: 100%;
margin: auto;
padding: 8px;
scroll-padding: 8px;
scroll-snap-type: x mandatory;
box-sizing: border-box;
filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.15)) drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.1));
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
&::-webkit-scrollbar {
display: none;
}
#media (max-width: 1073px) {
justify-content: flex-start;
}
}
Thanks in advance!
Related
I have a popup window (within the same page) which I'm attempting to put a container which scrolls horizontally into, yet it distorts the popup window and does not display anything other than the scrollbar. I'm honestly at a loss, can anyone help me here? I've looked around for solutions but I can't find anything that I can see applies to my problem.
If anyone can help, or point me in the right direction, I'd be really grateful. The scrollbar works perfectly fine when isolated, but inside the window shows like this:
Standalone:
My HTML (popup window with scrollbar inside)
<div id="formula-popup" class="popup-window">
<div>
<a onclick="closeFormulaWindow()" title="Close" class="close">X</a>
<span id="ftitle" class="title1"></span>
<form method="post" id="formulaform" name="edit">
<span>Current Formula</span>
<p id="current-formula" class="formula">Existing formula</p>
<input id="id-passer" type="hidden" name="formula-id" value="">
<!--sort out horizontal scrollbar from bookmarks here later-->
<input onclick="refreshWindow()" name="edit-formula" type="submit" value="Confirm">
</form>
<div class="h-scrollbar">
<section class="h-scrollbar-container">
<div class="outer-wrapper">
<div class="inner-wrapper">
<div class="pseudo-item"></div>
<div class="pseudo-item"></div>
<div class="pseudo-item"></div>
<div class="pseudo-item"></div>
<div class="pseudo-item"></div>
<div class="pseudo-item"></div>
</div>
</div>
<div class="pseudo-track"></div>
</section>
</div>
</div>
My CSS:
.scrollbar-container {
display: flex;
flex-direction: row;
}
.h-scrollbar {
display: flex;
max-width: 30vw;
padding: 0px 10px;
height: 20vh;
align-items: center;
justify-content: center;
overflow: hidden;
flex-shrink: 0;
}
.h-scrollbar-container {
width: 100%;
}
.outer-wrapper {
max-width: 100vw;
overflow-x: scroll;
position: relative;
scrollbar-color: #d5ac68 #f1db9d;
scrollbar-width: thin;
-ms-overflow-style: none;
}
.pseudo-track {
background-color: #f1db9d;
height: 2px;
width: 100%;
position: relative;
top: -3px;
z-index: -10;
}
.outer-wrapper::-webkit-scrollbar {
height: 5px;
}
.outer-wrapper::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 0px rgba(0, 0, 0, 0);
}
.outer-wrapper::-webkit-scrollbar-thumb {
height: 5px;
background-color: #d5ac68;
}
.outer-wrapper::-webkit-scrollbar-thumb:hover {
background-color: #f1db9d;
}
.outer-wrapper::-webkit-scrollbar:vertical {
display: none;
}
.inner-wrapper {
display: flex;
padding-bottom: 10px;
}
.pseudo-item {
height: 30px;
width: 80px;
margin-right: 15px;
flex-shrink: 0;
background-color: gray;
}
.pseudo-item:nth-of-type(2n) {
background-color: lightgray;
}
.popup-window {
position: fixed;
font-family: Arial, sans-serif;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0, 0, 0, 0.8);
z-index: 9999;
display: none;
}
.popup-window div {
width: 40vw;
height: 30vw;
position: relative;
margin: 10% auto 30%;
border-radius: 10px;
background: #213B54;
padding-top: 2vh;
padding-left: 1vw;
padding-right: 1vw;
padding-bottom: 2vh;
display: flex;
flex-direction: column;
}
.close {
font: Arial, sans-serif;
background: #067A9F;
color: #B5E5E7;
line-height: 25px;
position: absolute;
right: -12px;
text-align: center;
top: -10px;
width: 24px;
text-decoration: none;
font-weight: bold;
border-radius: 12px;
box-shadow: 1px 1px 3px #000;
cursor: pointer;
}
.popup-window div .title1 {
font-family: Arial, sans-serif;
font-weight: normal;
font-size: 36px;
color: #EE6802;
align-self: center;
}
.popup-window form input[type=submit]:hover {
opacity: 0.8;
}
.popup-window form span {
color: #EE6802;
font-size: 22px;
}
.popup-window form {
display: flex;
flex-direction: column;
font-family: Arial, sans-serif;
}
.popup-window form span, input {
width: 100%;
}
.popup-window form input[type=submit] {
width: 20%;
background-color: #067A9F;
color: #213B54;
padding: 14px 0;
cursor: pointer;
border: none;
}
I found the solution, it was that I forgot to select an element inside the window properly and instead it was selecting all divs and so overriding the CSS properties.
I have a Text Messaging Mobile Site App that has the following divisions and CSS
.messageDisplay {
background-color: #ffffff;
position: absolute;
z-index: 99999;
height: 100%;
width: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow-y: hidden;
overflow-x: hidden;
visibility: hidden;
display: flex;
flex-direction: column;
justify-content: space-between;
transform: translateY(100%);
}
.messageDisplayHeader {
display: flex;
padding-top: 0.5em;
padding-bottom: 0.5em;
padding-left: 1em;
padding-right: 1em;
align-items: center;
background-color: #ffffff;
position: relative;
box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
}
.messageDisplayTextboxArea {
height: 3.5em;
position: relative;
box-shadow: rgb(0 0 0 / 16%) 0px -1px 4px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding-left: 0.5em;
padding-right: 0.5em;
padding-top: 0.2em;
padding-bottom: 0.2em;
background-color: #000000;
}
.messageTextbox {
resize: none;
height: 2.5em;
width: calc(100% - 14%);
background-color: #fef3f1;
border: none;
border-radius: 100px;
padding-left: 1em;
padding-top: 0.5em;
padding-right: 1em;
color: #fc768a;
}
<div class="messageDisplay" id="messageDisplay">
<div class="messageDisplayHeader"></div>
<div class="messageDisplayBody" id="messageDisplayBody">
</div>
<div class="messageDisplayTextboxArea" id="messageDisplayTextboxArea">
<textarea id="messageTextbox" class="messageTextbox" maxlength="300" placeholder="Type a message"></textarea>
<div class="messageSendBtn" id="messageSendBtn">
<i data-feather="chevron-right"></i>
</div>
</div>
</div>
When using an IOS Device to focus in on the textarea the whole page shifts up.
When the textarea is focused out, the page stays shifted upwards.
I tried to solve this by doing the following:
var messageTextBoxEle = document.getElementById('messageTextbox');
messageTextBoxEle.onfocus = function(){
window.scrollTo(0, 0);
document.body.scrollTop = 0;
}
Right now it behaves as such
I also tried setting the page's margin-bottom:0; when the textarea is focused out but it doesnt seem to work.
Anyone have suggestions?
I'm designing a blog post preview tile for my personal website. Whatever I try to do, there is always a gap between the image and its own bottom border, or a gap between the image and the border of the container. It appears on mobile, when zooming, and when scaling. It's a really simple design and I'm going crazy and can't figure out how to get it to work. I know it's related to sub pixel rendering issues. Please help me! I would either like the gap gone or to render as the same color as the border so it doesn't look jank.
body {
background: rgba(255, 225, 172, 1);
display: grid;
grid-template-rows: [row-start] 1fr [row-end row2-start] 6fr [row2-end row3-start] 1fr [row3-end];
grid-template-columns: [col-start] 1fr [col-end];
row-gap: 60px;
padding-left: 120px;
padding-right: 120px;
}
.blog_preview_container {
grid-row: 2;
grid-column: 1;
height: 354px !important;
display: flex;
flex-flow: row wrap;
justify-content: space-between;
}
.blog_preview_titlecard {
height: 352px;
width: 272px;
}
.blog_tile {
height: 340px !important;
width: 240px !important;
margin: 1px;
background-color: white;
border: 6px solid black;
box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.65);
color: white;
display: inline;
overflow: hidden;
cursor: pointer;
transform: scale(1);
}
.blog_tile:hover {
transform: scale(1.05);
}
.blog_tile_image {
display: block;
border-bottom: 6px solid black;
}
.blog_tile_text {
height: 138px;
font-family: 'nunito', sans-serif;
font-size: 1rem;
font-weight: 900;
margin: 0;
padding: 16px;
}
<body>
<div class="blog_preview_container">
<img class="blog_preview_titlecard" src="https://example.com/titlecard_location">
<div class="blog_tile">
<img class="blog_tile_image" src="https://example.com/img_location">
<p class="blog_tile_text">Text Goes Here</p>
</div>
</div>
</body>
I play with this image and it seems like you can just change the background-color of your blog_tile as black will remedy it.
body {
background: rgba(255, 225, 172, 1);
display: grid;
grid-template-rows: [row-start] 1fr [row-end row2-start] 6fr [row2-end row3-start] 1fr [row3-end];
grid-template-columns: [col-start] 1fr [col-end];
row-gap: 60px;
padding-left: 120px;
padding-right: 120px;
}
.blog_preview_container {
grid-row: 2;
grid-column: 1;
height: 354px !important;
display: flex;
flex-flow: row wrap;
justify-content: space-between;
}
.blog_preview_titlecard {
height: 352px;
width: 272px;
}
.blog_tile {
height: 340px !important;
width: 240px !important;
margin: 0px;
border: 6px solid black;
box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.65);
color: white;
background-color: white;
}
.blog_tile:hover {
transform: scale(1.05);
margin-top: 0px;
background-color: black;
}
.blog_tile img {
height: 340px;
width: 242px;
object-fit: cover;
margin: -1px 0px 0px -1px;
}
.blog_tile_image {
display: block;
border-bottom: 6px solid black;
}
.blog_tile_text {
height: 138px;
font-family: 'nunito', sans-serif;
font-size: 1rem;
font-weight: 900;
margin: 0;
padding: 16px;
color: white;
}
<body>
<div class="blog_preview_container">
<img class="blog_preview_titlecard" src="https://media.istockphoto.com/photos/picturesque-morning-in-plitvice-national-park-colorful-spring-scene-picture-id1093110112?k=20&m=1093110112&s=612x612&w=0&h=3OhKOpvzOSJgwThQmGhshfOnZTvMExZX2R91jNNStBY=">
<div class="blog_tile">
<img class="blog_tile_image" src="https://media.istockphoto.com/photos/picturesque-morning-in-plitvice-national-park-colorful-spring-scene-picture-id1093110112?k=20&m=1093110112&s=612x612&w=0&h=3OhKOpvzOSJgwThQmGhshfOnZTvMExZX2R91jNNStBY=">
<p class="blog_tile_text">Text Goes Here</p>
</div>
</div>
</body>
Here's a stripped down example that doesn't involve hard-coding any colors. It uses an absolutely positioned psuedo-element with a border that is overlaid above the image. The container is given a padding amount that is 1px smaller than the border width so it is rendered underneath it. The bottom border of the <img> is then relocated to the top of the <p> below it and the image is given a bottom margin of -1px.
*, *::after, *::before { box-sizing: border-box; }
body {
background: rgba(255, 225, 172, 1);
display: grid;
align-items: center;
justify-content: center;
}
.blog_tile {
position: relative;
display: grid;
grid-template-rows: max-content 1fr;
height: 340px;
width: 240px;
padding: 5px;
background-color: white;
box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.65);
color: white;
cursor: pointer;
overflow: hidden;
}
.blog_tile::after {
content: "";
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
border: 6px solid black;
}
.blog_tile:hover {
transform: scale(1.05);
}
.blog_tile img {
display: block;
margin-bottom: -1px;
object-fit: cover;
line-height: 0;
white-space: collapse;
}
.blog_tile p {
margin: 0; padding: 3px;
border-top: 6px solid black;
color: black;
}
<div class="blog_tile">
<img src="https://picsum.photos/300">
<p> TESTING </p>
</div>
Try this may be it will help.
img {
object-fit: contain;
}
I fixed this by having the tile background color match the border color, and then setting the background of the text with my script instead of background color of the tile. That way when gaps are created it matches the border color and doesn't look weird. Now it looks correct at all scales. it doesn't handle non-cropped images but all the images pulled are autocropped to the correct size in my PHP.
window.onload = () => {
var colors = ['#ffffff', '#ffbd4b', '#ff634b', '#4b9fff'];
var nowhitecolors = ['#ffbd4b', '#ff634b', '#4b9fff'];
document.querySelectorAll('.blog_tile').forEach(
el => {
var randcolor = colors[Math.floor(Math.random() * colors.length)];
el.style.backgroundColor = '#ffffff';
el.children[1].style.backgroundColor = randcolor;
if (randcolor ==='#ffffff') {
var randnowhitecolors = nowhitecolors[Math.floor(Math.random() * nowhitecolors.length)];
el.style.borderColor = randnowhitecolors;
el.children[0].style.borderColor = randnowhitecolors;
el.style.backgroundColor =randnowhitecolors;
el.style.color = randnowhitecolors;
};
}
);
};
.blog_preview_container {
grid-row: 2;
grid-column: 1;
height: 354px;
display: flex;
flex-flow: row wrap;
justify-content: center;
column-gap: 40px;
row-gap: 40px;
}
.blog_tile {
height: 340px;
width: 240px;
margin-top: 0px;
border-width: 6px;
border-style: solid;
border-radius: 6px;
box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.65);
color: white;
display: inline;
cursor: pointer;
transform: scale(1);
}
.blog_tile:hover {
transform: scale(1.04);
}
.blog_tile img {
height: 164px;
width: 240px;
padding: 0px;
margin: 0px;
object-fit: cover;
border-bottom-width: 6px;
border-bottom-style: solid;
}
.blog_tile p {
height: 138px;
font-family: 'nunito', sans-serif;
font-size: 1rem;
font-weight: 900;
line-height: 22px;
margin: 0;
padding: 16px;
}
<body>
<div class="blog_preview_container">
<div class="blog_tile">
<img class="blog_tile_image" src="https://example.com/img_location">
<p class="blog_tile_text">Text Goes Here</p>
</div>
</div>
</body>
Looks great at all screen sizes, no more gaps!
Im trying to remove the white space that is remaining on the right hand side of the screen. Ive tried setting the css stylings to the container to padding 0 and margin 0 including the important tag after. I do have a div sized col 4 and in the inspector tool its shwoing padding 12 but when i apply 0 padding to it, its still there causing side scroll. Ive even applied the important tag to it and it still remains. Below is the live link of the website im working on. Ill include the CSS code below. https://abraham-solis.github.io/reactPortfolio/. This is the styling library im using https://reactstrap.github.io/?path=/story/home-installation--page
Landing Page CSS
.hide {
background: black;
overflow: hidden;
}
/* Spans are inline Elements so need Display inline-block to move */
.hide span {
transform: translateY(100%);
-webkit-transform: translateY(100%);
-moz-transform: translateY(100%);
-ms-transform: translateY(100%);
-o-transform: translateY(100%);
display: inline-block;
}
#GG {
text-decoration: none;
color: inherit;
}
.space {
margin: 0 !important;
padding: 0 !important;
}
#media screen and (max-width:600px) {
.land {
max-width: 100%;
max-height: 100%;
}
.big-text {
text-align: center;
}
.nav-links li {
padding-left: 0;
text-align: center;
justify-content: space-around;
padding-right: 3px;
}
ul{
padding-left: 0 !important;
}
#logo{
text-align: center;
padding-bottom:10px ;
}
.intro-text, .text{
text-align: center;
}
}
Project Section CSS
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.bg {
background-color: rgb(15, 39, 63);
width: 100%;
overflow: hidden;
}
.header {
text-align: center;
padding-left: 10rem;
padding-top: 9rem;
margin-bottom: 80px;
font-size: 5rem;
font-family: "Lobster", cursive;
color: rgb(255, 249, 254);
text-shadow: 2px 2px #ff24a4;
text-align: center;
filter: drop-shadow(5px 5px 5px black);
-webkit-filter: drop-shadow(5px 5px 5px black);
}
.title {
font-family: "Heebo", sans-serif;
font-size: 2rem;
color: rgb(15, 39, 63);
}
.summary {
font-family: "Heebo", sans-serif;
font-size: 1rem;
color: rgb(15, 39, 63);
}
#media only screen and (max-width: 600px) {
.container {
width: 100%;
max-width: 100%;
height: 100%;
max-height: 100%;
margin: 0;
padding: 0;
}
.header {
text-align: center;
}
.paragraph {
text-align: center;
}
.z{
z-index: 5;
}
}
.stretch{
min-width: 100% !important;
}
In the about me section, you got margins that are overflowing. Look for the .row class and check the calculation you are doing.
This:
.row {
--bs-gutter-x: 1.5rem;
--bs-gutter-y: 0;
display: flex;
flex-wrap: wrap;
margin-left: calc(var(--bs-gutter-x)*-.5);
margin-right: calc(var(--bs-gutter-x)*-.5);
margin-top: calc(var(--bs-gutter-y)*-1);
}
Change to for example (or edit calc so it's not overflowing):
.row {
--bs-gutter-x: 1.5rem;
--bs-gutter-y: 0;
display: flex;
flex-wrap: wrap;
margin-left: 0px;
margin-right: 0px;
margin-top: calc(var(--bs-gutter-y)*-1);
}
I can not see your html code but problem in your div which has class name as row
You could make the scrollbar invisible using
.[insert div name]::-webkit-scrollbar
{
display: none;
}
Disable margin-left and margin-right properties of .row class.
Source : https://www.w3schools.com/howto/howto_css_hide_scrollbars.asp
You will need CSS and you have 2 options:
Option #1) Hide both the horizontal and vertical scrollbar.
Add overflow: hidden; to the body
Option #2) Hide Scrollbars But Keep Functionality
Hide scrollbar for Chrome, Safari and Opera
.example::-webkit-scrollbar {
display: none;
}
Hide scrollbar for IE, Edge and Firefox
.example {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
I am trying to make my headers contents (the logo and the white text) inline with the content class below where the logo is floating to the left and the text to the right but I am unable to do so since flexbox seems to be disallowing something, I just need help to figure this out.
Navigation Bar:
body {
background-color: #000000;
height: 100%;
margin: 0;
top: 0;
line-height: 160%;
position: relative;
font-family: Tahoma, Arial, Sans Serif;
font-size: 16px;
color: rgba(250, 250, 210, 0.6);
box-sizing: border-box;
overflow-y: hidden;
}
.navigationBar {
background: rgba(0, 0, 0, 0.8);
padding: 20px;
height: 35px;
width: 100%;
position: fixed;
box-shadow: 0px 3px 5px #000;
color: white;
font-size: 38px;
font-family: BurbankBigCondensed-Black, sans-serif;
top: 0;
display: -webkit-box;
/* OLD - iOS 6-, Safari 3.1-6, BB7 */
display: -ms-flexbox;
/* TWEENER - IE 10 */
display: -webkit-flex;
/* NEW - Safari 6.1+. iOS 7.1+, BB10 */
display: flex;
/* NEW, Spec - Firefox, Chrome, Opera */
align-items: center;
justify-content: center;
}
.navigationLogo {
color: #ffa500;
float: left;
margin-right: 1000px;
}
.wrapper {
margin-top: 75px;
width: 100%;
overflow-y: auto;
height: calc(100vh - 75px);
position: fixed;
}
.content {
padding-top: 25px;
margin-left: auto;
margin-right: auto;
min-height: 1500px;
background: rgba(0, 0, 0, 0.5);
width: 1130px;
padding-left: 20px;
padding-right: 20px;
/*border-left: 1px solid #080808;*/
/*border-right: 1px solid #080808;*/
}
.navigationItem {
margin-right: 20px;
}
<div class="navigationBar">
<div class="navigationLogo">Fortnite
<font color="#ffae19">Pro</font>
<font color="#ffb732">Snipes</font>
</div>
<div class="navigationItem">EU</div>
<div class="navigationItem">NAE</div>
<div class="navigationItem">NAW</div>
</div>
<div class="wrapper">
<div class="content">
...
</div>
</div>