center an item in a div by ignoring other elements - html

I want to create a header bar and center my title / logo but it's not centered perfectly.
body {
margin: 0;
background: black;
}
.link {
text-decoration: none;
}
#header {
height: 80px;
display: flex;
align-items: center;
background-color: #000000;
}
#headerTitleContainer {
margin: 0 auto;
}
#headerTitle {
color: #97d700;
}
#menuBtnContainer {
display: inline-block;
cursor: pointer;
margin-right: 10px;
}
#media (min-width: 300px) {
#menuBtnContainer {
margin-left: 20px;
}
}
#media (max-width: 299px) {
#menuBtnContainer {
margin-left: 5px;
}
}
.menuIconBar {
width: 35px;
height: 5px;
margin: 6px 0 6px 0;
transition: 0.4s;
background-color: #97d700;
}
<div id="header">
<div id="menuBtnContainer">
<div class="menuIconBar" id="menuIconBar1"></div>
<div class="menuIconBar" id="menuIconBar2"></div>
<div class="menuIconBar" id="menuIconBar3"></div>
</div>
<div id="headerTitleContainer">
<h1><a class="link" id="headerTitle" href="/">MyTitle</a></h1>
</div>
</div>
As you can see MyTitle is not centered correctly. How can I do this? I achieve it when taking out my menu button but obviously I need this button. I just want it to be always in the center of the bar. But it should not overlap the menu button.
That's why I added a margin-right: 10px; to my menu button.

One solution it to make width of button 0 and have overflow:visible on it:
body {
margin: 0;
background: black;
}
.link {
text-decoration: none;
}
#header {
height: 80px;
display: flex;
align-items: center;
background-color: #000000;
}
#headerTitleContainer {
margin: 0 auto;
}
#headerTitle {
color: #97d700;
}
#menuBtnContainer {
display: inline-block;
cursor: pointer;
width: 0;
overflow: visible;
}
#media (min-width: 300px) {
#menuBtnContainer {
margin-left: 20px;
margin-right:-20px;
}
}
#media (max-width: 299px) {
#menuBtnContainer {
margin-left: 5px;
}
}
.menuIconBar {
width: 35px;
height: 5px;
margin: 6px 0 6px 0;
transition: 0.4s;
background-color: #97d700;
}
<div id="header">
<div id="menuBtnContainer">
<div class="menuIconBar" id="menuIconBar1"></div>
<div class="menuIconBar" id="menuIconBar2"></div>
<div class="menuIconBar" id="menuIconBar3"></div>
</div>
<div id="headerTitleContainer">
<h1><a class="link" id="headerTitle" href="/">MyTitle</a></h1>
</div>
</div>
Or simply make the button absolute position without chaging any other property and don't forget to make the parent position:relative (I prefer this one):
body {
margin: 0;
background: black;
}
.link {
text-decoration: none;
}
#header {
height: 80px;
display: flex;
align-items: center;
background-color: #000000;
position:relative;
}
#headerTitleContainer {
margin: 0 auto;
}
#headerTitle {
color: #97d700;
}
#menuBtnContainer {
display: inline-block;
cursor: pointer;
margin-right: 10px;
position: absolute;
}
#media (min-width: 300px) {
#menuBtnContainer {
margin-left: 20px;
margin-right:-20px;
}
}
#media (max-width: 299px) {
#menuBtnContainer {
margin-left: 5px;
}
}
.menuIconBar {
width: 35px;
height: 5px;
margin: 6px 0 6px 0;
transition: 0.4s;
background-color: #97d700;
}
<div id="header">
<div id="menuBtnContainer">
<div class="menuIconBar" id="menuIconBar1"></div>
<div class="menuIconBar" id="menuIconBar2"></div>
<div class="menuIconBar" id="menuIconBar3"></div>
</div>
<div id="headerTitleContainer">
<h1><a class="link" id="headerTitle" href="/">MyTitle</a></h1>
</div>
</div>
Another solution is to add a third hidden element using :after taking the same width as the button so the title get centered :
body {
margin: 0;
background: black;
}
.link {
text-decoration: none;
}
#header {
height: 80px;
display: flex;
align-items: center;
background-color: #000000;
}
#header:after {
content: "";
width: 35px;
margin-left: 10px;
}
#headerTitleContainer {
margin: 0 auto;
}
#headerTitle {
color: #97d700;
}
#menuBtnContainer {
display: inline-block;
cursor: pointer;
margin-right: 10px;
}
#media (min-width: 300px) {
#menuBtnContainer {
margin-left: 20px;
}
#header:after {
margin-right: 20px;
}
}
#media (max-width: 299px) {
#menuBtnContainer {
margin-left: 5px;
}
}
.menuIconBar {
width: 35px;
height: 5px;
margin: 6px 0 6px 0;
transition: 0.4s;
background-color: #97d700;
}
<div id="header">
<div id="menuBtnContainer">
<div class="menuIconBar" id="menuIconBar1"></div>
<div class="menuIconBar" id="menuIconBar2"></div>
<div class="menuIconBar" id="menuIconBar3"></div>
</div>
<div id="headerTitleContainer">
<h1><a class="link" id="headerTitle" href="/">MyTitle</a></h1>
</div>
</div>

Related

Text is not taking up full screen when on mobile device

