Код: Выделить всё
html {
margin-left: 0;
margin-top: 0;
}
table,
th,
td {
border: 1px solid;
}
body {
min-height: 100vh;
display: grid;
grid-template-rows: 60px 1fr auto;
grid-template-columns: 300px auto;
grid-template-areas: 'menubtn header '
'sidebar content'
'footer footer';
}
#menubtn {
grid-area: menubtn;
}
#header {
grid-area: header;
background-color: white;
}
#sidebar {
grid-area: sidebar;
background-color: white;
}
#content {
grid-area: content;
}
#footer {
grid-area: footer;
background-color: white;
}
#hidden {
display: none;
visibility: hidden;
}
h1 {
color: #330099;
}
h2 {
color: #330099;
}
h3 {
color: #330099;
}
a:link,
a:visited {
color: #FFF;
font-weight: bold;
background-color: #09F;
border: 1px solid #0066cc;
padding: 3px;
text-decoration: none
}
#content a:link {
color: #FFF;
font-weight: bold;
background-color: #09F;
border: 1px solid #0066cc;
padding: 1px;
text-decoration: none
}
#content a:visited {
color: #FFF;
font-weight: bold;
background-color: #09F;
border: 1px solid #0066cc;
padding: 1px;
text-decoration: none
}
a:hover {
background-color: #06C
}Код: Выделить всё
[*]
Test page for toggling menu
// toggle-menu.js
document.getElementById("toggle-btn").addEventListener("click", function () {
var sidebar = document.getElementById("#sidebar");
sidebar.classList.toggle("#hidden");
});
Toggle Menu
Welcome to my test page
[list]
this
[*]item
[*]tests
[*]the
[*]button
[/list]
welcome again!
this page has been created to test my button to toggle menus
Фактическая страница написана с использованием PHP, но это упрощенная версия.
В настоящее время кажется, что оно отображается последовательно, но контент должен отображаться рядом с меню.
Я уверен, что есть простое решение этой проблемы, и, вероятно, это связано с моим непониманием того, как должна работать сетка.
Большое спасибо за любую помощь.
Подробнее здесь: https://stackoverflow.com/questions/790 ... ignore-css
Мобильная версия