I'm not looking for a inventive solution on the images, I've read plenty of content about loading images etc.
I'm just doing some basic responsive design and want to load a large image and just squash it down as the window gets smaller.
I've written the following CSS:
@media (max-width:420px){
#header #logo{
width:60%;
float:left;
background:red;
}
#header #logo #image{
margin:5%;
width:20%;
float:left;
background:green;
}
#header #nav{
width:40%;
float:left;
background:purple;
}
#header #nav #search{
max-width:33%;
float:left;
}
#header #nav #account{
max-width:33%;
float:left;
}
#header #nav #menu{
max-width:33%;
float:left;
}
}
And the HTML to go with it:
<div id="logo">
<div id="image">
s
</div>
</div>
<div id="nav">
<div id="search">
<img src="assets/images/mobile-search.png"/>
</div>
<div id="account">
<img src="assets/images/mobile-account.png"/>
</div>
<div id="menu">
<img src="assets/images/mobile-menu.png"/>
</div>
</div>
The images aren't resizing as I'm resizing the window.
What is the correct CSS syntax to achieve this?
Thanks :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…