So I have my personal website and I have paragraphs within it. When viewed on a large screen it looks fine however on a phone it is in a single column and I would like to fix that. I have a screen shot with what I mean and a code pen with the code. I have tried using #media screen and (mad-width:) however it does not help.
#media only screen and (max-width: 500px) {
.masthead {
padding: 3em 0;
}
#media screen and (max-width: 600px) {
.column-left {
display: none;
}
}
#media screen and (max-width: 1800px) {
.button {
display: none;
}
}
.masthead-heading {
font-size: 3em;
}
.content-footer {
padding: 2em 2.5em;
}
}
.about,
.about-content,
.skills,
.skills-content,
.title::after,
.text {
color: white;
}
.navbar {
background-color: #ac5fdb;
color-scheme: 100%;
}
.content-footer {
padding: 2px 0;
text-align: center;
background-color: #ac5fdb;
color-scheme: 100%;
text-decoration: none;
max-height: 2000px;
}
.footer-text {
padding-bottom: 70px;
}
.content-footer>p {
color: grey;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
text-decoration: none;
}
html {
scroll-behavior: smooth;
background-color: #1e2029;
}
/* custom scroll bar */
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
/* all similar content styling codes */
section {
padding: 100px 0;
}
.max-width {
max-width: 1300px;
padding: 0 80px;
margin: auto;
}
.about,
.services,
.skills,
.teams,
.contact,
footer {
font-family: "Poppins", sans-serif;
}
.about .about-content,
.services .serv-content,
.skills .skills-content,
.contact .contact-content {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
}
section .title {
position: relative;
text-align: center;
font-size: 40px;
font-weight: 500;
margin-bottom: 60px;
padding-bottom: 20px;
font-family: "Ubuntu", sans-serif;
}
section .title::before {
content: "";
position: absolute;
bottom: 0px;
left: 50%;
width: 180px;
height: 3px;
background: #1e2029;
transform: translateX(-50%);
}
section .title::after {
position: absolute;
bottom: -8px;
left: 50%;
font-size: 20px;
color: #ac5fdb;
padding: 0 5px;
background: #1e2029;
transform: translateX(-50%);
}
/* navbar styling */
.nav-link {
color: #fff;
}
.navbar {
position: fixed;
width: 100%;
z-index: 999;
padding: 30px 0;
font-family: "Ubuntu", sans-serif;
transition: all 0.3s ease;
}
.navbar.sticky {
padding: 15px 0;
background: #ac5fdb;
}
.navbar .max-width {
display: flex;
align-items: center;
justify-content: space-between;
}
.navbar .logo a {
color: #fff;
font-size: 35px;
font-weight: 600;
}
.navbar .logo a span {
color: #ac5fdb;
transition: all 0.3s ease;
}
.navbar.sticky .logo a span {
color: #fff;
}
.navbar .menu li {
list-style: none;
display: inline-block;
}
.navbar .menu li a {
display: block;
color: #fff;
font-size: 18px;
font-weight: 500;
margin-left: 25px;
transition: color 0.3s ease;
}
.navbar .menu li a:hover {
color: #ac5fdb;
}
.navbar.sticky .menu li a:hover {
color: #ffff;
}
/* menu btn styling */
.menu-btn {
color: #fff;
font-size: 23px;
cursor: pointer;
display: none;
}
.scroll-up-btn {
position: fixed;
height: 45px;
width: 42px;
background: #ac5fdb;
right: 30px;
bottom: 10px;
text-align: center;
line-height: 45px;
color: #fff;
z-index: 9999;
font-size: 30px;
border-radius: 6px;
border-bottom-width: 2px;
cursor: pointer;
opacity: 0;
pointer-events: none;
transition: all 0.3s ease;
}
.scroll-up-btn.show {
bottom: 30px;
opacity: 1;
pointer-events: auto;
}
.scroll-up-btn:hover {
filter: brightness(90%);
}
/* home section styling */
.home {
display: flex;
background: url("/Files/banner.jpg");
height: 90vh;
color: #fff;
min-height: 90vh;
background-size: cover;
background-attachment: fixed;
font-family: "Ubuntu", sans-serif;
}
.home .max-width {
width: 100%;
display: flex;
}
.home .max-width .row {
margin-right: 0;
}
.home .home-content .text-1 {
font-size: 27px;
}
.home .home-content .text-2 {
font-size: 75px;
font-weight: 600;
margin-left: -3px;
}
.home .home-content .text-3 {
font-size: 40px;
margin: 5px 0;
}
.home .home-content .text-3 span {
color: #ac5fdb;
font-weight: 500;
}
.home .home-content a {
display: inline-block;
background: #ac5fdb;
color: #fff;
font-size: 25px;
padding: 12px 36px;
margin-top: 20px;
font-weight: 400;
border-radius: 6px;
border: 2px solid #ac5fdb;
transition: all 0.3s ease;
}
.home .home-content a:hover {
color: #ac5fdb;
background: none;
}
/* about section styling */
.about .title::after {
content: "who I am";
}
.about .about-content .left {
width: 45%;
}
.about .about-content .column-left img {
height: 400px;
width: 400px;
object-fit: cover;
border-radius: 6px;
}
.about .about-content .right {
width: 55%;
}
.about .about-content .right .text {
font-size: 25px;
font-weight: 600;
margin-bottom: 10px;
}
.about .about-content .right .text span {
color: #ac5fdb;
}
.about .about-content .right p {
text-align: justify;
}
.about .about-content .right a {
display: inline-block;
background: #ac5fdb;
color: #fff;
font-size: 20px;
font-weight: 500;
padding: 10px 30px;
margin-top: 20px;
border-radius: 6px;
border: 2px solid #ac5fdb;
transition: all 0.3s ease;
}
.about .about-content .right a:hover {
color: #ac5fdb;
background: none;
}
/* skills section styling */
.skills .title::after {
content: "what i know";
}
.skills .skills-content .column {
width: calc(50% - 30px);
}
.skills .skills-content .left .text {
font-size: 20px;
font-weight: 600;
margin-bottom: 10px;
}
.skills .skills-content .left p {
text-align: justify;
}
.skills .skills-content .left a {
display: inline-block;
background: #ac5fdb;
color: #fff;
font-size: 18px;
font-weight: 500;
padding: 8px 16px;
margin-top: 20px;
border-radius: 6px;
border: 2px solid #ac5fdb;
transition: all 0.3s ease;
}
.skills .skills-content .left a:hover {
color: #ac5fdb;
background: none;
}
.skills .skills-content .right .bars {
margin-bottom: 15px;
}
.skills .skills-content .right .info {
display: flex;
margin-bottom: 5px;
align-items: center;
justify-content: space-between;
}
.skills .skills-content .right span {
font-weight: 500;
font-size: 18px;
}
.skills .skills-content .right .line {
height: 5px;
width: 100%;
background: lightgrey;
position: relative;
}
.skills .skills-content .right .line::before {
content: "";
position: absolute;
height: 100%;
left: 0;
top: 0;
background: #ac5fdb;
}
.skills-content .right .html::before {
width: 100%;
}
.skills-content .right .css::before {
width: 90%;
}
.skills-content .right .js::before {
width: 75%;
}
.skills-content .right .php::before {
width: 70%;
}
.skills-content .right .mysql::before {
width: 50%;
}
/* services section styling */
.contact {
background-color: #1e2029;
}
.title,
.head,
.text {
color: #fff;
}
.services,
.teams {
color: #fff;
background-color: #1e2029;
}
.services .title::before,
.teams .title::before {
background-color: #1e2029;
color: #ffff;
}
.services .title::after,
.teams .title::after {
background: #111;
content: "what I've made";
}
.services .serv-content .card {
width: calc(33% - 20px);
background: #222;
text-align: center;
border-radius: 6px;
padding: 50px 25px;
cursor: pointer;
transition: all 0.3s ease;
}
.services .serv-content .card:hover {
background: #ac5fdb;
}
.services .serv-content .card .box {
transition: all 0.3s ease;
}
.services .serv-content .card:hover .box {
transform: scale(1.05);
}
.services .serv-content .card i {
font-size: 50px;
color: #ac5fdb;
transition: color 0.3s ease;
}
.services .serv-content .card:hover i {
color: #fff;
}
.services .serv-content .card .text {
font-size: 25px;
font-weight: 500;
margin: 10px 0 7px 0;
}
/* contact section styling */
.contact .title::after {
content: "get in touch";
}
.contact .contact-content .column {
width: calc(50% - 30px);
}
.contact .contact-content .text {
font-size: 20px;
font-weight: 600;
margin-bottom: 10px;
}
.contact .contact-content .left p {
text-align: justify;
}
.contact .contact-content .left .icons {
margin: 10px 0;
}
.contact .contact-content .row {
display: flex;
height: 15px;
align-items: center;
}
.contact .contact-content .row .info {
margin-left: 30px;
background-color: #1e2029;
}
.contact .contact-content .row i {
font-size: 25px;
color: #ac5fdb;
}
.contact .contact-content .info .head {
font-weight: 500;
}
.contact .contact-content .info .sub-title {
color: #fff;
background-color: #1e2029;
}
.contact .right form .fields {
display: flex;
background-color: #1e2029;
}
.contact .right form .field,
.contact .right form .fields .field {
height: 45px;
width: 100%;
margin-bottom: 15px;
background-color: #1e2029;
}
.contact .right form .textarea {
height: 80px;
width: 100%;
background-color: #1e2029;
}
.contact .right form .name {
margin-right: 10px;
background-color: #1e2029;
}
.contact .right form .field input,
.contact .right form .textarea textarea {
height: 70%;
width: 100%;
border: 1px solid lightgrey;
border-radius: 6px;
outline: none;
padding: 0 15px;
font-size: 17px;
font-family: "Poppins", sans-serif;
transition: all 0.3s ease;
background-color: #1e2029;
}
.contact .right form .field input:focus,
.contact .right form .textarea textarea:focus {
border-color: #b3b3b3;
background-color: #1e2029;
}
.contact .right form .textarea textarea {
padding-top: 10px;
resize: none;
background-color: #1e2029;
}
.contact .right form .button-area {
display: flex;
align-items: center;
background-color: #1e2029;
}
.right form .button-area button {
color: #fff;
display: block;
width: 160px !important;
height: 45px;
outline: none;
font-size: 18px;
font-weight: 500;
border-radius: 6px;
cursor: pointer;
flex-wrap: nowrap;
background: #ac5fdb;
border: 2px solid #ac5fdb;
transition: all 0.3s ease;
}
.right form .button-area button:hover {
color: #ac5fdb;
background: none;
}
.fa-twitter,
.fa-github,
.fa-linkedin {
color: white;
}
.navbar-toggler-icon {
color: #ac5fdb;
}
.about,
.skills {
background-color: #1e2029;
}
#media (max-width: 991px) {
.services .max-width {
padding: 0;
}
.services .serv-content,
.services .serv-content .card {
width: 100%;
}
}
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="./style.css" />
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.11/typed.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<script src="https://kit.fontawesome.com/3263ba6030.js" crossorigin="anonymous"></script>
<script src="https://kit.fontawesome.com/3263ba6030.js" crossorigin="anonymous"></script>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>Edward Wynman</title>
<link rel="icon" type="image/x-icon" href="Files/PFP.jpg">
</head>
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">Edward Wynman</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="true" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="courses.html">Courses</a>
</li>
<li class="nav-item">
<a class="nav-link" href="projects.html">Projects</a>
<li class="nav-item">
<a class="nav-link" href="/Files/Resume.pdf">Resume</a>
</li>
</ul>
</div>
</div>
</nav>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<body>
<section class="home">
<div class="jumbotron text-center">
<section class="home" id="home">
<div class="max-width">
<div class="home-content">
<div class="text-1">Hello, my name is</div>
<div class="text-2">Edward Wynman</div>
<div class="text-3">And I'm a <span class="typing">
<script>
$(document).ready(function () {
// typing text animation script
var typed = new Typed(".typing", {
strings: ["Student", "Developer", "Engineer"],
typeSpeed: 100,
backSpeed: 60,
loop: true
});
var typed = new Typed(".typing-2", {
strings: ["Student", "Developer", "Engineer"],
typeSpeed: 100,
backSpeed: 60,
loop: true
});
});
</script>
</span></div>
Email Me!
</div>
</div>
</section>
</section>
<section class="about" id="about">
<div class="max-width">
<h2 class="title">About me</h2>
<div class="about-content">
<div class="column-left" id="pic">
<img src="/Files/PFP.jpg" alt="">
</div>
<div class="column right">
<div class="text">I'm Eddie and I'm a <span class="typing-2"></span></div>
<p>At the age of <strong>thirteen</strong> I started programming and have taught myself a thing or two since then. Topics that interest me are <strong>web development,
UX Design , and Software Engineering </strong>Now, I'm a Computer Science student at
<strong> Montclair State University </strong>. I am currently seeking 2023 Summer internship opportunities in Software Engineering and Web Development. I am also pursuing a minor in <strong>Data Science</strong> This website showcases some
of <strong>my
abilities and skills.</strong>
</p>
Download Resume
Read More
</div>
</div>
</div>
</section>
<section class="skills" id="skills">
<div class="max-width">
<h2 class="title">My skills</h2>
<div class="skills-content">
<div class="column left">
<div class="text">My Skills</div>
<p>Over the years I have taken a lot from the classes I have taken and they have led me to a specfic set of skills. I am proficcient in Java, Python, C, JavaScript, HTML, CSS, PHP, Adobe Creative Suite Apps, and I am proficcient in MS Office products
as well.
</p>
Read more
</div>
<div class="column right">
<div class="bars">
<div class="info">
<span>Java</span>
<span>100%</span>
</div>
<div class="line html"></div>
</div>
<div class="bars">
<div class="info">
<span>Python</span>
<span>90%</span>
</div>
<div class="line css"></div>
</div>
<div class="bars">
<div class="info">
<span>JavaScript</span>
<span>80%</span>
</div>
<div class="line js"></div>
</div>
<div class="bars">
<div class="info">
<span>HTML | CSS </span>
<span>70%</span>
</div>
<div class="line php"></div>
</div>
<div class="bars">
<div class="info">
<span>PHP</span>
<span>50%</span>
</div>
<div class="line mysql"></div>
</div>
</div>
</div>
</div>
</section>
</div>
<footer class="content-footer">
<section class="footer-text">
<strong>Say hi to me on these social networks:</strong>
</section>
<ul class="social">
<i class="fab fa-twitter fa-2x mr-3"></i>
<i class="fab fa-github fa-2x mr-3"></i>
<a href="https://www.linkedin.com/in/edward-wynman/" target="_blank"><i
class="fab fa-linkedin fa-2x mr-3"></i></a>
</ul>
</footer>
</body>
You need to remove the width: 50%; on .about .about-content .right using a media query. The reason it's rendering like that is that it's using 50% of the available space on mobile, which is not much.
Could look something like this:
#media only screen and (max-width: 800px) {
.about .about-content .right {
width: 100%;
}
}
Here you go...
Add the following:
#media only screen and (max-width: 768px) {
.about .about-content .right {
width: 100% !important;
}
}
Hey in your codepen you made a mistake. The max-width needs to go from wider screens to smaller ones and not the oposite way, because, as the lower value in the page will always overwrite the further up ones, your media queries will never be met.
Put the max-width media queries at the end of the css or at least after the element you want to have a different style on smaller screens.
Then start with the highest number (max-width="1800px") and end with the lowest one (max-width="500px").
so:
//default (bigger than 993px)
.class {
font-size: 10px;
}
//992px and smaller
#media screen and (max-width:992px){
.class {
font-size: 20px;
}
}
//767px and smaller
#media screen and (max-width:767px){
.class {
font-size: 24px;
}
}
//600px and smaller
#media screen and (max-width:600px){
.class {
font-size: 32px;
}
}
Just like Cervus and Kameron have pointed out
.about .about-content .right {width: 100%}
is your main fix, then the next issue is the padding left and right on your max-width class because of
box-sizing: border-box
it will render 100% and then remove 80px of space on either side. If viewed on a small device it will be removing to much of the available space for example on 320px wide screen half the available space would be removed.
.max-width {padding: 0 80px}
Might be better being
.max-width {padding: 0 20px}
And then at a larger media query it can update to 80px when it fits.

