0

My height isn't being responsive. I referenced this question:

Why is min-height not working?

but it still isn't working. My site to reference is http://horsescowsandcemeteries.com/.

I want it to work for both desktop and mobile. Thanks.

Vh isn't working.

  • What exactly do you want scaled? The website already seems responsive. – Nanoo Jun 27 '20 at 13:31
  • you have to provide an example of your problem, because you certainly missed many points in you code. Please read: https://stackoverflow.com/help/how-to-ask – Mister Jojo Jun 27 '20 at 13:35

2 Answers2

0

You can use the "viewport" meta tag to scale your website similarly to the browser version. Simply place the code below into the head element.

<meta name="viewport" content="width=device-width, initial-scale=1.0">


And if you want to fix the body background when scaling, you can use this:

body {
    height: fit-content;
}

Before / After

Nanoo
  • 836
  • 8
  • 16
0

Add <meta name="viewport" content="width=device-width, initial-scale=1.0"> to your HTML and add try this css

/*Game Play Screen */

body {
  display: flex;
  flex-direction: column;
  margin: auto;
  border: 3px solid green;
  padding: 10px;
  background-image: url(images/road-bg.jpg);
  background-size: cover;
  font-family: "Krona One";
  text-align: center;
}

main {
  display: flex;
  flex: 1;
  margin-bottom: 25px;
}

#container {
  display: flex;
  flex: 1;
  justify-content: space-around;
}

.team-one, .team-two {
  width: 50%;
}

#left-side,
#right-side {
  display: flex;
  flex: 1;
  height: 100%;
  flex-direction: column;
}

#instructions {
  margin-bottom: 2em;
  text-align: center;
  background-color: green;
  font-size: 140%;
}

#instructionsButton {
  background-color: green;
  color: white;
  padding: 0.5em 1em 0.5em 1em;
  text-decoration: none;
  font-size: 1.5em;
  border-radius: 10px;
}

.teamBox {
  color: white;
  background: #333;
  padding: 1em;
  border-radius: 5px;
  border: 6px solid white;
  width: 160px;
  height: 80px;
  margin-bottom: 1em;
  display: inline-block;
  -webkit-box-shadow: 3px 3px 5px 0px rgba(0, 0, 0, 0.44);
  -moz-box-shadow: 3px 3px 5px 0px rgba(0, 0, 0, 0.44);
  box-shadow: 3px 3px 5px 0px rgba(0, 0, 0, 0.44);
  margin: 5em auto;
}

.teamBox h3,
p {
  margin-top: 0;
  margin-bottom: 0;
}

#scoreTotalTeamOne,
#scoreTotalTeamTwo {
  font-size: 2.5em;
}

#endButton {
  background-color: #be1e2d;
  color: white;
  padding: 0.5em 1em 0.5em 1em;
  text-decoration: none;
  font-size: 2em;
  border-radius: 10px;
  margin-bottom: 2em;
}

.gameplaybutton {
  width: 200px;
  height: 200px;
  margin: auto;
}

/* First breakpoint, elimates the road */
@media only screen and (max-width: 675px) {
  body {
    height: auto;
    background: url(images/road-bg-sm.jpg);
    background-size: cover;
  }
  .teamBox {
    width: 100px;
    height: 100px;
  }
 #instructionsButton{
   font-size: 1em;
 }
}

/* Second breakpoint */
@media only screen and (max-width: 550px) {
  .gameplaybutton {
    width: 150px;
    height: 150px;
  }
}

Marik Ishtar
  • 2,899
  • 1
  • 13
  • 27