THIS IS A RESPONSIVE DESIGN, MAKE SURE TO TURN ON TOGGLE DEVICE TOOLBAR ON YOUR BROWSER
I am trying to make a progress bar. First I want to increase the height of the transparent black background. I can't find a way to do that. I am confused. And secondly, I want to add spacing and align the 2nd and 3rd text properly.
/* progress bar */
.center {
height: 300px;
width: 100%;
position: absolute;
left: 50%;
margin-top: 140px;
transform: translate(-50%, -50%);
padding: 20px;
background-color: rgba(0, 0, 0, 0.678);
box-shadow: 0 2px 60px rgba(0, 0, 0, .5);
border-radius: 10px;
color: white;
}
.center #progress{
margin: 0px;
padding: 0;
color: #fff;
text-transform: uppercase;
letter-spacing: 8px;
border-radius: 20px;
height: auto;
background-color: rgba(0, 0, 0, 0);
}
.skillbar{
box-sizing: border-box;
width: 100%;
margin: 20px 0;
}
/* skillbar languages */
.skillbar-html p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-html p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skillbar-css p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-css p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skill_percentage{
background-color: #262626;
padding: 4px;
box-sizing: border-box;
border: 1px solid #0fffb7;
border-radius: 6px;
}
.skill_level{
background-color: #0fffb7;
width: 100%;
height: 10px;
border-radius: 6px;
}
<section>
<div class="center">
<h1 id="progress">Progress</h1>
<div class="skillbar-html">
<p>HTML</p>
<p>90%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 90%;"></div>
</div>
<div class="skillbar-css">
<p>CSS</p>
<p>70%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 80%;"></div>
</div>
<div class="skillbar-javascript">
<p>JavaScript</p>
<p>50%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 50%;"></div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</section>
</section>
You can take advantage of the <br> element in your HTML.
Line break and tab elements can be used when you need a little more control over how the browser renders the text. The <BR> element is used to force a line break.
-W3.org
/* progress bar */
.center {
height: 300px;
width: 100%;
position: absolute;
left: 50%;
margin-top: 140px;
transform: translate(-50%, -50%);
padding: 20px;
background-color: rgba(0, 0, 0, 0.678);
box-shadow: 0 2px 60px rgba(0, 0, 0, .5);
border-radius: 10px;
color: white;
}
.center #progress{
margin: 0px;
padding: 0;
color: #fff;
text-transform: uppercase;
letter-spacing: 8px;
border-radius: 20px;
height: auto;
background-color: rgba(0, 0, 0, 0);
}
.skillbar{
box-sizing: border-box;
width: 100%;
margin: 20px 0;
}
/* skillbar languages */
.skillbar-html p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-html p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skillbar-css p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-css p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skill_percentage{
background-color: #262626;
padding: 4px;
box-sizing: border-box;
border: 1px solid #0fffb7;
border-radius: 6px;
}
.skill_level{
background-color: #0fffb7;
width: 100%;
height: 10px;
border-radius: 6px;
}
<section>
<div class="center">
<h1 id="progress">Progress</h1>
<br>
<div class="skillbar-html">
<p>HTML</p>
<p>90%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 90%;"></div>
</div>
<br>
<div class="skillbar-css">
<p>CSS</p>
<p>70%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 80%;"></div>
</div>
<br>
<div class="skillbar-javascript">
<p>JavaScript</p>
<p>50%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 50%;"></div>
</div>
</div>
</div>
</div>
</div>
</section>
The Height: - I noticed a fixed height of 300px, and that you were centering the parent div by using margins and translations in your CSS. I went ahead and removed those margins and translations, also removed your absolute positioning. You can adjust your fixed height of 300px to expand the grey background. For this example, I made it 100 view height.
/* progress bar */
.center {
height: 100vh;
width: 100%;
padding: 20px;
position: relative;
background-color: rgba(0, 0, 0, 0.678);
box-shadow: 0 2px 60px rgba(0, 0, 0, .5);
border-radius: 10px;
color: white;
}
.center #progress{
margin: 0px;
padding: 0;
color: #fff;
text-transform: uppercase;
letter-spacing: 8px;
border-radius: 20px;
height: auto;
background-color: rgba(0, 0, 0, 0);
}
.skillbar{
box-sizing: border-box;
width: 100%;
margin: 20px 0;
}
/* skillbar languages */
.skillbar-html p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-html p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skillbar-css p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-css p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skill_percentage{
background-color: #262626;
padding: 4px;
box-sizing: border-box;
border: 1px solid #0fffb7;
border-radius: 6px;
}
.skill_level{
background-color: #0fffb7;
width: 100%;
height: 10px;
border-radius: 6px;
}
<section>
<div class="center">
<h1 id="progress">Progress</h1>
<br>
<div class="skillbar-html">
<p>HTML</p>
<p>90%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 90%;"></div>
</div>
<br>
<div class="skillbar-css">
<p>CSS</p>
<p>70%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 80%;"></div>
</div>
<br>
<div class="skillbar-javascript">
<p>JavaScript</p>
<p>50%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 50%;"></div>
</div>
</div>
</div>
</div>
</div>
</section>
If I understood properly, what you want to increase the height is for that black bar containing your actual progress bar, right? If that's the case, I think this should work:
.skill-percentage {
height: x (here you place how much height you want);
}
That should give you the height that you want.
And, in order to add the spacing, you can take advantage of CSS padding or margin, depending on what you exactly need.
I'll give you a small snippet here so you can see exactly what I mean. Note that I modified a bit your HTML to fit what you wanted to do, but this may not be necessary on your original file.
/* progress bar */
* {
margin: 0;
padding: 0;
}
.center {
height: 500px;
width: 100%;
background-color: rgba(0, 0, 0, 0.678);
color: white;
}
.center #progress{
margin: 0px;
padding: 0;
color: #fff;
text-transform: uppercase;
letter-spacing: 8px;
border-radius: 20px;
height: auto;
background-color: rgba(0, 0, 0, 0);
}
.skillbar{
box-sizing: border-box;
width: 100%;
margin: 0;
}
/* skillbar languages */
.text-container {
display: flex;
width: 100%;
justify-content: space-between;
}
.text-container p {
padding: 0 40px; /* this is the one that changes the position of your text. Be carefull, you don't want this to change the position too much, just a bit, if you need to change the full position, better try something like grid, or modifying the flex */
}
.skillbar-html {
display: flex;
flex-direction: column;
justify-content: center;
}
.skillbar-html p {
margin: 10px;
}
.skillbar-html > div {
margin: 10px;
}
.skillbar-css {
display: flex;
flex-direction: column;
justify-content: center;
}
.skillbar-css p {
margin: 10px;
}
.skillbar-css > div {
margin: 10px;
}
.skillbar-javascript {
display: flex;
flex-direction: column;
justify-content: center;
}
.skillbar-javascript p {
margin: 10px;
}
.skillbar-javascript > div {
margin: 10px;
}
.skill_percentage{
height: 20px; /* this is the one that changes your height, now it's changing nothing, but you can modify the height by changing this value */
background-color: #262626;
padding: 4px;
box-sizing: border-box;
border: 1px solid #0fffb7;
border-radius: 6px;
}
.skill_level{
background-color: #0fffb7;
width: 100%;
height: 10px;
border-radius: 6px;
}
<section>
<div class="center">
<h1 id="progress">Progress</h1>
<div class="skillbar-html">
<div class="text-container">
<p>HTML</p>
<p>90%</p>
</div>
<div class="skill_percentage">
<div class="skill_level" style="width: 90%;">
</div>
</div>
</div>
<div class="skillbar-css">
<div class="text-container">
<p>CSS</p>
<p>70%</p>
</div>
<div class="skill_percentage">
<div class="skill_level" style="width: 80%;">
</div>
</div>
</div>
<div class="skillbar-javascript">
<div class="text-container">
<p>JavaScript</p>
<p>50%</p>
</div>
<div class="skill_percentage">
<div class="skill_level" style="width: 50%;">
</div>
</div>
</div>
</div>
</section>
I'm trying to make a google clone page, I am trying to make the footer to be sticked to the end of the viewport. But when I try position: absolute bottom: 0, it sticks to the end, but the page overflows.
I tried to use html, body and * height: 100% but it doesn't work.
I share my github repository for you to check the code: https://github.com/Diefonro/HTML-CSS
You can also check the webpage (on a PC) at: https://diefonro.github.io/HTML-CSS/
Code:
<body>
<header>
<nav>
<div class="nav">
<div id="nav-g-i">
<a class="menu-item" href="#">Gmail</a>
<a class="menu-item" href="https://google.com/imghp">Images</a>
</div>
<div class="" id="nav-gr-a">
<div class="dd-cont">
<div class="grid">
<img
id="grid"
src="assets/icons/apps_black_24dp.svg"
alt="apps-icon"
/>
</div>
<div class="drop-d">
<div class="dd-item">
<img
id="dd-search"
src="assets/icons/google-logo-dd.png"
alt="google-search-icon"
/>
<p>Search</p>
</div>
<div class="dd-item">
<img
id="dd-maps"
src="assets/icons/google-maps-dd.png"
alt="google-maps-icon"
/>
<p>Maps</p>
</div>
<div class="dd-item">
<img
id="dd-keep"
src="assets/icons/google-keep-dd.png"
alt="google-keep-icon"
/>
<p>Keep</p>
</div>
<div class="dd-item">
<img
class="dd-drive"
src="assets/icons/Google_Drive_dd.png"
alt="google-keep-icon"
/>
<p>Drive</p>
</div>
<div class="dd-item">
<img
class="dd-calendar"
src="assets/icons/512px-Google_Calendar_icon_dd.png"
alt="google-calendar-icon"
/>
<p>Calendar</p>
</div>
<div class="dd-item">
<img
class="dd-photos"
src="assets/icons/google_photos-dd.png"
alt="google-photos-icon"
/>
<p>Photos</p>
</div>
</div>
</div>
<img
id="profile-pic"
src="assets/icons/account_circle_black_24dp.svg"
alt="account-icon"
/>
</div>
</div>
</nav>
</header>
<main>
<section>
<div class="logo-cont">
<img
id="google-logo"
src="assets/images/googlelogo_color_272x92dp.png"
alt="google-logo"
/>
</div>
<div class="input-cont">
<input class="input-g" type="text" />
<img
src="assets/icons/search_black_24dp.svg"
alt="search-icon"
class="search-i"
/>
<img
class="mic"
src="assets/icons/Google_mic.svg.png"
alt="voice-search-icon"
/>
</div>
<div class="btn-cont">
<button class="custom-btn">Google Search</button>
<button class="custom-btn custom-btn-l">I'm Feeling Lucky</button>
</div>
<span class="s-lang"
>Google offered in:
<a href="#" class="s-link"
><div class="ll">Español (Latinoamérica)</div></a
>
</span>
</section>
</main>
<footer>
<div class="footer-cont">
<div class="top-footer">
<span class="f1">Colombiac test</span>
</div>
<div class="bottom-footer">
<div class="left-footer">
<div class="a-li">
About
Advertising
Business
How Search works
</div>
</div>
<div class="right-footer">
Privacy
Terms
Settings
</div>
</div>
</div>
</footer>
</body>
* {
margin: 0;
}
html{
height: 100vh;
}
body {
font-family: Arial, sans-serif;
}
nav {
text-align: right;
position: relative;
top: 9px;
right: 8px;
}
#nav-g-i {
display: inline-block;
position: relative;
top: 2px;
right: 23px;
}
#nav-gr-a {
display: inline-block;
position: relative;
top: 5px;
right: 10px;
}
#grid,
#profile-pic {
opacity: 50%;
}
section {
text-align: center;
position: relative;
top: 24px;
}
.input-g {
position: relative;
bottom: 2px;
width: 500px;
line-height: 17px;
border: none;
outline: none;
}
.input-cont {
width: 553px;
height: 16px;
position: relative;
bottom: 2px;
right: 1px;
color: #222;
border: 1px solid #dfe1e5;
font-size: 13px;
padding: 14px;
border-radius: 80px;
margin: 24px 0px;
display: inline-block;
}
.input-cont:hover,
.input-cont:focus {
box-shadow: 0 1px 5px 0 rgba(32, 33, 36, 0.28);
border-color: rgba(40, 40, 41, 0);
}
.input-cont > img {
position: absolute;
top: 10px;
right: 11px;
width: 23px;
}
.input-cont .search-i {
position: absolute;
top: 11.5px;
right: 547px;
width: 20px;
opacity: 40%;
}
#grid {
position: relative;
bottom: 3px;
margin-right: 16px;
}
.menu-item {
font-size: 13px;
color: #5b5f63;
text-decoration: none;
position: relative;
bottom: 8px;
margin-right: 10px;
}
.menu-item:hover {
text-decoration: underline;
}
#profile-pic {
width: 32px;
height: 32px;
}
.btn-cont {
position: relative;
top: 3px;
}
.custom-btn {
background-color: #f2f2f291;
color: #a2a8af;
font-size: 14px;
height: 36px;
padding: 0 16px;
background-image: linear-gradient(top, #f5f5f5, #f1f1f1);
border: 1px solid transparent;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0);
color: #222;
border-radius: 5px;
}
.custom-btn:first-of-type {
margin-right: 7px;
}
.custom-btn:hover {
border: 1px solid #c6c6c656;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
color: #222;
}
.custom-btn:active {
border: 1px solid cornflowerblue;
}
.drop-d {
width: 285px;
padding: 10px;
border: 1px solid #ccc;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
text-align: center;
position: absolute;
right: 11px;
border-radius: 12px;
display: none;
}
.grid:hover {
display: inline-block;
}
.dd-item:hover {
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 8px;
}
.dd-item {
margin-top: 10px;
display: inline-block;
width: 70px;
padding: 6px 3px;
}
.dd-item > img {
height: 50px;
width: 50px;
}
.dd-item > p {
color: rgba(0, 0, 0, 0.87);
margin: 0;
margin-top: 15px;
margin-bottom: 5px;
}
.dd-cont {
display: inline-block;
}
.dd-cont:hover .drop-d {
display: block;
}
.s-lang {
font-size: 13px;
color: #333;
position: relative;
top: 30px;
right: 3px;
}
.s-lang a {
text-decoration: underline;
}
.s-lang a:visited {
color: rgb(30, 30, 179);
}
.ll {
display: inline-block;
position: relative;
left: 3px;
}
.top-footer,
.bottom-footer {
font-size: 15px;
background-color: #d6d8da49;
color: #8a8686;
position: relative;
top: 200px;
}
.top-footer{
border-bottom: 1px solid rgba(155, 155, 155, 0.267);
}
.left-footer a {
display: inline-block;
text-decoration: none;
padding: 12px;
font-size: 14px;
}
.right-footer a {
font-size: 14px;
padding: 14px;
text-decoration: none;
color: #8a8686;
}
.bottom-footer{
display: flex;
justify-content: space-between;
align-items: center;
}
.bottom-footer a:hover{
text-decoration: underline;
}
span.f1 {
display: inline-block;
margin-left: 15px;
padding: 16px;
}
.a-li {
margin-left: 20px;
}
a:visited {
color: inherit;
}
.footer-cont {
position: absolute;
bottom: 0;
width: 100%;
left: 0;
height: fit-content;
height: -moz-fit-content;
}
footer{
position: relative;
width: 100vw;
}
You can remove top: 200px on .top-footer, .bottom-footer. Why? because you have added bottom: 0 to .footer-cont which increases its position to 0 (.footer-cont) + 200px (.top-footer, .bottom-footer) = 200px down. If scroll bars in vertical bother you, you can add overflow-y: hidden style to body or html.
html, body {
background-color: #E3E3E3;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
/* HOME */
.section1 {
background: url("../images/laptop-table1920-gray.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-size: cover;
background-attachment: scroll;
width: 100%;
height: 100%;
}
.section1 .container {
background-color: rgb(0, 0, 0, 0.65);
min-height: -webkit-fill-available;
min-width: -webkit-fill-available;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.home-btn {
background-color: transparent;
font-weight: 500;
border-color: #8e0000;
border-radius: 3px;
color: #8e0000;
margin-top: 35px;
font-size: 1.12em;
transform:translate(-50%, -50%);
position: absolute;
text-shadow: .1px .8px 1px black;
-webkit-filter: drop-shadow(0px 3px 10px rgba(0,0,0,.8));
filter: drop-shadow(0px 0px 2px rgba(0,0,0,.8));
}
/* hover styling required !important */
.home-btn:hover {
color: #8e0000 !important;
border-color: #8e0000;
font-size: 1.4em;
border-width: 3px;
font-weight: 600;
text-shadow: .1px 2px 1px black;
-webkit-filter: drop-shadow(0px 3px 10px rgba(0,0,0,.8));
filter: drop-shadow(0px 0px 2px rgba(0,0,0,.8));
}
.intro {
color: white;
font-size: 2.74em;
text-shadow: .1px .8px 1px black;
}
.highlight {
color: #8e0000;
text-shadow: .1px .8px 1px black;
}
/* NAVIGATION */
#navbar {
}
.logo{
display: inline-flex;
flex-direction: row;
-webkit-filter: drop-shadow(0px 3px 10px rgba(0,0,0,.8));
filter: drop-shadow(0px 0px 2px rgba(0,0,0,.8));
}
.navbar-brand {
margin: 0px;
padding: 0px 0px !important;
}
#navbar .nav-link:focus {
color: #8e0000;
text-size-adjust: 1.4em;
}
.logo-wrapper {
color: white;
font-size: 1.4em;
font-family: 'Raleway', sans-serif;
text-shadow: .1px 2px 1px black;
}
.logo-spin{
-webkit-animation: spin 1s ;
animation: spin 3s ;
animation-iteration-count: 1;
}
#-webkit-keyframes spin{
0% {
-webkit-transform: rotateY(360deg);
}
100% {
-webkit-transform: rotateY(-360deg);
}
}
#keyframes spin{
from {
-moz-transform: rotateY(0deg);
-ms-transform: rotateY(0deg);
transform: rotateY(0deg);
}
to {
-moz-transform: rotateY(-360deg);
-ms-transform: rotateY(-360deg);
transform: rotateY(-360deg);
}
}
.navbar {
background-color: #333;
height: 65px;
border-bottom: 6px solid #212529;
border-top: 6px solid #212529;
}
#navbar {
z-index: 9999;
}
.navbar-text {
vertical-align: middle;
margin-left: 200px;
height: inherit;
}
#media only screen and (max-width: 860px) {
.navbar-text {
display: inline-block;
align-items: center;
margin-left: 30px;
}
}
#navbar a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 0px 20px;
text-decoration: none;
font-size: 1.2em;
font-family: 'Raleway', sans-serif;
text-shadow: .1px 1px 1px black;
/* margin-left: 40px; */
}
/* ABOUT */
#about {
overflow: hidden;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-size: cover;
width: 100%;
height: 100%;
text-shadow: .1px .8px 1px black;
position: relative;
height: -65px;
margin-top: 250px;
}
.section2 .row{
background: url("../images/improved-teamwork-and-collaboration_1887x741.jpg") center center no-repeat;
height: 100%;
width: 100%;
margin-left: 0px;
margin-right: 0px;
border-radius: 3px;
z-index: 1;
}
.section2 .card {
background-color: RGBA(33,37,41,.80);
color: white;
min-height: -webkit-fill-available;
height: 100%;
z-index: 2;
}
.section2 a {
color: #9b0000;
-webkit-filter: drop-shadow(.1px .8px 2px rgba(0,0,0, 0.8));
filter: drop-shadow(0px 0px 2px rgba(0,0,0, 0.8));
}
.section2 .card-block {
z-index: 3;
font-weight: 520;
width: 50%;
font-size: 25px;
line-height: 50px;
padding: 60px;
padding-right: 200px;
padding-left: 0px;
margin-left: 100px;
}
.section2 a:hover,
.section2 #skills:hover,
.section2 #projects:hover {
text-decoration: underline;
}
.section2 .btn {
border-color: #8e0000;
border-radius: 13px;
border-width: 3px;
font-weight: 500;
font-size: 0.8em;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.section2 .btn:hover {
background-color: #8e0000;
color: #212529;
text-decoration: none;
}
#about {
margin-bottom: 0px;
}
/* SKILLS */
#skills {
margin-bottom: 50px;
margin-top: 20px;
}
#skills .code-icon {
margin-top: 10px;
margin-bottom: 15px;
}
#skills .col {
letter-spacing: .6px;
}
#skills .container{
border-style: solid;
border-width: 3px;
z-index: 0;
color: #d4d4dc;
background-color: #1d1e22;
border-color: black;
border-radius: .5%;
line-height: 2.4em;
font-size: 1.4em;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-size: cover;
padding-top: 5%;
padding-bottom: 5%;
}
#skills ul {
list-style: none;
}
/* PROJECTS */
#projects {
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;
margin-top: 70px;
margin-bottom: 50px;
}
#projects .row h1,
#projects .row .works-description {
text-shadow: .08px .5px black;
}
#projects .text-center {
max-width: 500px;
margin-bottom: 30px;
border-radius: 3px;
min-width: 300px;
box-shadow: 0 2px 8px 2px rgb(0, 0, 0);
padding: 15px;
background: #81888373;
text-shadow: .08px .5px black;
}
.works-description a {
color: #8e0000;
line-height: 36px;
margin-bottom: 36px;
width: 90%;
max-width: 1000px;
text-align: center;
margin-left: auto;
margin-right: auto;
}
.works-description {
line-height: 36px;
margin-bottom: 36px;
width: 90%;
max-width: 1000px;
text-align: center;
margin-left: auto;
margin-right: auto;
}
#projects .card-image-container {
width: 95%;
max-width: 420px;
max-height: 300px;
margin: 18px auto;
border-radius: 3px;
border: .5px solid #8e0000;
}
#projects .card-image-container
{
position:relative;
-webkit-box-shadow:0 1px 5px rgba(0,0,0,0.8), 0 0 5px rgba(0,0,0,0.8);
-moz-box-shadow:0 1px 5px rgba(0,0,0,0.8), 0 0 5px rgba(0,0,0,0.8);
box-shadow:0 1px 5px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.8);
}
#projects .card-image-container:before, #projects .card-image-container:after
{
content:"";
position:absolute;
z-index:-1;
-webkit-box-shadow:0 0 20px rgba(0,0,0,0.8);
-moz-box-shadow:0 0 20px rgba(0,0,0,0.8);
box-shadow:0 0 20px rgba(0,0,0,0.8);
top:10px;
bottom:10px;
left:0;
right:0;
-moz-border-radius:100px / 10px;
border-radius: 100px / 10px;
}
#projects .card-image-container:after
{
right:10px;
left:auto;
-webkit-transform:skew(8deg) rotate(3deg);
-moz-transform:skew(8deg) rotate(3deg);
-ms-transform:skew(8deg) rotate(3deg);
-o-transform:skew(8deg) rotate(3deg);
transform:skew(8deg) rotate(3deg);
}
#media only screen and (max-width: 767px) {
#projects .card-image-container {
border-style: none;
box-shadow: none;
}
}
#projects img {
align-items: center;
justify-content: center;
max-width: 100%;
max-height: 100%;
}
#media only screen and (max-width: 992px) {
#projects img{
width: 200px;
}
}
#media only screen and (max-width: 408px) {
#projects img {
width: 150px;
}
}
#projects .card-body {
padding: 0 1.25rem;
margin-bottom: 18px;
}
#projects .summary {
color: #8e0000;
}
#projects .card-summary {
font-size: 18px;
margin-bottom: 18px;
line-height: 36px;
}
#media only screen and (min-width: 992px) {
#projects .card-summary {
height: 180px;
}
}
#media only screen and (min-width: 768px) {
#projects .card-summary {
height: 150px;
}
}
/*FOR BUTTONS GO HERE: *https://bootsnipp.com/snippets/Gl29g*/
/* background: -webkit-linear-gradient(to right, #212529, #8e0000); /* Chrome 10-25, Safari 5.1-6 */
/*background: linear-gradient(to right,#212529, #8e0000); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
/*font-size: 1.1rem; */
#projects .btn-rounded {
border-radius: 2px;
}
.btn-dark-moon {
background: #212529; /* fallback for old browsers */
color: rgba(255, 255, 255, 0.747);
border: 2px solid #eee;
position: relative;
text-shadow: .1px .8px 1px black;
-webkit-filter: drop-shadow(0px 3px 10px #8e0000);
filter: drop-shadow(0px 0px 2px #8e0000);
margin-right: 5px;
}
.btn-dark-moon:hover {
color: white;
border-width: 2.2px;
text-shadow: .1px 2px 1px black;
-webkit-filter: drop-shadow(0px 3px 10px #8e0000);
filter: drop-shadow(0px 0px 2px #8e0000);
}
.btn-darker-moon {
background: #212529; /* fallback for old browsers */
color: rgba(255, 255, 255, 0.747);
border: 2px solid #eee;
position: relative;
text-shadow: .1px .8px 1px black;
-webkit-filter: drop-shadow(0px 3px 10px #8e0000);
filter: drop-shadow(0px 0px 2px #8e0000);
margin-right: 5px;
}
.btn-darker-moon:hover {
color: white;
border-width: 2.2px;
text-shadow: .1px 2px 1px black;
-webkit-filter: drop-shadow(0px 3px 10px #8e0000);
filter: drop-shadow(0px 0px 2px #8e0000);
}
/*TESTIMONIALS*/
.testimonials {
margin: 50px auto;
color: #777;
margin-top: 115px;
margin-bottom: 100px;
text-shadow: .08px .5px black;
}
.testimonials h1 {
text-align: center;
font-weight: bold;
color: #8e0000;
padding-bottom: 10px;
text-transform: uppercase;
}
.testimonials .sayings {
font-size: 1.2em;
}
.testimonials h1::after {
content: '';
background: #8e0000;
display: block;
height: 3px;
width: 170px;
margin: 20px auto 5px;
}
.testimonials .row {
margin-top: 30px;
}
.col-md-4 {
margin: 40px auto;
}
.profile {
padding: 70px 10px 10px;
background-color: #353535;
border-radius: 3px;
/* box-shadow:0 0 20px rgba(0,0,0,0.8); */
position: relative;
}
.profile:before, .profile:after
{
z-index: -1;
position: absolute;
content: "";
bottom: 15px;
left: 10px;
width: 50%;
top: 80%;
max-width:300px;
background: #777;
-webkit-box-shadow: 0 15px 10px rgb(105, 105, 105);
-moz-box-shadow: 0 15px 10px #777;
box-shadow: 0 15px 10px #777;
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
transform: rotate(-3deg);
}
.profile:after
{
-webkit-transform: rotate(3deg);
-moz-transform: rotate(3deg);
-o-transform: rotate(3deg);
-ms-transform: rotate(3deg);
transform: rotate(3deg);
right: 10px;
left: auto;
}
.profile img {
top: -60px;
position: absolute;
left: calc(50% - 60px);
border: 10px solid #e3e3e3;
}
.user {
width: 120px;
height: 120px;
border-radius: 50%;
}
.profile h3 {
font-size: 23px;
margin-top: 15px;
color: #790505;
}
.credentials {
font-weight: bolder;
}
.credentials span {
font-size: 12px;
color: #777;
}
.profile blockquote {
font-size: 16px;
line-height: 30px;
/* quotes: "\201C""\201D""\2018""\2019"; FOR USE WITH QUOTES TO SOLVE NESTED ISSUE WITH CODE BELOW */
}
.profile blockquote::before {
content: open-quote;
font-size: 50px;
position: relative;
color: #790505;
line-height: 20px;
bottom: -15px;
right: 5px;
}
.profile blockquote::after {
content: close-quote;
font-size: 50px;
position: relative;
color: #790505;
line-height: 10px;
bottom: -15px;
right: 5px;
}
.profile blockquote {
height: 161px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<body>
<!-- HOME -->
<section id="home" class="section1">
<div class='container'>
<div class="row justify-content-center">
<div class="col-md-12 col-sm-12">
<p class='intro'>
Hello, my name is <span class="highlight animated fadeIn" style="animation-delay: 1s; animation-duration: 1.8s">King.</span>
<br>
<div class="intro animated fadeInLeft" style="animation-delay: 3s; animation-duration: 2s">And I'm a full-stack web developer.</div>
<a href="#myanchor"><button type="button" class="home-btn btn btn-primary-outline btn-xs animated fadeIn"
style="animation-delay: 5s; animation-duration: 2s">VIEW MY WORK</button></a>
</p>
</div>
</div>
</div>
</section>
<!-- NAVIGATION -->
<div id="navbar">
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<div class="container">
<div class="logo-wrapper nav-item">
<div class="logo" id="logo">
<a class="navbar-brand" href="#home"><img src="favicon.ico" alt="King's Brand Logo"></a>
</div>
<span class="brand" id="brand" style="animation-delay: 0s; animation-duration: 3s">KING MAJOR</span>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item focus">
<a class="nav-link" href="#myanchor">ABOUT
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#myanchor2">SKILLS
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#myanchor3">PROJECTS
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#myanchor4">TESTIMONIALS
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">CONTACT
<span class="sr-only">(current)</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</div>
<!-- ABOUT -->
<div class="blank" style="position: absolute">
<a id="myanchor"></a>
</div>
<section id="about" class="section2">
<div class="row-fluid">
<div class="row">
<div class="card ">
<div class="card-block">
<div class="card-title">
<h1>Welcome, let's talk!</h1>
</div>
<div id="container">
<p> I started independent web development two years ago, and haven't looked back. A couple of things I love about coding are those moments when tough projects are complete, or discovering a solution to a difficult problem. Take a look at my
skills, and some of my recent projects. THANKS!
</p>
Print My Resume
</div>
</div>
</div>
</div>
</div>
</section>
<!-- SKILLS -->
<div class="blank" style="margin: -65px 0px 250px 0px; position: absolute;">
<a id="myanchor2"></a>
</div>
<section id="skills" class="section3">
<div class="row justify-content-center">
<div class="col-md-7 col-sm-12">
<div class="card text-center">
<div class="container">
<div class="card-title">
<h2>Tech I've learned:</h2>
</div>
<div class="col"><img class="code-icon" src="assets/images/code-solid.png" style="height: 12%; width: 12%; ">
<p>JavaScript, HTML, CSS, MongoDB, Express, Node.js, Bootstrap, mySQL, AWS Cloud Storage, and more...</p>
<h2>Tools I use:</h2>
<ul>
<li>Visual Studio Code</li>
<li>Github</li>
<li>Express</li>
<li>Linux</li>
<li>Axios</li>
<li>npm</li>
<li>Bash</li>
<li>Chrome Developer Tools</li>
<li>And more...</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- PROJECTS -->
<div class="blank" style="margin: -65px 0px 250px 0px; position: absolute;">
<a id="myanchor3"></a>
</div>
<section id="projects" class="section4">
<div class="container">
<div class="row justify-content-center">
<h1>My Recent Projects</h1>
<p class="works-description">These are all self-directed projects. You can find more work on my
Github.<br> Below are just some of my most recent works. Let me know if you have any questions!
</p>
<div class="row justify-content-center">
<div class="col-md-5 col-sm-12">
<div class="text-center">
<div class="card-block">
<div class="card-image-container">
<a href="https://kingdomb.github.io/google-promo/">
<img src="assets/images/laptop-project-insertion-floating1SHADOW.png" alt="Google-Promo-Project">
</a>
</div>
<div class="card-body">
<div class="card-app-name card-title">
<h2>Google Home</h2>
</div>
<p class="card-tech card-text">JavaScript, HTML, CSS, Bootstrap</p>
<p class="summary">Summary</p>
<div class="card-summary card-text">
This project displays my use of javascript animations, and website design best practices. Firsts in this project included the added animations. </div>
<a href="https://kingdomb.github.io/google-promo/" class="btn btn-darker-moon btn-rounded">View
Demo</a>
View Code
</div>
</div>
</div>
</div>
<div class="col-md-5 col-sm-12">
<div class="text-center">
<div class="card-block">
<div class="card-image-container">
<a href="https://kingdomb.github.io/Food_Searcher/">
<img src="assets/images/laptop-project-insertion-floating2SHADOW.png" alt="Nutrition-Searcher-Project">
</a>
</div>
<div class="card-body">
<div class="card-app-name card-title">
<h2>Nutrition Searcher</h2>
</div>
<p class="card-tech card-text">jQuery, JS, HTML, REST APIs, Regex, Materialize</p>
<p class="summary">Summary</p>
<div class="card-summary card-text">
This app returns nutritional value of foods, and calculates the length of time it takes to burn those calories.</div>
<a href="https://kingdomb.github.io/Food_Searcher/" class="btn btn-darker-moon btn-rounded">View
Demo</a>
<a href="https://github.com/KingdomB/Food_Searcher" class="btn btn-dark-moon btn-rounded">View
Code</a>
</div>
</div>
</div>
</div>
<div class="col-md-5 col-sm-12">
<div class="card text-center">
<div class="card-block">
<div class="card-image-container">
<a href="https://raw.githubusercontent.com/KingdomB/Bamazon/master/bamazon.gif">
<img src="assets/images/laptop-project-insertion-floating3SHADOW.gif" alt="Bamazon-gif">
</a>
</div>
<div class="card-body">
<div class="card-app-name card-title">
<h2>Bamazon CLI Store</h2>
</div>
<p class="card-tech card-text">JavaScript, Node.js, MySQL</p>
<p class="summary">Summary</p>
<div class="card-summary card-text">
Created an small Amazon-like storefront. The store interface prompts the user to select an item for purchase. After a quantity selection the inventory adjusts accordingly.</div>
View Demo
View Code
</div>
</div>
</div>
</div>
<div class="col-md-5 col-sm-12">
<div class="card text-center">
<div class="card-block">
<div class="card-image-container">
<a href="https://raw.githubusercontent.com/KingdomB/liri-node-app/master/liri-node-app.gif">
<img src="assets/images/laptop-project-insertion-floating4SHADOW.gif" alt="LIRI-Node-Project">
</a>
</div>
<div class="card-body">
<div class="card-app-name card-title">
<h2>LIRI-Node-CLI</h2>
</div>
<p class="card-tech card-text"> JavaScript, Node.js, Axios, RESTful APIs, Inquirer</p>
<p class="summary">Summary</p>
<div class="card-summary card-text">
Command line user interface that receives search query inputs, and GET requests to return results from music, movie, and concert APIs</div>
View Demo
<a href="https://github.com/KingdomB/liri-node-app" class="btn btn-dark-moon btn-rounded">View
Code</a>
</div>
</div>
</div>
</div>
</section>
</body>
</html>
So I have created a page and tried my best to use Bootstrap 4. But here is the thing, the page has all types of responsive errors, and one of the hallmarks of Bootstrap is that it is responsive. So, I would like some advice on the errors that I note below, please.
At 1199px X 836 both cards on the left in the "projects" section decrease vertically by maybe 20px.
-I would like all four cards to stay the same size and of course at some point the cards should display: block. But not at 1199px.
At 1124 the "about" section creates a top and bottom grey border, but what is more interesting is that 1027px X 836 the text wraps and things get ugly.
At 991px X 836px everything becomes messy. Navbar logo and logo-brand wrap and extend outside of the navbar container, about section text starts to push out of its container, and testimonials text starts overlapping.
I don't fully understand the css position methods and I believe this may be the issue, but if you can help me to get a better understanding of what I am doing wrong then I would greatly appreciate it.
Thanks
PS. I don't want to load down the post with my code so here is a link to the repo and the page:
repo
page
You must add bootstrap cdn link. Add this in head tag:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
and this in at the end of body:
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
</script>
Or go to this page and download the bootstrap file if you want to use bootstrap also offline
I am trying to get it so that the user can submit comments on the "back" of an element that does a 3d flip using css animate. However I cannot get the form clickable.
I have tried using z-index on the positioned element.
You can tab into the form and enter data and submit without issue. You just cannot click it.
What am I missing here?
Thank you for your help.
.entry_wrapper {
width: 50%;
margin: 1.5em auto;
}
.entry_wrapper {
-webkit-perspective: 2000;
}
.entry_wrapper:hover .face {
transform: rotateY(180deg);
}
.face {
box-shadow: 5px 5px 20px 5px #000000;
transform-style: preserve-3d;
transition: all 1.0s linear;
backface-visibility: hidden;
width: 100%;
height: 100%;
}
.face .back {
width: 100%;
height: 100%;
position: absolute;
top: 0;
transform: rotateY(180deg);
border: solid white 1px;
border-radius: 5px;
background: grey;
z-index: 30;
}
.entry {
display: block;
position: relative;
width: 100%;
height: auto;
}
.entry_img {
margin: 0 auto;
width: 100%;
height: auto;
}
.entry img {
Width: 100%;
height: auto;
margin-bottom: -5px;
}
.entry_img p {
display: inline;
position: absolute;
bottom: 0;
z-index: 10;
color: white;
text-align: center;
margin: 0;
width: 100%;
background: rgba(0, 0, 0, 0.6);
}
.entry_footer {
width: 100%;
height: 3em;
text-align: center;
margin: 0 auto;
background: rgba(256, 256, 256, 0.8);
}
.comment {
width: 66%;
background: #cccccc;
border: 2px solid #000000;
border-radius: 5px;
margin: 15px auto;
}
.comment p {
margin: 2px 5px;
}
.comment_name {
font-size: .8em;
}
.comment_name span {
display:block;
float:right;
width:50%;
margin-left:10px;
}
.add_comment {
width: 66%;
display: block;
margin: 15px auto;
background: #cccccc;
border: 2px solid #000000;
border-radius: 5px;
z-index: 50;
}
#comment_form {
z-index: 50;
}
<main>
<div class="entry_wrapper">
<div class="face">
<div class="entry">
<div class="entry_img">
<img src="img/family.jpg">
<p>Birth of first daughter Sophia.</p>
</div>
</div>
<div class="entry_footer">
<p>Like?</p>
</div>
<div class="back face">
<div class="comment">
<p> I really like this picture.</p>
<div >
<p class="comment_name">By: Matthew <span class="date">On: Nov 5th, 2014</span></p>
</div>
</div>
<form id="comment_form" action="comment_submit.php">
<input type="submit">
</form>
<textarea name="comment1" class="add_comment" form="comment_form" placeholder="test"></textarea>
</div>
</div>
</div>
<div class="entry_wrapper">
<div class="entry">
<div class="entry_img">
<img src="img/summit.jpg">
<p>I made it to the top!</p>
</div>
</div>
<div class="entry_footer">
<p>Like?</p>
</div>
</div>
</main>
So here is my HTML code in question.
<script type="text/css">
.slider-holder {
background-color:transparent;
}
.slider-bg {
min-height: 295px;
position: relative;
z-index: 1;
border-bottom:0px;
}
.slider {
height: 295px;
padding: 1px 17px 0;
margin: 0 auto;
position: relative;
background: transparent;
}
.slider .items,
.slider .items2 {
position: relative;
height: 293px;
float: left;
}
.slider .items div.item,
.slider .items2 div.item{
height: 293px;
display: none;
position: absolute;
top: 0;
left: 0;
z-index: 0;
}
.slider .slider-text {
width: 720px;
position: relative;
z-index: 2;
padding: 70px 0 0;
}
.slider .slider-text, .slider .slider-text p {
background-color: inherit;
color: #fff;
font-size: 32px;
line-height: 33px;
}
.slider .slider-text.smaller p
{
font-size:24px;
}
.slider .slider-text p { padding: 0 0 10px; }
.slider .slider-text a.slider-btn {
background: #58940a url('img/btn/slider-btn.png') no-repeat 8px 7px;
display: block;
float: left;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
-webkit-box-shadow: 0px 0px 40px #666;
-moz-box-shadow: 0px 0px 40px #666;
box-shadow: 0px 0px 40px #666;
padding: 6px 10px 6px 32px;
color: #fff;
font-size: 15px;
line-height: 20px;
height: 20px;
}
.slider .slider-img {
position: absolute;
bottom: 0px;
padding: 0 5px 0 0;
z-index: 1;
left:-312px;
zoom: 1;
}
.slider .slidetabs {
position: absolute;
left:375px;
bottom: 27px;
z-index: 3;
}
.slider .slidetabs a {
background: url('img/elem/thumbnail-disc.png') no-repeat left top;
display: block;
width: 11px;
height: 11px;
float: left;
margin: 0 6px 0 0;
}
.slider .slidetabs a:hover, .slider .slidetabs a.current { background-position: left bottom; }
</script>
<div class="slider-holder">
<div class="slider-bg">
<!--begin:slider-->
<div class="slider">
<div class="items">
<!--begin:item-->
<div class="item" style="display: none; ">
<div class="slider-text"></div>
<div class="slider-img">
<img src="image.jpg" alt="" width="1600" height="294" align="center">
</div>
</div>
<!--end:item-->
<!--begin:item-->
<div class="item" style="display: none; ">
<div class="slider-text smaller"></div>
<div class="slider-img">
<img src="image2.jpg" alt="" width="1600" height="294" align="center">
</div>
</div>
<!--end:item-->
<!--begin:item-->
<div class="item" style="display: block; ">
<div class="slider-text"></div>
<div class="slider-img">
<a href="http://www.link.com" target="_blank">
<img src="image.jpeg" alt="" width="1600" height="294" align="center">
</a>
</div>
</div>
<!--end:item-->
</div>
<div class="slidetabs">
</div>
</div>
<!--end:slider-->
</div>
</div>
The problem with this particular setup is that the img is bigger than the div (which is intentional. And this setup works in most browswers except IE8. It gets cut off at the .slider-holder box (or at least it appears to).
Found out that a caching plugin was breaking the site. carry on.