How to resolve 3 overlapping buttons?

I have 3 dropdown buttons, on mobile view instead of displaying horizontally they are overlapping on each other. I think .filter-check:checked+label class properties needs to be reviewed. What changes can I make in my code so that buttons are displayed horizontally?
Here is my scss code
#media (min-width: 700px) {
.filter-button {
display: none;
}
.filter-check {
display: none;
}
}
#media (max-width: 700px) {
.filter {
display: none;
}
.filter-check {
display: none;
}
}
#media screen and (max-width: 700px) {
.filter-button {
background: white;
border: 1px solid black;
border-radius: 2px;
color: dark-gray;
float: right;
font-family: font-family-nimbus-sans-bold;
font-size: 18px;
height: 48px;
text-align: left;
width: 100%;
}
}
// sass-lint:disable force-pseudo-nesting
.filter-check:checked+label { ---------------> I think this class properties needs to be checked
+.filters {
.filter {
background-color: white;
display: block;
height: 100%;
left: 0;
overflow-y: auto;
padding-bottom: 65px;
position: fixed;
top: 0;
width: 100%;
}
::ng-deep {
.overlay-drop {
height: auto;
position: relative;
}
.open {
ul {
position: relative;
top: auto;
}
}
}
}
}
.filters {
display: flex;
flex-wrap: wrap;
#media screen and (min-width: 700px) {
.filter {
background-color: white;
border: 1px solid black;
border-radius: 2px;
flex-basis: 100%;
flex-grow: 1;
flex-shrink: 1;
height: 72px;
margin-right: 10px;
max-width: 224px;
&.disabled {
border-color: silver-chalice;
color: silver-chalice;
opacity: .4;
pointer-events: none;
&:hover {
cursor: no-drop;
}
}
}
}
}
Here is my html code
<ng-container>
<label class="filter-button" for="button" (click)="xy()">Coders</label>
<div class="filters">
<div class="filter">
<overlay-drop [dropdownLabel]="i18nService"
[modelDropdown]="a">
</overlay-drop>
</div>
<div class="filter">
<overlay-drop [dropdownLabel]="i18nService"
[modelDropdown]="b">
</overlay-drop>
</div>
<div class="filter">
<overlay-drop [dropdownLabel]="i18nService"
[modelDropdown]="c">
</overlay-drop>
</div>
<div class="filter">
<overlay-drop [dropdownLabel]="i18nService"
[modelDropdown]="shareClassData"></overlay-drop>
</div>
</div>
</ng-container>
/ng-container>
Try this code for scss
#media (min-width: 700px) {
.filter-button {
display: none;
}
.filter-check {
display: none;
}
}
#media (max-width: 700px) {
.filter-check {
display: none;
}
}
.filter-button {
background: white;
border: 1px solid black;
border-radius: 2px;
color: dark-gray;
float: none;
font-family: font-family-nimbus-sans-bold;
font-size: 18px;
height: 48px;
text-align: left;
width: 100%;
}
// sass-lint:disable force-pseudo-nesting
.filter-check:checked+label {
+.filters {
.filter {
background-color: white;
display: block;
height: 100%;
left: 0;
overflow-y: auto;
padding-bottom: 65px;
position: fixed;
top: 0;
width: 100%;
}
::ng-deep {
.overlay-drop {
height: auto;
position: relative;
}
.open {
ul {
position: relative;
top: auto;
}
}
}
}
}
.filters {
display: flex;
.filter {
background-color: white;
border: 1px solid black;
border-radius: 2px;
flex-basis: 100%;
flex-grow: 1;
flex-shrink: 1;
height: 72px;
margin-right: 10px;
max-width: 224px;
&.disabled {
border-color: silver-chalice;
color: silver-chalice;
opacity: .4;
pointer-events: none;
&:hover {
cursor: no-drop;
}
}
}
}
<ng-container>
<label class="filter-button" for="button" (click)="xy()">Coders</label>
<div class="filters">
<div class="filter">
<overlay-drop [dropdownLabel]="i18nService"
[modelDropdown]="a">
</overlay-drop>
</div>
<div class="filter">
<overlay-drop [dropdownLabel]="i18nService"
[modelDropdown]="b">
</overlay-drop>
</div>
<div class="filter">
<overlay-drop [dropdownLabel]="i18nService"
[modelDropdown]="c">
</overlay-drop>
</div>
<div class="filter">
<overlay-drop [dropdownLabel]="i18nService"
[modelDropdown]="shareClassData"></overlay-drop>
</div>
</div>
</ng-container>

