【问题标题】:Fitting a image on a screen to avoid scroll在屏幕上调整图像以避免滚动
【发布时间】:2016-05-28 06:40:24
【问题描述】:

所以我正在完成我在 Dreamweaver 中的第一个网站。我只是想知道如何在不滚动的情况下使我的徽标适合屏幕。因为它在我的屏幕上看起来不错,但在更大的屏幕上图像变得太大,我们必须滚动。提前感谢您的所有回答。

图像尺寸:宽度:7,24 高度:7,17

HTML

<!doctype html>
<html>

<head>
  <link href="css1.css" rel="stylesheet" type="text/css">
  <meta charset="utf-8">
  <title>Matic Toni</title>
</head>

<body>
  <div class="logo">
        <a href="projects.html">
          <img src="lg.png" width="40%" alt="" />
        </a>
  </div>
  <footer>copyright 2016 maticoni</footer>
</body>

</html>

CSS

@charset "utf-8";
div {
text-align: center;
padding-bottom: 30px;
}
body {
/* background-image: url(background.jpg);
background-sizce: cover; */
background-color: #F6F6F6;
}

.logo {
padding-top:3%;
}

footer {
font-family:"Proxima";
clear: both;
color: black;
font-size: 100%;
margin-top: 5%;
margin-right: 5%;
margin-left: 5%;
text-align: center;
}

li a img {
padding-top: 3%;
}

@font-face {
font-family: Proxima;
src: url(Fonts/Proxima_Regular.otf);
}

【问题讨论】:

  • 你是指垂直还是水平?

标签: html css image scroll position


【解决方案1】:

为您的 img.logo 设置最大宽度。这也将防止它在更大的屏幕尺寸下像素化。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-04-30
    • 1970-01-01
    • 1970-01-01
    • 2012-03-15
    • 1970-01-01
    • 2019-08-22
    • 2013-11-16
    • 1970-01-01
    相关资源
    最近更新 更多