html - 最小化浏览器时网站格式出现问题

标签 html css formatting minimize

当浏览器处于最大化状态时,网站已经完成并且看起来不错,但是当我最小化页面时,标题和页脚改变了格式并且看起来非常糟糕。我需要一些帮助来解决这个问题。

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Some Title</title>
    <link rel="icon" href="Logo.png" type="img/SVG" style="width: 100%; height: 100%">
</head>
<style>
    body {margin:0;
        background-image: url("Road.png");
        background-repeat: no-repeat;
        background-position: center;
        background-size: cover;


    }
    .socialmedia {
        position:fixed;
        right:150px;
        top:35px;
        transform:translate(0,-50%);
        display: flex; /* add this */
        align-items: center; /* add this */
    }
    .preorder button {
        background-color: white;
        border: 0;
        height: 35px;
        width: 110px;
        margin-left: 35px;
    }
    .footer {
        display: flex;
        align-items: center;
        width: 100%;
        height: 90px;
        margin-top: 319px;
    }
</style>

<body>
<div class="Coming Soon" style=" color: white;">
    <h1 style = "text-align: center; font-family: Verdana; font-size: x-large; font-style: italic">Some Header</h1>

    <style>
        a{text-decoration: none;
            color: white;}
    </style>
    <div class="socialmedia">
        <img src="Logo.png" style=" width: 130px; height: 80px; margin-right: 100px">
        <a class="Facebook">
            <a href="https://www.facebook.com/" target="_blank"><img src="https://images.seeklogo.net/2016/09/facebook-icon-preview-1.png" width="50px" height="50px"></a>
        </a>
        <a class="Instagram">
            <a href="https://www.instagram.com/" target="_blank"><img src="https://images.seeklogo.net/2016/06/Instagram-logo.png" width="50px" height="50px"></a>
        </a>
        <a class="Youtube">
            <a href="https://www.youtube.com/channel" target="_blank"><img src="https://images.seeklogo.net/2016/06/YouTube-icon.png" width="50px" height="50px"></a>
        </a>

    </div>
    <p style="font-family: Verdana; font-size: x-large; text-align: center; margin-top: 300px">Some Paragraph</p>
    <div class="footer" style=" color: white;">

        <p style="font-family: Verdana; font-size: small; padding-left: 55%;">2017 Some Company LLC | City State Company Website All Right Reserved.</p>
    </div>
</div>


</body>

</html>

最佳答案

这是我设置大量页面的方式。这个使用 Bootstrap 组件。我有一个 cutom.css 页面来覆盖 Bootstrap css。

 <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code> body {margin:0;
    background-image: url("Road.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
  }
 p  {
 font-family: Verdana; font-size: x-large; text-align: center; margin-top: 300px;
  }
 h1 {
  text-align: center; font-family: Verdana; font-size: x-large; font-style: italic;
  }
 a  {
  text-decoration: none;
  color: white;
 }
 .Coming Soon {
 color: white;
 }
.Logo {
 width: 130px; height: 80px; margin-right: 100px;
 }
 .socialmedia {
    position:fixed;
    right:150px;
    top:35px;
    transform:translate(0,-50%);
    display: flex; /* add this */
    align-items: center; /* add this */
 }
 .preorder button {
    background-color: white;
    border: 0;
    height: 35px;
    width: 110px;
    margin-left: 35px;
 }
 .footer {
    display: flex;
    align-items: center;
    width: 100%;
    height: 90px;
    margin-top: 319px;
 }</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>WEBSITE TITLE HERE</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS: You can use this stylesheet to override any Bootstrap styles and/or apply your own styles -->
<link href="css/custom.css" rel="stylesheet">
<script src="https://use.fontawesome.com/a0aac8df13.js"></script>
<meta name="Description" content="ADD DESCRIPTION.">
<meta name="Keywords" content="ADD KEYWORDS">
<link rel="icon" href="Logo.png" type="img/SVG" style="width: 100%; height: 100%">
</head>
<body>
<div class="container">
<div class="Coming Soon">
<h1>Some Header</h1>
<div class="socialmedia">
<img src="Logo.png" style=" width: 130px; height: 80px; margin-right: 100px">
<a class="Facebook">
        <a href="https://www.facebook.com/" target="_blank"><img src="https://images.seeklogo.net/2016/09/facebook-icon-preview-1.png" width="50px" height="50px"></a>
    </a>
    <a class="Instagram">
        <a href="https://www.instagram.com/" target="_blank"><img src="https://images.seeklogo.net/2016/06/Instagram-logo.png" width="50px" height="50px"></a>
    </a>
    <a class="Youtube">
        <a href="https://www.youtube.com/channel" target="_blank"><img src="https://images.seeklogo.net/2016/06/YouTube-icon.png" width="50px" height="50px"></a>
    </a>
 </div>
 <p>Some Paragraph</p>
 <div class="footer">
 <p style="font-family: Verdana; font-size: small; padding-left: 55%;">2017 Some Company LLC | City State Company Website All Right Reserved.</p>
 </div></div></div> 
 </body>
 </html></code></pre>
</div>
</div>

关于html - 最小化浏览器时网站格式出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42660572/

相关文章:

html - CSS如何高度步长箭头

javascript - 从位于另一个 div 之上的 div 获取点击事件

javascript - 使用 Bootstrap 或 CSS 调整窗口大小时如何让子 div 保持在其他子之上

html - 我们可以在网页中确定动画的优先级吗

html - CSS - 媒体查询无法正常运行

f# - F# 中的格式化警告

javascript - 如何将自定义 CSS 添加到 Paypal 智能按钮

css-float - 为什么左边距会跳起来?

java - 字符串格式化,如何为 'iiii' 和 'wwww' 提供相同的宽度

javascript - 文本区域输出到页面的特殊格式创建与某些数据的链接