How can I fix margin issues and div issues in HTML/CSS?

I'm trying to create a blog, however, after adding a dropdown menu sourced from W3Schools everything just went messed up. I'm new at HTML and I don't understand why my margins are messed up.
body, html {
height: 100%;
margin: 0;
font-family: 'Roboto';
color: #232323;
background-color: #ffffff;
text-align: center;
}
.bgimg-1{
position: relative;
opacity: 0.8;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-image: url("landingpage.jpg");
min-height: 100%;
}
.navbar {
overflow: hidden;
background-color: #333;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: #41bc3e;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
width: 100%;
left: 0;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content .header {
background: #41bc3e;
padding: 16px;
color: white;
}
.dropdown:hover .dropdown-content {
display: block;
}
.column {
float: left;
width: 33.33%;
padding: 10px;
background-color: #ccc;
height: 250px;
}
.column a {
float: none;
color: black;
padding: 16px;
text-decoration: none;
display: block;
text-align: left;
}
.column a:hover {
background-color: #ddd;
}
.row:after {
content: "";
display: table;
clear: both;
}
#media screen and (max-width: 600px) {
.column {
width: 100%;
height: auto;
}
}
.checked {
color: orange;
}
p {
margin-right: 600px;
margin-left: 600px;
}
.veryveryinterestingh1 {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}
.verycoolheader {
background: #232323;
text-align: center;
}
.caption {
position: absolute;
left: 0;
top: 50%;
width: 100%;
text-align: center;
color: #000;
opacity: 0.99;
}
.caption span.border {
background-color: #111;
color: #41bc3e;
padding: 18px;
font-size: 25px;
letter-spacing: 2px;
opacity: 0.99;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
margin-top: 0;
margin-bottom: 0;
}
ul {
columns: 2;
-webkit-columns: 2;
-moz-columns: 2;
margin-right: 600px;
margin-left: 600px;
}
#media all and (max-width: 768px){
body{
padding-left: 30px !important;
padding-right: 30px !important;
}
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font- awesome.min.css" rel="stylesheet"/>
<div class="verycoolheader"> <img src="logo1.png" alt="Website Logo" align="middle">
<div class="navbar">
Home
About Us
<div class="dropdown">
<button class="dropbtn">Blogs
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<div class="header">
<h2>Latest</h2>
</div>
<div class="row">
<div class="column">
<h3>First Blog</h3>
What is Theme?
</div>
<div class="column">
<h3>Second Blog</h3>
Points of View
</div>
<div class="column">
<h3></h3>
</div>
</div>
</div>
</div>
</div>
<div style="position: relative;">
<div class="bgimg-1">
<div class="caption">
<span class="border">Arabian Nights</span>
</div>
</div>
<footer style="color:#ddd;background-color:#232323;text-align:center;padding:50px 80px;text-align: center;">© Copyright 2019 Magdoub & Pejic</footer>
Pastebin:
Landing Page
About Us
Blog 1
you just add box-sizing: border-box; in .column
.column {
float: left;
width: 33.33%;
padding: 10px;
background-color: #ccc;
height: 250px;
}
because you have 10px for each column. The column width is 33.33% + 10px + 10px so it make the margin was mess.
The box-sizing: border-box include padding and border in the element's total width and height so the width will 33.33% both padding-left:10px and padding-right 10px.

Img resize to same width and height

Is there any img resize for this so that they can be on all same ratios? Because this would happen if it's not on the same image ration. My problem is that it all became like this..
Here is my html code for the card:
<div class="container">
<div class="flex-row row">
<div class="col-xs-6 col-sm-4 col-lg-3">
<div class="thumb">
<div class="caption card card-default">
<div class="card-img">
<img src="user_images/<?php echo $row['userPic'] ?>" alt="Card image" class="img-thumbnail" height="100">
</div>
<!-- Extra div added to enable alignment at bottom -->
<div class="excludingImage">
<div class="card-body">
<p class="card-text" style="color:#00873a"><b><?php echo $cartname ?></b></p>
<p class="card-text" style="color:#e81b30"><strike style="color:#aaa">₱<?php echo $orig ?>.00</strike> ₱<?php echo $cartprice ?>.00</p>
</div>
<div class="card-footer text-center">
<button type="button" class="btn btn-pink btn-sm"><i class="fa fa-shopping-cart"></i> View Product </button></div>
</div>
</div>
<!-- /.caption -->
</div>
<!-- /.thumbnail -->
</div>
</div></div>
and here is my CSS:
/* Flexbox Equal Height Bootstrap Columns (fully responsive) */
#media only screen and (min-width : 500px) {
.flex-row.row {
display: flex;
flex-wrap: wrap;
}
.flex-row.row > [class*='col-'] {
display: flex;
flex-direction: column;
}
.flex-row.row:after,
.flex-row.row:before {
display: flex;
}
.flex-row.row > [class*='col-'] > .box {
display: flex;
flex: 1;
}
}
/* Grow thumbnails to fill columns height */
.flex-row .thumb,
.flex-row .caption {
display: flex;
flex: 1 0 auto;
flex-direction: column;
}
/* Flex Grow Text Container */
.flex-row .caption p.flex-text {
flex-grow: 1;
}
/* Flex Responsive Image */
.flex-row img {
width: 100%;
height: auto;
}
.thumb{
padding-bottom: 10px;
}
.caption{
}
/* EXAMPLE 2 - CSS TABLES EQUAL HEIGHT
- ie9 support
- not responsive (mobile fallback)
*/
.table-row.row,
.table-row-equal {
display: table;
width: 100%;
table-layout: fixed;
word-wrap: break-word;
}
.table-row.row [class*="col-"] {
width: 25%;
}
.table-row.row [class*="col-"],
.table-row-equal .thumb {
float: none;
display: table-cell;
vertical-align: top;
}
.table-row-equal {
border-spacing: 30px 0px;
}
.table-row-equal .thumb {
width: 1%;
}
/* mobile fallback to support partial responsiveness */
#media only screen and (max-width: 500px) {
.table-row-equal .thumb {
display: block;
width: 100%;
}
}
/* MASONARY BOOTSTRAP 3 GRID
- Who needs V4?
*/
.masonary-row.row {
-webkit-column-gap: 30px;
column-gap: 30px;
padding-left: 15px;
padding-right: 15px;
word-wrap: break-word;
-webkit-column-fill: balance;
column-fill: balance;
}
.masonary-row [class*="col-"] {
display: inline-block;
width: 100%;
height: 100%;
float: none;
padding: 0px;
-webkit-column-fill: balance;
column-fill: balance;
}
#media (min-width: 480px) {
.masonary-row.row {
-webkit-column-count: 2;
column-count: 2;
}
}
#media (min-width: 768px) {
.masonary-row.row {
-webkit-column-count: 3;
column-count: 3;
}
}
/* demo */
.bootflex .well {
flex-grow: 1;
}
/* pre hack for small devices */
pre {
display: flex;
flex: 1;
}
.flex-row.flex-code.row > [class*='col-'] .flex-text {
flex-grow: 1;
display: flex;
}
.overview {
display: flex;
padding-right: 10px;
}
.card-default {
display: flex;
flex-wrap: wrap;
}
.card-default>* {
width: 100%;
}
.excludingImage {
align-self: flex-end;
text-align: center;
}
.card {
background-color: #fff;
border: 1px solid transparent;
border-radius: 6px;
}
.card>.card-link {
color: #333;
}
.card>.card-link:hover {
text-decoration: none;
}
.card>.card-link .card-img img {
border-radius: 6px 6px 0 0;
}
.card .card-body {
/* display: table;
width: 100%; */
padding: 12px;
}
.card .card-header {
border-radius: 6px 6px 0 0;
padding: 8px;
}
.card .card-footer {
border-radius: 0 0 6px 6px;
padding: 8px;
}
/*
.card .card-left {
position: relative;
float: left;
padding: 0 0 8px 0;
}
.card .card-right {
position: relative;
float: left;
padding: 8px 0 0 0;
}
*/
.card .card-body h1:first-child,
.card .card-body h2:first-child,
.card .card-body h3:first-child,
.card .card-body h4:first-child,
.card .card-body .h1,
.card .card-body .h2,
.card .card-body .h3,
.card .card-body .h4{ margin-top: 0; }
.card .card-body .heading{ display: block; }
.card .card-body .heading:last-child{ margin-bottom: 0; }
.card .card-body .lead{ text-align: center; }
#media( min-width: 768px ){
.card .card-left{ float: left; padding: 0 8px 0 0; }
.card .card-right{ float: left; padding: 0 0 0 8px; }
.card .card-4-8 .card-left{ width: 33.33333333%; }
.card .card-4-8 .card-right{ width: 66.66666667%; }
.card .card-5-7 .card-left{ width: 41.66666667%; }
.card .card-5-7 .card-right{ width: 58.33333333%; }
.card .card-6-6 .card-left{ width: 50%; }
.card .card-6-6 .card-right{ width: 50%; }
.card .card-7-5 .card-left{ width: 58.33333333%; }
.card .card-7-5 .card-right{ width: 41.66666667%; }
.card .card-8-4 .card-left{ width: 66.66666667%; }
.card .card-8-4 .card-right{ width: 33.33333333%; }
}
/* -- default theme ------ */
.card-default{
border-color: #ddd;
background-color: #fff;
margin-bottom: 24px;
}
.card-default > .card-header,
.card-default > .card-footer{ color: #333; background-color: #fdfdfd; }
.card-default > .card-header{ border-bottom: 1px solid #ddd; padding: 8px; }
.card-default > .card-footer{ border-top: 1px solid #ddd; padding: 8px; }
.card-default > .card-body{ }
.card-default > .card-img:first-child img{ border-radius: 6px 6px 0 0; }
.card-default > .card-left{ padding-right: 4px; }
.card-default > .card-right{ padding-left: 4px; }
.card-default p:last-child{ margin-bottom: 0; }
.card-default .card-caption { color: #fff; text-align: center; text-transform: uppercase; }
/* -- price theme ------ */
.card-price{ border-color: #999; background-color: #ededed; margin-bottom: 24px; }
.card-price > .card-heading,
.card-price > .card-footer{ color: #333; background-color: #fdfdfd; }
.card-price > .card-heading{ border-bottom: 1px solid #ddd; padding: 8px; }
.card-price > .card-footer{ border-top: 1px solid #ddd; padding: 8px; }
.card-price > .card-img:first-child img{ border-radius: 6px 6px 0 0; }
.card-price > .card-left{ padding-right: 4px; }
.card-price > .card-right{ padding-left: 4px; }
.card-price .card-caption { color: #fff; text-align: center; text-transform: uppercase; }
.card-price p:last-child{ margin-bottom: 0; }
.card-price .price{
text-align: center;
color: #337ab7;
font-size: 3em;
text-transform: uppercase;
line-height: 0.7em;
margin: 24px 0 16px;
}
.card-price .price small{ font-size: 0.4em; color: #66a5da; }
.card-price .details{ list-style: none; margin-bottom: 24px; padding: 0 18px; }
.card-price .details li{ text-align: center; margin-bottom: 8px; }
.card-price .buy-now{ text-transform: uppercase; }
.card-price table .price{ font-size: 1.2em; font-weight: 700; text-align: left; }
.card-price table .note{ color: #666; font-size: 0.8em; }
Thanks! It would help me a lot to know if my img tag can be resized for same width and height.. so my card won't be like from the above..
You can set a "frame" to crop out/hide the extra width/height you want so they are all seen as the same dimensions, you need to wrap your img in a div and apply some styling to it.
You can see the concept here. I have made the image to crop to center, but easily changeable.
HTML
<div class="img-wrap">
<img src="https://placehold.it/250x200" class="img-wrap__img">
</div>
<div class="img-wrap">
<img src="https://placehold.it/550x700" class="img-wrap__img">
</div>
CSS
.img-wrap {
position: relative;
width: 200px;
height: 150px;
overflow: hidden;
}
.img-wrap__img {
position: absolute;
width: 100%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
You can use padding-top trick to control the aspect ratio of the container.
HTML
<div class="square"
style="background-image: url('https://dummyimage.com/120x80/000/fff.png')">
</div>
CSS
.square {
width: 90px;
border: 1px solid #ccc;
border-radius: 8px;
background-position: center center;
background-repeat: no-repeat;
}
.square::before {
content: '';
display: block;
padding-top: 100%;
}

Where did all the text go on mobile site? Elements not appearing on iPhone.

I have created a website for my dad as a favour for putting me through design school. After uploading it to the network hosting site that my dad uses I discovered that when opening the site on my iPhone, all the text (or most of it) completely disappears. I am not sure what is doing this because when I test the site through Chrome Developer Tools, JsFiddle, etc it appears to be fine. The site is pretty simple so I am using Flexbox for the layout. Let me know if you need any other details.
I am not sure what is going on and would very much appreciate it if someone could take a poke around and point me in the right direction. I am providing a JsFiddle that includes the homepage html and the relevant CSS as well as posting it here. Thanks.
https://jsfiddle.net/ericvnwk/vfnejmw7/2/
The HTML:
<title>
Fairfield Tree Nurseries Inc.</title>
<script src="https://use.typekit.net/hlp7xgg.js"></script>
<script>
try {
Typekit.load({
async: true
});
} catch (e) {}
</script>
<body>
<div class="header">
<img class="logo" src="https://s1.postimg.org/1ic483yqhr/logo.png" alt="Fairfield Tree Nurseries Inc." width="80px" height="80px">
<div class="title"> Fairfield Tree Nurseries Inc.
</div>
<nav class="navbar navtop">
<ul>
<li>About</li>
<li>Products</li>
<li>Shipping</li>
<li>Location</li>
<li>Contact</li>
</ul>
</nav>
</div>
<div class="header-border">
</div>
<div class="main">
<div class="fw-content fw-top">
<div class="fw-image">
<img src="https://s1.postimg.org/1ic4840vnj/welcome.jpg" alt="Welcome to Fairfield Tree Nurseries">
</div>
<div class="cntr-type">
<h2> Welcome to </h2>
<h1> Fairfield Tree Nurseries </h1>
</div>
</div>
<div class="arrow">
<div class="down-arrow"></div>
</div>
<div class="fw-content below">
<div class="fw-image">
<img src="https://s1.postimg.org/1lvq5tqycf/about-home.jpg" alt="Welcome to Fairfield Tree Nurseries">
</div>
<div class="cntr-type">
<h4 id="green"> We are a wholesale tree nursery producing field <br> grown nursery stock in the Lower Fraser Valley <br> community of Chilliwack, British Columbia. </h4>
<div class="btn" id="green-btn">
<a href="about.html">
<h3>Learn More</h3></a>
</div>
</div>
</div>
<div class="fw-content">
<div class="fw-image">
<img src="https://s1.postimg.org/51y1xx3dpr/field-wide.jpg" alt="Field wide angle">
</div>
<div class="cntr-type up">
<h4 class="shadow" id="white"> We offer an expanded product line to include a wide <br> range of field grown grafted conifers, specialty broadleaf <br> evergreen/deciduous shrubs and specimen plant material. </h4>
<div class="btn btn-shadow" id="white-btn">
<a href="products.html">
<h3 class="">Discover More</h3></a>
</div>
</div>
</div>
<div class="hw-content hide">
<div class="hw-left">
<div class="cntr-type cntr-type-special">
<h4 id="white"> Our products can be found throughout <br> North America and we pride ourselves in <br> providing expert service and support to all <br> of our clients, wherever they are. </h4>
<div class="btn" id="white-btn">
<a href="shipping.html">
<h3>Shipping Info</h3></a>
</div>
</div>
</div>
<div class="hw-right">
<img src="https://s1.postimg.org/2lbtizus33/leaves-sky-wide.jpg">
<div class="cntr-type cntr-type-special">
<h4 id="green"> We are located in the Lower <br> Fraser Valley community of Chilliwack, <br> British Columbia, Canada. </h4>
<div class="btn" id="green-btn">
<a href="location.html">
<h3>View Map</h3></a>
</div>
</div>
</div>
</div>
<div class="fw-content hidden-content empty bkg-green">
<div class="cntr-type">
<h4 id="white"> Our products can be found throughout <br> North America and we pride ourselves in <br> providing expert service and support to all <br> of our clients, wherever they are. </h4>
<div class="btn" id="white-btn">
<a href="shipping.html">
<h3>Shipping Info</h3></a>
</div>
</div>
</div>
<div class="fw-content hidden-content">
<div class="fw-image">
<img src="https://s1.postimg.org/2lbtizus33/leaves-sky-wide.jpg">
</div>
<div class="cntr-type">
<h4 id="green"> We are located in the Lower <br> Fraser Valley community of Chilliwack, <br> British Columbia, Canada. </h4>
<div class="btn" id="green-btn">
<a href="location.html">
<h3>View Map</h3></a>
</div>
</div>
</div>
<div class="fw-content empty">
<div class="cntr-type">
<h4 id="green"> For more information or to place an order please contact us, <br> we would love to hear from you. </h4>
<div class="btn" id="green-btn">
<a href="contact.html">
<h3>Contact Us</h3></a>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="footer-main">
<img src="https://s1.postimg.org/8ax5ukoq6n/logo-white.png">
<!--<div class="logo-footer">
</div> -->
<div class="title" style="color: white;"> Fairfield Tree Nurseries </div>
<nav class="navbar navfoot">
<ul>
<li>Home</li>
<li>About</li>
<li>Products</li>
<li>Shipping</li>
<li>Location</li>
<li>Contact</li>
</ul>
</nav>
</div>
</div>
<div class="copyright">
<p> © 2017 Fairfield Tree Nurseries Inc. All rights reserved.
</div>
</body>
And the CSS:
body {
margin: 0 auto;
font-family: "proxima-nova-alt", sans-serif;
text-align: center;
position: relative;
color: #707070;
}
/*================ NAV & HEADER STYLES + FOOTER ==================*/
.header {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
top: 0;
height: 120px;
padding: 15px 40px 15px 40px;
max-width: 1200px;
margin: 0 auto;
}
.header-border {
background-color: #009948;
height: 2px;
width: 100%;
}
.title {
font-size: 24px;
font-weight: 300;
color: #009948;
padding-left: 20px;
text-align: left;
}
.navbar {
margin-left: auto;
}
.navbar ul {
list-style: none;
margin: 0;
padding: 0;
}
.navbar li {
display: inline-block;
font-weight: 400;
font-size: 16px;
padding-left: 4vw;
}
.navbar a {
text-decoration: none;
color: #969696;
text-transform: uppercase;
letter-spacing: 2px;
transition: .3s color;
}
.navbar a:hover {
color: #009948;
}
.footer {
width: 100%;
max-width: 1200px;
background-color: #333;
}
.footer-main {
height: 200px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
padding: 20px 80px 0px 80px;
margin: 0 auto;
}
.footer h6 a {
transition: .3s color;
}
.footer h6 a:hover {
color: #009948;
}
.copyright {
height: 80px;
padding: 20px;
color: #505050;
background-color: rgba(10, 10, 10, .5);
padding: 40px 80px 10px 80px;
}
.copyright p {
text-align: left;
font-size: 16px;
letter-spacing: 1px;
font-weight: 400;
max-width: 1500px;
margin: 0 auto;
}
.navfoot a {
color: #707070;
transition: .3s color;
}
.navfoot a:hover {
color: white;
}
/*================ PAGES STYLES ===================*/
.main {
max-width: 1500px;
margin: 0 auto;
overflow: hidden;
}
/*=============== Home PAGE ================*/
.fw-content {
display: flex;
flex-direction: column;
width: 100%;
height: 600px;
align-items: center;
justify-content: center;
position: relative;
z-index: 3;
}
.fw-top {
border-top: 2px solid white;
}
.below {
margin-top: -30px;
position: relative;
z-index: 1;
}
.fw-image img {
max-height: 600px;
}
.hw-content {
display: flex;
flex-direction: row;
width: 100%;
height: 600px;
position: relative;
background-color: #009948;
max-width: 1500px;
margin: 0 auto;
margin-top: -2px;
}
.hw-left {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 50%;
}
.hw-right {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
width: 50%;
margin-left: auto;
}
.hw-right img {
height: 600px;
}
.cntr-type {
position: absolute;
left: auto;
}
.up {
margin-top: -60px;
}
.arrow {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
z-index: 2;
}
.down-arrow {
margin: -2px;
width: 0;
height: 0;
border-right: 30px solid transparent;
border-left: 30px solid transparent;
border-top: 30px solid #009948;
}
/*================ TEXT STYLES ===================*/
h1 {
font-size: 60px;
color: #fff;
text-transform: uppercase;
letter-spacing: 2px;
margin: 0;
}
h2 {
margin: 0;
font-size: 36px;
font-weight: 100;
letter-spacing: 2px;
color: white;
text-transform: uppercase;
}
h3 {
font-size: 12px;
font-weight: 300;
text-transform: uppercase;
letter-spacing: 2px;
margin: 0;
}
h4 {
font-size: 24px;
line-height: 36px;
font-weight: 300;
letter-spacing: 0.1px;
}
h5 {
text-align: left;
font-size: 24px;
font-weight: 400;
color: #009948;
margin: 10px 0 0 0;
letter-spacing: 1px;
}
h6 {
font-size: 16px;
letter-spacing: 2px;
text-transform: uppercase;
text-align: left;
margin: 20px 0 0 0;
}
p {
font-size: 20px;
line-height: 28px;
font-weight: 300;
letter-spacing: 0.1px;
text-align: left;
}
a {
text-decoration: none;
color: inherit;
}
.currentlink a {
color: #009948;
}
#green {
color: #009948;
}
#grey {
color: #2f2f2f;
}
#white {
color: #fff;
}
.shadow {
text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}
/*================ BUTTON STYLES ====================*/
.btn {
width: 150px;
height: 30px;
margin: auto;
border: 2px solid;
border-radius: 20px;
line-height: 30px;
}
.btn a {
text-decoration: none;
}
#green-btn {
background-color: rgba(0, 153, 72, 0);
border-color: #009948;
color: #009948;
transition: .5s background-color, color;
margin-bottom: 15px;
}
#white-btn {
background-color: rgba(255, 255, 255, 0);
border-color: #fff;
color: #fff;
transition: .5s background-color, color;
}
#green-btn:hover {
border-color: #009948;
background-color: rgba(0, 153, 72, 1);
color: #fff;
}
#white-btn:hover {
border-color: #fff;
background-color: rgba(255, 255, 255, 1);
color: #009948;
text-shadow: none;
}
.btn-shadow {
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}
/*================================
RESPONSIVE Styling
================================*/
#media screen and (min-width:500px) {
.hidden-content {
display: none;
}
}
#media screen and (max-width:500px) {
.header {
flex-direction: column;
height: inherit;
padding-left: 0;
padding-right: 0;
padding-bottom: 0;
}
.title {
text-align: center;
width: 100%;
padding: 0;
margin-top: 10px;
}
.navbar {
margin: 15px 0 0 0;
width: 100%;
padding: 0;
}
.navbar ul {
display: flex;
flex-direction: column;
}
.navbar li {
font-weight: 400;
padding: 7.5px 0 7.5px 0;
border-top: 2px solid #009948;
width: 100%;
}
.navbar a {
text-decoration: none;
width: inherit;
margin: 100px;
}
.navbar a:active {
background-color: white;
color: #009948;
}
.navtop {
padding: 10px 0 0 0;
}
.main {
overflow: hidden;
}
.arrow {
margin-top: -4px;
}
.cntr-type {
padding: 0 5%;
}
.up {
margin-top: 0px;
}
.btn {
width: 120px;
height: 30px;
margin: auto;
border: 2px solid;
border-radius: 20px;
line-height: 30px;
}
.btn-shadow {
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
box-shadow: inset 2px 2px 40px rgba(255, 255, 255, 0.5);
}
.hide {
display: none;
}
.hidden-content {
display: flex;
}
.footer {
flex-direction: column;
justify-content: center;
height: inherit;
padding-left: 0;
padding-right: 0;
padding-bottom: 5px;
}
.footer-main {
display: flex;
flex-direction: column;
padding: 30px 0 0 0;
height: inherit;
}
.navfoot {
background-color: #707070;
padding: 0px;
}
.navfoot li {
border-color: #333;
}
.navfoot a {
color: #333;
}
.copyright {
padding: 20px 0 0 0;
}
.copyright p {
width: 80%;
}
.questions {
padding-top: 0;
}
.question-box {
margin-top: 30px;
}
/*==============FONT STYLES==============*/
h1 {
font-size: 36px;
}
h2 {
font-size: 24px;
}
h3 {
font-size: 10px;
font-weight: 400;
}
h4 {
font-size: 16px;
line-height: 24px;
}
br {
display: none;
}
p {
font-size: 18px;
}
}
#media screen and (max-width:1024px) and (min-width:500px) {
.header {
flex-direction: column;
padding: 20px 0 0 0;
height: inherit;
}
.navbar {
margin: 0;
}
.navtop {
padding: 10px 0 0 0;
}
.title {
margin: 10px 0 10px 0;
}
}
#media screen and (max-width:1024px) {
.fw-content {
height: inherit;
overflow: hidden;
}
.fw-image {
height: inherit;
}
.fw-image img {
width: auto;
height: 45vh;
display: flex;
justify-content: space-between;
}
.fw-top {
border: none;
}
.cntr-type {
padding: 0 10%;
}
.cntr-type-special {
padding: 0;
width: 300px;
}
.cntr-type-special h4 {
font-size: 20px;
line-height: 32px;
}
.empty {
height: 60vh;
}
.empty-s {
height: 40vh;
}
h4 br {
display: none;
}
.question-mark {
margin-top: -30px;
}
}
#media screen and (min-width: 501px) {
.navtop {
padding: 10px 0 10px 0;
}
}
#media screen and (max-width: 700px) {
.bkg-green {
background-color: #009948;
}
.hw-contact .contact-info {
display: none;
}
.contact-info {
width: 75%;
}
.fw-contact {
padding: 15px 0 25px 0;
}
.contact-form {
width: 100%;
}
.contact-form form {
width: 90%;
}
}
#media screen and (min-width:700px) {
.hidden-content2 {
display: none;
}
}
#media screen and (min-width:1240px) {
.header {
max-width: none;
}
.footer {
max-width: none;
}
}
#media screen and (min-width:1580px) {
.header {
padding: 15px 0 15px 0;
max-width: 1500px;
}
.footer-main {
max-width: 1500px;
}
.copyright {}
}
You are adding the hidden-content and hide classes which have display: none in them.