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 */
}
Related
I've been reading non-stop about sizing and I still cannot seem to apply it to my code. I figured out that padding was causing my HTML table to overflow, but that it can be stopped with box-sizing: border-box;
So I added border-box to the elements I thought needed it, then to everything, trying to change width settings, but to no avail. When I remove border-box my header and navbar are affected, but the html table overflows the screen no matter what.
All my elements seem to fit on the screen perfectly fine, except the table. I assume that it is something I added that it countering the box sizing, but I commented out lines one by one and didn't find anything.
I put the full code into fiddle: https://jsfiddle.net/atpzw32L/
The CSS in question:
html, body, h1 {
margin: 0;
padding: 0;
}
html, body { min-height: 100%; }
body{
background-image: url("agaricus.png");
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
font-size: 100%;
padding: 20px;
box-sizing: border-box;
font-family: Arial, Helvetica, sans-serif;
margin: 0;
width: 100%;
}
/* Style the header */
.header {
padding: 10px;
text-align: center;
background: #832bfd7c;
color: white;
}
/* Increase the font size of the h1 element */
.header h1 {
font-size: 40px;
}
/* Style the top navigation bar */
.navbar {
overflow: hidden;
background-color: #333;
margin-bottom: 20px;
}
/* Style the navigation bar links */
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 14px 20px;
text-decoration: none;
}
/* Right-aligned link */
.navbar a.right {
float: right;
}
/* Change color on hover */
.navbar a:hover {
background-color: #ddd;
color: black;
}
/* CSS to hide key columns */
th:nth-child(4), th:nth-child(5), th:nth-child(6), th:nth-child(8), th:nth-child(11), th:nth-child(12), th:nth-child(13), th:nth-child(15) {
display: none
}
td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(8), td:nth-child(11), td:nth-child(12), td:nth-child(13), td:nth-child(15) {
display: none
}
/* CSS for checkboxes*/
.dropdown-check-list {
display: inline-block;
position: relative;
font-family: Verdana, sans-serif;
padding: 5px;
margin-top: 10px;
background-color: rgb(255, 255, 255);
}
.dropdown-check-list .anchor {
position: relative;
cursor: pointer;
display: inline-block;
padding: 5px 50px 5px 10px;
border: 1px solid #ccc;
min-width: 100px;
}
.dropdown-check-list .anchor:after {
position: absolute;
content: "";
border-left: 2px solid black;
border-top: 2px solid black;
padding: 5px;
right: 10px;
top: 20%;
-moz-transform: rotate(-135deg);
-ms-transform: rotate(-135deg);
-o-transform: rotate(-135deg);
-webkit-transform: rotate(-135deg);
transform: rotate(-135deg);
}
.dropdown-check-list .anchor:active:after {
right: 8px;
top: 21%;
}
.dropdown-check-list ul.items {
padding: 5px;
display: none;
margin: none;
border: 1px solid #ccc;
border-top: none;
position: absolute;
background-color: #f1f1f1;
}
.dropdown-check-list ul.items li {
list-style: none;
padding: 5px;
}
.dropdown-check-list.visible .anchor {
color: #0094ff;
}
.dropdown-check-list.visible .items {
display: block;
}
input {
float: right;
height: 18px;
width: 18px;
}
/* CSS for table */
table, th, td {
border: 2px solid;
box-sizing: border-box;
}
table {
border-collapse: collapse;
margin-top: 30px;
font-family: Verdana, sans-serif;
padding: 15px;
background-color: rgb(255, 255, 255);
}
th{
text-align: center;
height: 80px;
vertical-align: bottom;
padding: 2px;
border-bottom: 4px solid rgb(0, 0, 0);
font-size: 16px;
background-color: rgba(4, 100, 156, 0.278);
}
td {
text-align: center;
height: 100px;
width: 90%;
padding: 15px;
}
/* th{
text-align: center;
height: 100px;
vertical-align: bottom;
padding: 15px;
border-bottom: 4px solid rgb(0, 0, 0);
font-size: 16px;
background-color: rgba(4, 100, 156, 0.278);
} */
/*
td{
text-align: center;
height: 100px;
vertical-align: left;
padding: 15px;
font-size: 15px;
} */
tr:hover {background-color: rgba(4, 100, 156, 0.089);}
I aim for my end result to have all columns visible, and the table fitting within the screen, so when I add padding to the table it will fit within the screen. I would also like to keep the padding within th and td.
Please let me know how to go about this, I am out of ideas. Thank you
Concerning the width and the horizontal overflow of your table, this is simply caused by its contents: The cells (for example the header cells) contain (single) words that stretch the width of those cells (and therefore the columns) to fit into them, and so the overall width of the table becomes as wide as it is. Examples are the words "description", "information" and "identification" in the header cells.
Words won't be divided automatically, so those wordlenghts determine your minimum widths, expanding the column width and therefore the overall width of the table.
There are three methods to change that:
1.) (IMO the best) Use a smaller font size for the text. That way those longer words and with them the cells and columns won't be that wide and (maybe) fit into the screen.
2.) (also okay) Use hyphenation: Apply hyphens: auto; to td and th. The automatic hyphenation will divide words at know possible hyphenation positions.
3.) (IMO a bad solution) Apply word-break: break-word; to the cells. This will divide longer words, but at "incorrect" positions, i.e. simply at the end of the given cell width. As I wrote, not good, only to be used if nothing else works.
I would combine methods #1 and #2.
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!
I have an input element which has a padding of 1em on both the left and the right side. But I have applied "box-sizing: border-box" to it. However, It's width is still more than the other elements. I think it might be because I need to remove some piece of code but I'm not sure. The input element is definitely the one issue as the other element is properly center aligned.
Below is the code:
:root {
--main-color: #00308f;
--secondary-color: #7cb9e8;
--dark-color: #444;
--light-color: #fafafa
}
body {
font-family: Montserrat, sans-serif;
background-color: var(--light-color);
color: var(--dark-color);
text-align: justify;
margin-top: 70px;
margin-left: 0;
margin-right: 0;
margin-bottom: 0;
padding: 1em
}
.my-contacts-div {
align-items: center
}
.contacts-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center
}
.contact-card {
width: 288px;
margin: .5em;
border-radius: .5em;
box-shadow: var(--secondary-color) 1px 1px 10px;
padding: 0 .75em;
word-wrap: break-word
}
.contact-form {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: grid;
align-self: center;
width: 350px;
z-index: 1;
background-color: var(--secondary-color);
border-radius: 1em;
padding: 1em;
box-shadow: 1px 1px 1.5em var(--main-color);
visibility: hidden
}
.contact-form:target {
visibility: visible
}
.input-field {
margin: .5em 0;
border: solid 1px var(--secondary-color);
border-radius: .5em;
padding: 0 1em;
height: 40px;
box-sizing: border-box
}
.searchbar {
margin: .5em;
width: 100%
}
#media screen and (max-width:687px) {
.my-contacts-div {
padding: 0
}
.contact-card {
width: 100%
}
}
#media screen and (max-width:614px) {
body {
margin-top: 130px
}
}
<div class="my-contacts-div">
<h2>Heading</h2>
<form><input class="input-field searchbar" type="text" placeholder="Search here..."></form>
<div class="contacts-list">
<div class="contact-card">
<h3>Other component</h3>
</div>
</div>
</div>
What is wrong with it?
The issue was most likely that when you were using '.input-field' in the CSS, it was maybe not correctly using it so I just put 'form input.input-field' and also added some CSS to the form element. Now it is looking completely aligned.
:root {
--main-color: #00308f;
--secondary-color: #7cb9e8;
--dark-color: #444;
--light-color: #fafafa
}
body {
font-family: Montserrat, sans-serif;
background-color: var(--light-color);
color: var(--dark-color);
text-align: justify;
margin-top: 70px;
margin-left: 0;
margin-right: 0;
margin-bottom: 0;
padding: 1em
}
.my-contacts-div {
align-items: center
}
.contacts-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center
}
.contact-card {
width: 288px;
margin: .5em;
border-radius: .5em;
box-shadow: var(--secondary-color) 1px 1px 10px;
padding: 0 .75em;
word-wrap: break-word
}
.contact-form {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: grid;
align-self: center;
width: 350px;
z-index: 1;
background-color: var(--secondary-color);
border-radius: 1em;
padding: 1em;
box-shadow: 1px 1px 1.5em var(--main-color);
visibility: hidden
}
.contact-form:target {
visibility: visible
}
form input.input-field {
margin: .5em 0;
border: solid 1px var(--secondary-color);
border-radius: .5em;
padding: 0 1em;
height: 40px;
box-sizing: border-box;
}
form {
box-sizing: border-box;
padding: 0 0.5em;
}
.searchbar {
margin: .5em;
width: 100%
}
#media screen and (max-width:687px) {
.my-contacts-div {
padding: 0
}
.contact-card {
width: 100%
}
}
#media screen and (max-width:614px) {
body {
margin-top: 130px
}
}
<div class="my-contacts-div">
<h2>Heading</h2>
<form><input class="input-field searchbar" type="text" placeholder="Search here..."></form>
<div class="contacts-list">
<div class="contact-card">
<h3>Other component</h3>
</div>
</div>
</div>
Add display: flex in the tag. It will solve the overflowing issue.
display: flex fills the entire container taking margin and padding into consideration. That's why it didn't overflow.
display: block is at 100% width by default and then adds margin and padding after causing the overflow.
On my website: HQ
There seems to be an issue where if you try to hover over the top section, under where it says files, you will not be able to hover over the image to go to the link. BUT, if you try on the bottom section of the videos you are able too. What did I do wrong? I am currently looking for an answer. So if anyone can help, I appreciate it. I really do. I am a noob. I know. Lol.
By the way, there's a hint (to me it's a hint) if you hover over the WORDS of the top section, you can click. So I guess that's my clue.
Please tell me what I can do to make my question helpful to anyone, I am new at this.
I tried to see if I misspelled or missed something in my HTML, I am moving on to my CSS:
/* Projects section */
.projects-section {
text-align: center;
padding: 10rem 2rem;
background: black;
}
.projects-section-header {
max-width: 640px;
margin: 0 auto 6rem auto;
border-bottom: 0.2rem solid black;
}
#media (max-width: 28.75em) {
.projects-section-header {
font-size: 4rem;
}
}
/* "Automagic" image grid using no media queries */
.projects-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
grid-gap: 4rem;
width: 100%;
max-width: 1280px;
margin: 0 auto;
margin-bottom: 6rem;
}
#media (max-width: 30.625em) {
.projects-section {
padding: 6rem 1rem;
}
.projects-grid {
grid-template-columns: 1fr;
}
}
.project {
background: black;
box-shadow: 1px 1px 2px rgb(255, 0, 0);
border-radius: 13px;
}
.code {
color: var(--main-white);
transition: color 0.3s ease-out;
}
.project.code:hover {
color: #00ff22;
}
.project-image {
height: calc(100% - 6.8rem);
width: 100%;
object-fit: cover;
}
.project-title {
font-size: 2rem;
padding: 2rem 0.5rem;
}
.btn {
display: inline-block;
padding: 1rem 2rem;
border-radius: 2px;
}
.btn-show-all {
font-size: 2rem;
background: black;
transition: background 0.3s ease-out;
}
.btn-show-all:hover {
background: red;;
}
.btn-show-all:hover > i {
transform: translateX(2px);
}
.btn-show-all > i {
margin-left: 10px;
transform: translateX(0);
transition: transform 0.3s ease-out;
}
Your video container is overlapping your links. Add this to your CSS
.video-container {
height: 50%;
}
<style>
.example {
width: 100%;
height: 300px;
background: #DDD;
}
.example:hover {
width: 88%;
height: 300px;
background: grey;
transform: translated(10px);
}
</style>
<div class="example">
<p> Just put your mouser here and watch it change! </p>
</div>
It is simple, you just need the :hover bit!
The .video-container height is partially overlapping the #welcome-section. This problem could be fix it in many ways.
For example, you can adjust the .video-container height or just simply add pointer-events: none; to the .video-container class if you don't want to click on it.
I have a full screen background video which I have added a "dimmed" div over the top of, to dim the video with a semi-transparent black fullscreen div. Code:
.dimmed:after {
content: " ";
z-index: 10;
display: block;
position: absolute;
height: 100%;
top: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, .5);
}
HTML:
<div class="full_size dimmed">
<video autoplay loop poster="assets/images/home_page/polina.jpg" id="bgvid">
<!--<source src="polina.webm" type="video/webm">-->
<source src="assets/videos/polina.mp4" type="video/mp4">
</video>
<div class="not_dimmed">
{{APP_NAME}}</h5>
{{REGISTER_TEXT}}</h5>
{{LOGIN_TEXT}}</h5>
<a href="#home_page_footer" ><h5 class="nav-item clickable white-text medium-text right-text" >{{BLOG_TEXT}}</h5></a>
</div>
</div>
I want the anchor text that I have placed over the top of the video background to not be dimmed. As you can see I have added a not_dimmed class and tried to override the dimmed styles with no dimming.
However it is still dimmed. How would I "undim" the text?
All css:
.vertical-center {
height: 100%;
/*Fallback for vh unit
You might also want to use
'height' property instead.
Note that for percentage values of
'height' or 'min-height' properties,
the 'height' of the parent element
should be specified explicitly.
In this case the parent of '.vertical-center'
is the <body> element */
/* Make it a flex container */
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
/* Align the bootstrap's container vertically */
-webkit-box-align : center;
-webkit-align-items : center;
-moz-box-align : center;
-ms-flex-align : center;
align-items : center;
/* In legacy web browsers such as Firefox 9
we need to specify the width of the flex container */
width: 100%;
/* Also 'margin: 0 auto' doesn't have any effect on flex items in such web browsers
hence the bootstrap's container won't be aligned to the center anymore.
Therefore, we should use the following declarations to get it centered again */
-webkit-box-pack : center;
-moz-box-pack : center;
-ms-flex-pack : center;
-webkit-justify-content : center;
justify-content : center;
flex-wrap: wrap;
flex-direction: column;
}
/*large text on the home page*/
#motto-text {
height: calc(100% - 160px);
/*font-family: 'woodford_bourneregular', Arial, sans-serif;
font-weight: 100;*/
}
.white-text {
color: white;
}
.brand-colour-text {
color: #95F666;
}
.light-text {
font-weight: 100;
}
.medium-text {
font-weight: 300;
}
/*text on the left side of the page*/
.left-text {
margin: 60px 0px 0px 60px; float: left;
}
/*text on the right side of the page*/
.right-text {
margin: 60px 60px 0px 0px; float: right;
}
.italic-text {
font-style: italic;
}
.clickable {
cursor: pointer;
}
.with-border {
border: 1px solid #95F666;
border-radius:3px;
padding: 12px;
}
#sign-in-button {
margin-top: 48px;
}
.nav-item:hover {
color: #95F666;
}
#app-name:hover {
color: white;
}
#sign-in-button:hover{
background-color: #95F666;
color: dimgray;
}
#media only screen and (max-width: 500px) {
h3 {
font-size: 17px;
}
h4 {
font-size: 13px;
}
h1 {
font-size: 20px;
}
#app-name {
display: none;
}
right-text {
margin: 60px 30px 0px 30px;
}
}
.full_size {
height: 100%;
background-size: cover;
}
/*subtract the height of the footer to get an accurate vertical center*/
#home_page_background {
height: calc(100% - 60px);
background-repeat: no-repeat;
background-attachment: fixed;
}
#media only screen and (orientation: landscape) {
#home_page_background {
background-image: url("../assets/images/home_page/bg_ls_strawberry_dark.jpg");
}
}
#media only screen and (orientation: portrait) {
#home_page_background {
background-image: url("../assets/images/home_page/bg_p_strawberry_dark.jpg");
}
}
.dimmed:after {
content: " ";
z-index: 10;
display: block;
position: absolute;
height: 100%;
top: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, .5);
}
.not_dimmed {
z-index: 11;
background: transparent;
}
video#bgvid {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
-ms-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
background: url(../assets/images/home_page/polina.jpg) no-repeat;
background-size: cover;
}
/*for ie 9*/
video { display: block; }
#media screen and (max-device-width: 800px) {
html {
background: url(../assets/images/home_page/polina.jpg) #000 no-repeat center center fixed;
}
#bgvid {
display: none;
}
}
You could apply the background-color-dim from the :after-element to the anchors' container instead.