【发布时间】:2014-07-17 00:57:16
【问题描述】:
对不起,这可能是一个简单的问题(我只是一个初学者)。我在调整 div 中的图片大小时遇到了一些困难。请查看我的以下代码并给我任何需要的反馈。谢谢你。 这是我的代码:
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(document).ready(function () {
$("img").hide().fadeIn(3000);
});
console.log("It works!!");
</script>
<title>Fruit!</title>
<style>
.box1 {
background-size: auto, cover;
text-align: left;
border: solid;
}
.red {
margin-right: auto;
margin-left: auto;
display: block;
}
.box2 {
background-size: auto, cover;
text-align: left;
border: solid;
}
.blue {
margin-right: auto;
margin-left: auto;
display: block;
}
h1 {
text-align: center;
color: white;
font-family: 'Tahoma' sans-serif;
font-weight: 300;
letter-spacing: 1px;
font-size: 80px;
}
</style>
</head>
<body>
<div class="box1">
<h1> The Stawberry </h1>
<img class="red" src="http://pngimg.com/upload/strawberry_PNG88.png">
</div>
<div class="box2">
<h1> The Blueberry </h1>
<img class="blue" src="http://www.tree-ripe.com/_images/_blueberries/blueberries2.png">
</div>
<div class="box3">
<h1> The Banana </h1>
<img class="yellow" src="http://img4.wikia.nocookie.net/__cb20130806064943/clubpenguin/images/7/7c/Banana_clean_sheet.png">
</div>
</body>
</html>
【问题讨论】:
-
请提供一些代码......可能存在问题,而不是一种方法来做你想做的事。
-
请展示你尝试了什么?
标签: jquery html css image resize