更改窗口大小后,我的网站出现问题

时间:2017-11-19 20:04:45

标签: html css html5

调整浏览器大小时,网站元素会相互叠加。 我试过使用保证金:自动和定位:已修复,但它不起作用 请告诉我,我必须更改或添加以解决此问题 附:如果可以 - 写下我必须添加/更改我需要的代码

This is my site



* {
  margin: 0;
  padding: 0;
}

html {
    width: 100%;
	height: 100%;
	overflow: auto !important;
}
body {
    height: 100%;
    margin:0px;
    overflow: auto !important;
}

wrapper{
  display: flex;
  flex-direction: column;
  height: 100%;
}

.HeaderCenter {
    background-repeat: no-repeat;
    background-position: top, left;
    position: fixed;
    vertical-align: top;
    width:100%; 
    height:80px;
    z-index: 1;
}

.HeaderLeft {
    position: fixed;
    background-repeat: no-repeat;
    width:12.5%; 
    height:20.4%;
    margin: 5px -4px;
    z-index: 0;
}

.HeaderInt {
    background-repeat: no-repeat;
    position: fixed;
    left: 12%;
    width:7%; 
    height:93px;
    z-index: 0;
}

.News {
    color: #6a70b3;
    font-family: verdana, arial, helvetica, "sans-serif";
    font-size: 13.3333px;
    line-height: 17px;
    font-weight: 700;
    text-align: left;
    margin-right: 50%;
    top: 150px;
}

section { /*Контент*/
    font-family: Arial;
    color: #000000;
    font-size: 12.8px;
    vertical-align: middle;
    text-align: left;
    width:900px; 
    height:300px; 
    position:fixed; 
    left:260px; 
    top:110px;
    padding-bottom: 90px;
    flex: 1 0 auto;
}

section a:visited {
    color:#003399;
}

section a:hover {
    color: black;
}

aside { /*Sidebar*/
    padding: 50px 10px;
    margin: 0% auto;
    position: fixed;
    float:left;
    list-style-type: none;
    width:190px; 
    background-image: url(images/side.PNG);
    background-repeat:repeat-y;
    background-size: 75%;
    height: 69%;
}

aside li {
    font-family: Verdana, Arial , "sans-serif", helvetica;
    font-size: 11px;
    margin-bottom: 10px;
    width: 140px;
    font-weight: 700;
    text-align: left;
    line-height: 15px;
    
}
/* Стиль верхней панели навигации */
.topnav {
    margin:6% auto;
    margin-left: 20%;
    overflow: hidden;
    background-color: red;
    text-align:center;
}

/* Стиль ссылок навигации */
.topnav a {
    margin:0 auto;
    display:inline;
    margin-left:3px;
    line-height: 15px;
    font-size: 11px;
    font-weight: 700;
    float:left;
    font-family: verdana, "sans-serif", helvetica, arial;
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 5px 10px;
    text-decoration: none;
}

/* Изменение цвета при наведении */
.topnav a:hover {
    color: orange;
}

ul {
    list-style-type: none; /* Убираем маркеры */
    text-decoration: none; /* Убираем подчёркивание */
    margin-left: 0; /* Отступ слева в браузере IE и Opera */
    padding-left: 0; /* Отступ слева в браузере Firefox, Safari, Chrome */
}

ul a{
    list-style-type: none;
    text-decoration: none;
    color: darkblue;
}

ul a:hover{
    list-style-type: none;
    text-decoration: none;
    color:orange;
}

#mainText {
    text-align: center;
}

.border {
    color:black;
}

table, th, td {
    border: 1px solid black;
}

footer { /*Подвал*/
    text-align: center;
    margin-right:0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0px;
    color: white;
    text-align: center;
    min-height: 50px;
    float: none;
    position: absolute;
}

footer a{ 
    font-family: Arial;
    font-size: 10.6667px;
    line-height: 14px;
    font-weight: 400;
    position: absolute;
    left: 5%;
    bottom: 2px;
    width: 100%;
    color: white;
    text-align: center;
    text-decoration: none;
    color:#06C;
    height: 40px;
    float: none;
}

.footerline {
    position: absolute;
    bottom: 1px;
    left: 0px;
    float: none;
}

<!DOCTYPE html>
<html lang="ru">
    <head>    
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<title>Новости - Анонсы</title>
    </head>
<body>
    <div id="wrapper">
    </div>
     <header>
    <img src="images/header.PNG" class="HeaderCenter" alt="Header">
    <img src="images/header1.png" class="HeaderLeft" alt="Header">
    <img src="images/header2.png" class="HeaderInt" alt="Header">
    </header>
    <nav>
    <div class="topnav"> <!--Верхнее меню -->
  <a href="#top">Новости</a>
  <a href="#top">О Суде</a>
  <a href="#top">Решения КС РФ</a>
  <a href="#top">Заседания КС РФ</a>
  <a href="#top">Контакты</a>
    </div>
    </nav>
    
    <section> <!-- Основной текст -->
<h3 class="News">Новости - Анонсы</h3>
<br>
<br>
<p>10 ноября 2017 года Конституционный Суд РФ провозгласит Постановление по делу о проверке конституционности Федерального закона «О внесении изменений в отдельные законодательные акты РФ в части совершенствования законодательства о публичных мероприятиях»</p>
<br>
<p>( <a href="#top">подробнее...</a>)</p>
<br>
<p>7 ноября 2017 года Конституционный Суд РФ провозгласил Постановление по делу о проверке конституционности ряда положений Закона Республики Крым «Об особенностях регулирования имущественных и земельных отношений на территории Республики Крым»</p>
<br>
<p>( <a href="#top">подробнее...</a>)</p>

<br>
    <a href="#top">Посмотреть все новости</a>
<br>
    </section>
    <aside> <!-- Меню слева -->
<ul>
<li><a href="#top">Новости</a></li>
<li><a href="#top">О Суде</a></li>
<li><a href="#top">Решения КС РФ</a></li>
<li><a href="#top">Заседания КС РФ</a></li>
<li><a href="#top">Контакты</a></li>
</ul>
<br>
<img src="images/gerb.gif" alt="Герб РФ" align=center>
    </aside>
<br>
<br>
    <footer>
        <hr style="border:1px; height:1px; width: 70%; margin-left: 270px; background-color:black">
    <img src="images/footer.PNG" class=footerline alt="Footer">
        <a href="index.html">©Конституционный Суд Российской Федерации, 2008-2017</a>
    </footer>
</body>
</html>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:3)

在头标记中添加这两个元标记

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">