我对 html/css 还很陌生,我正在为我妈妈编写一个网站。 (此处为实例:http://jleblanc.pancakeapps.com/index.html)而且对于我来说,我无法将照片缩小。你们有什么想法吗?
最佳答案
如果图片设置为以下格式:
<div id="PlaceHolder"><img src="source.jpg"/></div>
您可以在 CSS 中添加规则:
#PlaceHolder img{
width: 400px;
}
如果您设置高度或宽度 - 它会自动调整图像大小以保持其纵横比。
关于html - div 中的照片太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24793988/