Я решил загрузить свой адаптивный веб-сайт, но заметил, что его содержимое (в данном случае фиктивный текст) не остается под меню навигации.
( http://www.azhir.co.uk/web_zip/default.html )
Как вы увидите, что это базовый стиль CSS, и я использую стиль CSS для создания строки меню «гамбургер».
html, body {
margin: 0;
padding: 0;
width: 100%;
}
body {
font-family: "Helvetica Neue",sans-serif;
font-weight: lighter;
}
header {
width: 100%;
height: 0.01vh;
background-color: red;
}
.content {
width: 94%;
margin: 4em auto;
font-size: 20px;
line-height: 30px;
text-align: justify;
}
.logo {
line-height: 60px;
position: fixed;
float: left;
margin: 16px 46px;
color: black;
font-weight: bold;
font-size: 20px;
letter-spacing: 2px;
}
nav {
position: fixed;
width: 100%;
line-height: 60px;
}
nav ul {
line-height: 60px;
list-style: none;
background: rgba(0, 0, 0, 0); /*transparency rgba(0,0,0,0)*/
overflow: hidden;
color: #fff;
padding: 0;
text-align: right;
margin: 0;
padding-right: 40px;
transition: 1s;
}
nav.black ul {
background: white; /*changes color of bar*/
}
nav ul li {
display: inline-block;
padding: 16px 40px;;
}
nav ul li a {
text-decoration: none;
color: black;
font-weight: bold;
font-size: 16px;
}
.menu-icon {
line-height: 60px;
width: 100%;
background: white; /*changes hamburger color*/
text-align: right;
box-sizing: border-box;
padding: 15px 24px;
cursor: pointer;
color: black;
display: none;
}
@media(max-width: 786px) {
.logo {
position: fixed;
top: 0;
margin-top: 16px;
}
nav ul {
max-height: 0px;
background: white; /*mobile color*/
}
nav.black ul {
background: white;
}
.showing {
max-height: 34em;
}
nav ul li {
box-sizing: border-box;
width: 100%;
padding: 24px;
text-align: center;
}
.menu-icon {
display: block;
}
}
Это CSS для моего меню.css
body{
margin: 0;
font-family: Arial, Helvetica, sans-serif;
background-color: white;
}
a{
color: black;
}
.header{
background-color: white;
box-shadow:1px 1px 4px 0 rgba(0,0,0,.1);
position:fixed;
width:100%;
z-index:3;
}
.header ul{
margin:0;
padding:0;
list-style:none;
overflow:hidden;
background-color:white;
}
.header ul a{
display:block;
padding:20px;
boder-right:1px solid grey;
text-decoration: none;
}
.header ul a:hover{
background-color: #e6e6e6;
}
.header .logo{
float:left;
display:block;
font-size: 2em;
padding: 10px 20px;
text-align: center;
text-decoration: none;
}
.header .menu{
clear:both;
max-height:0;
transition:max-height .2s ease-out;
}
/*hamburger*/
.header .menu-icon{
padding: 28px 20px;
position: relative;
float:right;
cursor:pointer;
}
.header .menu-icon .nav-icon{
background:black;
display: block;
height:2px;
width:18px;
position:relative;
transition: background .2s ease-out;
}
.header .menu-icon .nav-icon:before{
background:black;
content:"";
display:block;
height:100%;
width:100%;
position:absolute;
transition: all .2s ease-out;
top:5px;
}
.header .menu-icon .nav-icon:after{
background:black;
content:"";
display:block;
height:100%;
width:100%;
position:absolute;
transition: all .2s ease-out;
top:-5px;
}
.header .menu-btn{
display: none;
}
.header .menu-btn:checked ~ .menu{
max-height:240px;
}
.header .menu-btn:checked ~ .menu-icon .nav-icon{
background: transparent;
}
.header .menu-btn:checked ~ .menu-icon .nav-icon:before{
transform: rotate(-45deg);
top:0;
}
.header .menu-btn:checked ~ .menu-icon .nav-icon:after{
transform: rotate(45deg);
top:0;
}
@media (min-width:48em){
.header li{
float:left;
}
.header li a{
padding:20px 30px;
}
.header .menu{
clear:none;
float:right;
max-height: none;
}
.header .menu-icon{
display:none;
}
.header .logo{
float:left;
display:block;
font-size: 2em;
padding: 10px 8%;
text-align: center;
text-decoration: none;
}
}
/*content*/
.content {
width: 85%;
font-size: 20px;
line-height: 30px;
text-align: inherit;
margin-left: auto;
margin-right: auto;
}
и HTML-код довольно простой и простой;
[*]
Azhir Mahmood
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Подробнее здесь: https://stackoverflow.com/questions/602 ... ve-website
Содержимое располагается под навигацией (строка меню): адаптивный веб-сайт. ⇐ CSS
Разбираемся в CSS
1727027230
Anonymous
Я решил загрузить свой адаптивный веб-сайт, но заметил, что его содержимое (в данном случае фиктивный текст) не остается под меню навигации.
( http://www.azhir.co.uk/web_zip/default.html )
Как вы увидите, что это базовый стиль CSS, и я использую стиль CSS для создания строки меню «гамбургер».
html, body {
margin: 0;
padding: 0;
width: 100%;
}
body {
font-family: "Helvetica Neue",sans-serif;
font-weight: lighter;
}
header {
width: 100%;
height: 0.01vh;
background-color: red;
}
.content {
width: 94%;
margin: 4em auto;
font-size: 20px;
line-height: 30px;
text-align: justify;
}
.logo {
line-height: 60px;
position: fixed;
float: left;
margin: 16px 46px;
color: black;
font-weight: bold;
font-size: 20px;
letter-spacing: 2px;
}
nav {
position: fixed;
width: 100%;
line-height: 60px;
}
nav ul {
line-height: 60px;
list-style: none;
background: rgba(0, 0, 0, 0); /*transparency rgba(0,0,0,0)*/
overflow: hidden;
color: #fff;
padding: 0;
text-align: right;
margin: 0;
padding-right: 40px;
transition: 1s;
}
nav.black ul {
background: white; /*changes color of bar*/
}
nav ul li {
display: inline-block;
padding: 16px 40px;;
}
nav ul li a {
text-decoration: none;
color: black;
font-weight: bold;
font-size: 16px;
}
.menu-icon {
line-height: 60px;
width: 100%;
background: white; /*changes hamburger color*/
text-align: right;
box-sizing: border-box;
padding: 15px 24px;
cursor: pointer;
color: black;
display: none;
}
@media(max-width: 786px) {
.logo {
position: fixed;
top: 0;
margin-top: 16px;
}
nav ul {
max-height: 0px;
background: white; /*mobile color*/
}
nav.black ul {
background: white;
}
.showing {
max-height: 34em;
}
nav ul li {
box-sizing: border-box;
width: 100%;
padding: 24px;
text-align: center;
}
.menu-icon {
display: block;
}
}
Это CSS для моего меню.css
body{
margin: 0;
font-family: Arial, Helvetica, sans-serif;
background-color: white;
}
a{
color: black;
}
.header{
background-color: white;
box-shadow:1px 1px 4px 0 rgba(0,0,0,.1);
position:fixed;
width:100%;
z-index:3;
}
.header ul{
margin:0;
padding:0;
list-style:none;
overflow:hidden;
background-color:white;
}
.header ul a{
display:block;
padding:20px;
boder-right:1px solid grey;
text-decoration: none;
}
.header ul a:hover{
background-color: #e6e6e6;
}
.header .logo{
float:left;
display:block;
font-size: 2em;
padding: 10px 20px;
text-align: center;
text-decoration: none;
}
.header .menu{
clear:both;
max-height:0;
transition:max-height .2s ease-out;
}
/*hamburger*/
.header .menu-icon{
padding: 28px 20px;
position: relative;
float:right;
cursor:pointer;
}
.header .menu-icon .nav-icon{
background:black;
display: block;
height:2px;
width:18px;
position:relative;
transition: background .2s ease-out;
}
.header .menu-icon .nav-icon:before{
background:black;
content:"";
display:block;
height:100%;
width:100%;
position:absolute;
transition: all .2s ease-out;
top:5px;
}
.header .menu-icon .nav-icon:after{
background:black;
content:"";
display:block;
height:100%;
width:100%;
position:absolute;
transition: all .2s ease-out;
top:-5px;
}
.header .menu-btn{
display: none;
}
.header .menu-btn:checked ~ .menu{
max-height:240px;
}
.header .menu-btn:checked ~ .menu-icon .nav-icon{
background: transparent;
}
.header .menu-btn:checked ~ .menu-icon .nav-icon:before{
transform: rotate(-45deg);
top:0;
}
.header .menu-btn:checked ~ .menu-icon .nav-icon:after{
transform: rotate(45deg);
top:0;
}
@media (min-width:48em){
.header li{
float:left;
}
.header li a{
padding:20px 30px;
}
.header .menu{
clear:none;
float:right;
max-height: none;
}
.header .menu-icon{
display:none;
}
.header .logo{
float:left;
display:block;
font-size: 2em;
padding: 10px 8%;
text-align: center;
text-decoration: none;
}
}
/*content*/
.content {
width: 85%;
font-size: 20px;
line-height: 30px;
text-align: inherit;
margin-left: auto;
margin-right: auto;
}
и HTML-код довольно простой и простой;
[*]
[url=/]Azhir Mahmood[/url]
[list]
[url=#ALPHA]ALPHA[/url]
[*][url=#BETA]BETA[/url]
[*][url=#GAMMA]GAMMA[/url]
[/list]
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Подробнее здесь: [url]https://stackoverflow.com/questions/60226983/content-flows-below-navigation-menubar-responsive-website[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия