Difficulty Positioning Background image

0

[! [insert image description here] [1]] [1] Sirs, I am trying to position an image in the background of my project, but when using the cover it cuts the bottom part, and how much do I use any other way it replicates the image and 4 squares, as attached below, could you give me a light on how to adjust this problem?

 width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
.jumbo {
	background-image: url(../Images/metaVendedores.png");
	background-size: cover;
}
.container {
  width: 90%;
  margin: 0 auto;
  box-sizing: border-box;
  border: 1px solid red;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 1rem;
}
.box {
  width: calc(50% - 2rem);
  height: 2rem;
  margin: 1.5em 1em;
  box-sizing: border-box;
  border: 1px solid black;
  display: flex;
}
.p1, .p2, .p3 {
  display: flex;
  align-items: center;
  justify-content: center;
  color: red;
  font-family: sans-serif;
  font-weight: bold;
  background-color: #ffffff;
}
.p1 {
  flex-grow: 3;
}
.p2 {
  flex-grow: 2;
  background-color: red;
  color: #fff;
  position: relative;
}
.p3 {
  flex-grow: 1;
}
.p2::after {
  content: "texto";
  width: 100%;
  height: 1.5em;
  position: absolute;
  top: -1.5em;
  left: 0;
  background-color: red;
  line-height: 1.5em;
  text-align: center;
  box-shadow: inset 0 0 0.2em rgba(0, 0, 0, 0.5);
}
<div class="jumbo">

  <div class="container">

    <div class="box">

      <div class="p1">
        <c:out value="${VN1.rows[0].FUNCIONARIO}" />
      </div>
      <div class="p2">
        <fmt:formatNumber value="${VN1.rows[0].META}" type="currency" />
      </div>
      <div class="p3">
        <c:out value="${VN1.rows[0].ACUMULADO}" />%
      </div>
    </div>

    <div class="box">
      <div class="p1">
        <c:out value="${VN2.rows[0].FUNCIONARIO}" />
      </div>
      <div class="p2">
        <fmt:formatNumber value="${VN2.rows[0].META}" type="currency" />
      </div>
      <div class="p3">
        <c:out value="${VN2.rows[0].ACUMULADO}" />%
      </div>
    </div>

    <div class="box">
      <div class="p1">
        <c:out value="${VN3.rows[0].FUNCIONARIO}" />
      </div>
      <div class="p2">
        <fmt:formatNumber value="${VN3.rows[0].META}" type="currency" />
      </div>
      <div class="p3">
        <c:out value="${VN3.rows[0].ACUMULADO}" />%
      </div>
    </div>

    <div class="box">
      <div class="p1">
        <c:out value="${VN4.rows[0].FUNCIONARIO}" />
      </div>
      <div class="p2">
        <fmt:formatNumber value="${VN4.rows[0].META}" type="currency" />
      </div>
      <div class="p3">
        <c:out value="${VN4.rows[0].ACUMULADO}" />%
      </div>
    </div>

    <div class="box">
      <div class="p1">
        <c:out value="${VN5.rows[0].FUNCIONARIO}" />
      </div>
      <div class="p2">
        <fmt:formatNumber value="${VN5.rows[0].META}" type="currency" />
      </div>
      <div class="p3">
        <c:out value="${VN5.rows[0].ACUMULADO}" />
		</div>
      </div>
    </div>
  </div>

    

asked by anonymous 10.10.2018 / 15:42

1 answer

1

Try the following:

.jumbo{  
  background-image: url(../Images/metaVendedores.png");  
  background-repeat: no-repeat;  <--não repete a imagem
  background-position: 0% 0%; <-- Posição da imagem
  background-size: 100% 100%; <--tamanho da imagem
}

You can try this too:

.jumbo{
    background: rgba(0, 0, 0, 0) url(../Images/metaVendedores.png") no-repeat scroll center center / cover;
}

Below is a snippet with your changed code:

 width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.jumbo{
    background: rgba(0, 0, 0, 0) url('https://i.stack.imgur.com/Cg2MS.png') no-repeat scroll center center / cover;
}

.container {
  width: 90%;
  margin: 0 auto;
  box-sizing: border-box;
  border: 1px solid red;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 1rem;
}
.box {
  width: calc(50% - 2rem);
  height: 2rem;
  margin: 1.5em 1em;
  box-sizing: border-box;
  border: 1px solid black;
  display: flex;
}
.p1, .p2, .p3 {
  display: flex;
  align-items: center;
  justify-content: center;
  color: red;
  font-family: sans-serif;
  font-weight: bold;
  background-color: #ffffff;
}
.p1 {
  flex-grow: 3;
}
.p2 {
  flex-grow: 2;
  background-color: red;
  color: #fff;
  position: relative;
}
.p3 {
  flex-grow: 1;
}
.p2::after {
  content: "texto";
  width: 100%;
  height: 1.5em;
  position: absolute;
  top: -1.5em;
  left: 0;
  background-color: red;
  line-height: 1.5em;
  text-align: center;
  box-shadow: inset 0 0 0.2em rgba(0, 0, 0, 0.5);
}
<div class="jumbo">

  <div class="container">

    <div class="box">

      <div class="p1">
        <c:out value="${VN1.rows[0].FUNCIONARIO}" />
      </div>
      <div class="p2">
        <fmt:formatNumber value="${VN1.rows[0].META}" type="currency" />
      </div>
      <div class="p3">
        <c:out value="${VN1.rows[0].ACUMULADO}" />%
      </div>
    </div>

    <div class="box">
      <div class="p1">
        <c:out value="${VN2.rows[0].FUNCIONARIO}" />
      </div>
      <div class="p2">
        <fmt:formatNumber value="${VN2.rows[0].META}" type="currency" />
      </div>
      <div class="p3">
        <c:out value="${VN2.rows[0].ACUMULADO}" />%
      </div>
    </div>

    <div class="box">
      <div class="p1">
        <c:out value="${VN3.rows[0].FUNCIONARIO}" />
      </div>
      <div class="p2">
        <fmt:formatNumber value="${VN3.rows[0].META}" type="currency" />
      </div>
      <div class="p3">
        <c:out value="${VN3.rows[0].ACUMULADO}" />%
      </div>
    </div>

    <div class="box">
      <div class="p1">
        <c:out value="${VN4.rows[0].FUNCIONARIO}" />
      </div>
      <div class="p2">
        <fmt:formatNumber value="${VN4.rows[0].META}" type="currency" />
      </div>
      <div class="p3">
        <c:out value="${VN4.rows[0].ACUMULADO}" />%
      </div>
    </div>

    <div class="box">
      <div class="p1">
        <c:out value="${VN5.rows[0].FUNCIONARIO}" />
      </div>
      <div class="p2">
        <fmt:formatNumber value="${VN5.rows[0].META}" type="currency" />
      </div>
      <div class="p3">
        <c:out value="${VN5.rows[0].ACUMULADO}" />
		</div>
      </div>
    </div>
  </div>
    
10.10.2018 / 16:20