CSS - background-image no sale completo

 
Vista:
sin imagen de perfil

background-image no sale completo

Publicado por Manuel (2 intervenciones) el 22/05/2017 01:44:26
Hola, tengo un problema con mi web, tengo puesta una imagen de fondo, que quiero que se amplie o reduzca dependiendo de la ventana del navegador. Lo he conseguido con la función cover, pero no consigo que salga entera, cuando no me corta la parte de abajo corta la derecha, ...
¿Podríais echarme una mano a ver qué estoy poniendo mal?
Muchas gracias.
Si queréis ver la web online para ver el fallo lo podéis hacer en: www.happylandparc.es
Y el código es el que sigue:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Happylandparc</title>
    <meta name= "description" content="Happylandparc, parque infantil. Ven a pasar un rato agradable con nosotros. Y si te entra hambre, o quieres celebrar tu cumpleaños con nosotros tenemos menús para todas las edades".>
    <meta name= "keywords" content="parque, bolas, menus, hamburquesa, perrito, frankfurt, torra, niño, infantil, junior, papis, comida, cumpleaños, celebracion, " >
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js" type="text/javascript"></script>
 
	<style>
	@font-face {
  font-family: [dk Lemon Yellow Sun];
  src:  url("/Fonts/DK_Lemon_Yellow_Sun.otf.otf") format("opentype"),;
  font-family: [lie to Me];
  src:  url("/Fonts/Lie_to_Me.otf") format("opentype"),;
}
	body {
	font-family: "dk Lemon Yellow Sun", "lie to Me", "VAG Rounded Std Light", "VAG Rounded Std Thin";
	background-color: #94b5e0;	
	background-repeat: no-repeat
        background-size: cover;
	-moz-background-size: cover;
	-webkit-background-size: cover;
	-o-background-size: cover;
}
	img src{
    max-width: 100%;
    height: auto;
    width: auto/9; /* Bug de ie8 */
}
	#cuerpo{
	background-image: url(img/masde1500/GalletaBlanca.png);
	background-repeat: no-repeat
        background-size: cover;
	-moz-background-size: cover;
	-webkit-background-size: cover;
	-o-background-size: cover;
	background-attachment: scroll;
	margin-top: 3%;
	margin-right: 3%;
	margin-left: 3%;
}
	#cabecera{
	max-width: 100%;
	min-height: 205px;
	position: relative;
	margin: 3%;
	padding-top: 3%;
}
	#logo {	
	float: left;
}
    #direccion {
	font-family: "vag rounded std light";
	color: #666;
	font-size: 18px;
	float: right;
}
	#menugrande {
	max-width: 100%;
	min-height: 220px;
	padding-right: 5%;
	margin-top: 5%;
	margin-right: 3%;
	margin-bottom: 5%;
	margin-left: 3%;
}
	#menugrande img {
	max-width: 100%;
	height: auto;
	width: auto/9;
	clear: left;
}
	#menugrande ul {
	text-align: justify;
	width: 100%;
	list-style: none;
}
	#menugrande ul:after{
    content: ".";
    display: inline-block;
    width: 100%;
    height: 0;
    visibility: hidden;
}
	#menugrande ul li{
	display: inline-block;
}
	.redes {
	clip: rect(auto,auto,auto,100px);
	max-width: 100%;
    height: auto;
    width: auto/9; /* Bug de ie8 */
}
}
 
@media (max-width: 1200px) {
    #cuerpo {
		background-image: url(img/1200px/GalletaBlanca.png);
		min-height: 520px;
}
	#cabecera {
		min-height: 165px;
}
	#direccion {
		font-size: 16px;
}
	#menugrande{
		min-height: 186px;
		padding-right: 7%;
}
}
@media (max-width: 768px) {
    #cuerpo {
        background-image: url(img/768px/GalletaBlanca.png);
		min-height: 332px;
}
	#cabecera {
		min-height: 110px;
}
	#direccion {
		font-size: 12px;
}
	#menugrande{
		min-height: 125px;
		padding-right: 10%;
}
}
@media (max-width: 480px) {
    #cuerpo {
        background-image: url(img/480px/GalletaBlanca.png);
		min-height: 210px;
    }
	#cabecera {
		min-height: 70px;
}
	#direccion {
		font-size: 8px;
}
	#menugrande{
		min-height: 80px;
		padding-right: 15%;
}
}
    </style>
 
</head>
 
<body>
<div id="cuerpo">
  <div id="cabecera">
  		<div id="logo"><a href="#"><img src="img/480px/Logotipo.png"
      srcset="img/768px/Logotipo.png 768w,
      		img/1200px/Logotipo.png 1200w,
        	img/masde1500/Logotipo.png 1500w" /></a>
        </div>
   	<div id="direccion">
      <p>C/ Juan Izquierdo 66 B<br />
        46160 Llíria, Valencia</p>
      <div class="redes">
      <a href="#"><img src="img/480px/Facebook.png"
      srcset="img/768px/Facebook.png 768w,
      		img/1200px/Facebook.png 1200w,
        	img/masde1500/Facebook.png 1500w" /></a>
 
      <a href="#"><img src="img/480px/Instagram.png"
      srcset="img/768px/Instagram.png 768w,
      		img/1200px/Instagram.png 1200w,
            img/masde1500/Instagram.png 1500w" /></a>
      <a href="mailto:info@happylandparc.es"><img src="img/480px/mail.png"
      srcset="img/768px/Mail.png 768w,
      		img/1200px/Mail.png 1200w,
        	img/masde1500/Mail.png 1500w" /></a>
      </div>
    </div>
  </div>
  <div id= "menugrande">
      <ul>
        <li><a title="Happycumples" href="#"> <img src="img/480px/Cumples.png"
     srcset="img/768px/Cumples.png 768w,
             img/1200px/Cumples.png 1200w, 
             img/masde1500/Cumples.png 1500w" /></a></li>
        <li><a title="happymenu" href="#" /><img src="img/480px/Menus.png"
     srcset="img/768px/Menus.png 768w,
             img/1200px/Menus.png 1200w, 
             img/masde1500/Menus.png 1500w" /></a></li>
        <li><a title="happyparc" href="#" /><img src="img/480px/Parc.png"
     srcset="img/768px/Parc.png 768w,
             img/1200px/Parc.png 1200w, 
             img/masde1500/Parc.png 1500w" /></a></li>
        <li><a title="happycontacto" href="mailto:info@happylandparc.es" /><img src="img/480px/Contacto.png"
     srcset="img/768px/Contacto.png 768w,
             img/1200px/Contacto.png 1200w, 
             img/masde1500/Contacto.png 1500w" /></a></li>
      </ul>
  </div>
</div>
</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

background-image no sale completo

Publicado por Richard (1 intervención) el 24/05/2017 23:23:33
El problema del backgroun-size cover es precisamente ese, que se va a cortar con tal de hacerlo que cubra el espacio completo. Podrías revisar también la opción contain, puede ser que te sirva para solucionar tu problema.

Aquí podrás encontrar referencia de las diferentes opciones:

https://www.w3schools.com/cssref/css3_pr_background-size.asp
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar
sin imagen de perfil

background-image no sale completo

Publicado por Manuel (2 intervenciones) el 25/05/2017 10:00:42
Gracias, lo probaré a ver qué tal funciona.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar