gpt4 book ai didi

android - Android 浏览器中的网页 - 图像尺寸

转载 作者:行者123 更新时间:2023-11-28 00:58:49 25 4
gpt4 key购买 nike

我有一张 1513x1079 的图片,当我调整我的桌面浏览器大小时,它的大小调整得很好。但是,当我在我的 Android 手机上打开同一个网页时,除了图像之外,一切都很好。整个页面调整大小正确,但没有图片。左上角只有一个小图片图标。

手机图像尺寸是否有上限?如果是这样,为什么会有这样的限制?图像响应是否有某种尺寸限制?

HTML 代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name = "viewport" content = "width=device-width, initial-scale = 1"/>
<title>Projects web page</title>
<link rel="stylesheet" href="bootstrap.min.css"/>
<script src="jQuery-3.3.1.min.js"></script>
<script src="bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>



<body>
<div class = "container-fluid">
<div class = "row">
<div class = "col-md-6" id = "picture">
<img src="R1lr_cut.jpg" alt = "R1 Engine" class = "responsive"/>
</div>

<div class = "col-md-6" id = "home_text">
<h1>Inline 4 Engines</h1>
<ul id = "links">
<li><a href="#">Home</a></li>
<li><a href="#">Details</a></li>
<li><a href="#">Calculate</a></li>
<li><a href="#">About</a></li>
</ul>

<div id = "filler_text">
<h4>Historic information</h4>
<p>
The first across-the-frame 4-cylinder motorcycle was the 1939 racer Gilera 500 Rondine, it also had double-over-head camshafts, forced-inducting supercharger and was liquid-cooled.
</p>
<p>
Modern inline-four motorcycle engines first became popular with Honda's SOHC CB750 introduced in 1969, and others followed in the 1970s.
Since then, the inline-four has become one of the most common engine configurations in street bikes.
</p>
<p>
Outside of the cruiser category, the inline-four is the most common configuration because of its relatively high performance-to-cost ratio.
</p>

<p>
The success of the Honda CB750 and the Kawasaki Z1 got the attention of the Germans over at BMW. The Honda especially had been an industry game changer.
BMW’s motorcycle engine at that time was a horizontally opposed “boxer” twin cylinder engine that the company had settled on when they reverse engineered a British Douglas motorcycle with a boxer engine mounted longitudinally in the frame at the end of the First World War.
</p>
</div>
</div>
</div>
</div>
</body>
</html>

CSS 代码:

body {
background-color: #000000;
}

.responsive {
width:100%;
height: auto;
}


#picture {
padding-right: -10%;
padding-top: 3%;
width: 100%;
}

#links li{
list-style-type: none;
float:left;
/*outline : 1px solid yellow;*/
width: 14%;
margin-right: 11%;
padding-top: 0.5%;
padding-bottom: 0.5%;
}

#links{
/*outline: 1px solid red;*/
width: 100%;
padding-left: 0.5%;
}


a {
/*outline :1px solid green;*/
display: block;
text-align: center;
padding: 3%;
color: #666666;
}

a:hover {
background-color: #333333;
color:#66ccff;
}

#home_text {
background-color: black;
padding-top: 8%;
color: #FFFFFF;
padding-left: 0%;
}

#home_text h1 {
margin-left: 5%;
/*outline: 1px solid purple*/
}

#filler_text {
padding-top: 12%;
margin-left: 5%;
}

最佳答案

确保您的图片大小设置为百分比,而不是像素或其他任何单位。示例:

<img src="yourimage.png">
<style>
img{width: 100%; /*100 can be any, but will fit 100% of the block*/}
</style>

关于android - Android 浏览器中的网页 - 图像尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52795954/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com