• 1000 Селектор минимальной ширины в медиа-запросе будет запущен, если экран больше 812, или вы можете использовать блок отображения в текущем медиа-запросе, например,
body{
font-family:'Sen', sans-serif;
transition:transform .2s;
background-color:#171d22;
min-height: 100vh;
}
a:focus {
outline:none;
}
button:focus {
outline:none;
}
h4 {
color:white;
}
header {
grid-area: header;
grid-area: header;
position: sticky;
top: 0;
}
#page-container {
position:relative;
min-height: 100vh;
width: 100%;
display: grid;
grid-template-columns:1fr 1fr;
grid-template-areas:
"header header"
"comp-desc comp-desc"
"profile-one desc-one"
"desc-two profile-two"
"footer footer";
justify-content: space-between;
justify-content: space-around;
justify-content: center;
grid-row-gap: 2rem;
}
@media only screen and (max-width: 812px) {
#page-container {
min-height:100vh;
width:100%;
display:block;
grid-template-columns:1fr;
grid-template-areas:
"header"
"comp-desc"
"profile-one"
"desc-one"
"profile-two"
"desc-two"
"footer";
justify-content: space-between;
justify-content: space-around;
justify-content: center;
grid-row-gap: 2rem;
}
}
.navbar.navbar-expand-lg.navbar-light {
/*position:fixed;*/
width:100%;
min-height:10vh;
background-color:white;
border-bottom: solid 1px black;
}
#logo {
height:8vh;
width:auto;
}
#nav-item:active {
outline:0;
border:none;
}
#nav-link:active {
outline:0;
border:none;
}
.dropdown-item:hover {
background-color: #f8f9fa;
}
#head {
text-align:center;
background-color:#171d22;
color:white;
padding:10vh 0px 0px 0px;
margin-bottom:2rem;
}
.comp-desc {
margin-top: 10vh;
grid-area: comp-desc;
text-align:center;
background-color:#171d22;
color:white;
font-size:1.25rem;
margin:2rem 2.5% 3rem 2.5%;
}
.comp-desc p {
padding:0.5rem 0px;
}
.profile {
margin:5%;
display:grid;
background-color:#171d22;
color:white;
justify-content:center;
justify-content:space-between;
justify-content:space-around;
align-items:center;
margin-bottom:1.5rem;
}
#profile-one {
grid-area: profile-one;
grid-column: 1;
}
#one-desc {
grid-area: desc-one;
grid-column: 2/5;
}
#profile-two {
grid-area: profile-two;
grid-column: 2/5;
margin-bottom: 3rem;
}
#two-desc {
grid-area: desc-two;
grid-column: 1;
}
.description {
text-align:center;
align-self:center;
font-size:1.25rem;
color:white;
overflow:auto;
margin:0px 5%;
padding: 2rem 3rem;
}
#profile-img-boundaries{
overflow:hidden;
}
#profile-img-F {
width: 100%;
height:auto;
object-fit:contain;
overflow:hidden;
align-self:center;
}
#profile-img-M {
width: 100%;
height:auto;
object-fit:contain;
border-width:auto;
overflow:hidden;
}
.profile-desc {
overflow:hidden;
margin: 5%;
}
.headers {
text-align:center;
display:flex;
flex-direction:column;
justify-content:center;
align-content:center;
align-items:center;
padding-top:10px;
}
.headers:hover {
background-color: #000000;
}
.nametag {
color:white;
width:33%;
padding:0px;
margin:0px;
}
.btn.btn-dark {
background-color:#171d22;
}
.modal-button {
border:none;
padding:0px;
margin:0px;
}
.modal-footer {
display:grid;
grid-template-columns:1fr 1fr;
}
.modal-link {
color:rgb(244,212,69);
}
.modal-link img {
height:100px;
width:45%;
}
#footer {
grid-area: footer;
background-color:#ffffff;
left:0;
bottom:0;
width:100%;
min-height:10vh;
color:#171d22;
text-align:center;
display:inline-flex;
flex-direction:row;
align-items:center;
justify-content:center;
justify-content:space-between;
}
.foot-img {
width:auto;
height:8vh;
display:flex;
justify-content:space-between;
}
.foot-img:hover{
transform:scale(1.1);
}
#spacer {
/*keep for spacing*/
height:8vh;
width:auto;
}
#links {
/*keep for spacing*/
}
#license-logo {
height:8vh;
width:auto;
/* create right margin as vh for equidistance*/
margin-right:2vh;
}
<div id="page-container">
<header>
<nav class="navbar navbar-expand-lg navbar-light">
<div class="d-flex flex-grow-1">
<span class="w-100 d-lg-none d-block">
<!-- hidden spacer to center brand on mobile --></span>
<a class="navbar-brand" href="index.html">
<img src="images/logo_blackWhite.png" id="logo">
</a>
<div class="w-100 text-right">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#myNavbar">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
<div class="collapse navbar-collapse flex-grow-1 text-right" id="myNavbar">
<ul class="navbar-nav ml-auto flex-nowrap">
<li class="nav-item">
<a class="nav-link" href="index.html" tabindex="-1" aria-disabled="true">
<span class="dropdown-item">Home</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="portfolio.html" tabindex="-1" aria-disabled="true">
<span class="dropdown-item">Portfolio</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html" tabindex="-1" aria-disabled="true">
<span class="dropdown-item">Contact</span>
</a>
</li>
</ul>
</div>
</nav>
</header>
<div class="comp-desc">
<h1 id="head">Meet the people behind anonymous anonymous</h1>
<p>
Lorem ipsum.
</p>
<p>
Lorem ipsum.
</p>
</div>
<div class="profile-desc profile" id="profile-one" type="button" data-toggle="modal" data-target="#about_anonymous" class="modal-button">
<div id="profile-img-boundaries">
<img src="images/anonymous.jpg" id="profile-img-F">
</div>
<div class="headers">
<h3 class="nametag">
anonymous
</h3>
<h4>
Graphic Design & Video
</h4>
</div>
<!-- Modal -->
<div class="modal fade" id="about_anonymous" tabindex="-1" role="dialog" aria-labelledby="about_anonymous" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="about_anonymous" style="color:rgb(244,212,69);">
Contact anonymous
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-footer">
<a href="https://uk.linkedin.com/in/anonymousanonymousanonymous" target="_blank">
<button type="button" class="btn btn-dark modal-link">
<img src="images/li_white.png">
</button>
</a>
<a href="https://twitter.com/anonymousanonymous23" target="_blank">
<button type="button" class="btn btn-dark modal-link">
<img src="images/tw_white.png">
</button>
</a>
</div>
</div>
</div>
</div>
<!-- end modal -->
</div>
<div class="description" id="one-desc">
<p>Lorem ipsum.</p>
</div>
<div class="profile-desc profile" id="profile-two" type="button" data-toggle="modal" data-target="#about_anonymous" class="modal-button">
<div id="profile-img-boundaries">
<img src="images/anonymous.jpg" id="profile-img-M">
</div>
<div class="headers">
<h3 class="nametag">
anonymous
</h3>
<h4>
Graphic Design & Illustration
</h4>
</div>
<!-- Modal -->
<div class="modal fade" id="about_anonymous" tabindex="-1" role="dialog" aria-labelledby="about_anonymous" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" style="color: rgb(244,212,69);">
Contact anonymous
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-footer">
<a href="#" target="_blank">
<button type="button" class="btn btn-dark modal-link">
<img src="images/li_white.png">
</button>
</a>
<a href="#" target="_blank">
<button type="button" class="btn btn-dark modal-link">
<img src="images/tw_white.png">
</button>
</a>
</div>
</div>
</div>
</div>
<!-- End modal -->
</div>
<div class="description" id="two-desc">
<p>Lorem ipsum.</p>
</div>
<footer id="footer">
<!-- spacer -->
<img src="images/logo_spacer.png" id="license-logo">
<div id="links">
<!-- Linkedin -->
<a href="https://uk.linkedin.com/in/anonymousanonymousanonymous" target="_blank"><img src="images/li.png" class="foot-img"></a>
<!-- Twitter -->
<a href="https://twitter.com/anonymousanonymous23" target="_blank"><img src="images/tw.png" class="foot-img"></a>
<!-- Insta -->
<a href="https://www.instagram.com/anonymous" target="_blank"><img src="images/ig.png" class="foot-img"></a>
</div>
<a class="navbar-brand" href="index.html">
<img src="images/logo_blackWhite.png" id="license-logo">
</a>
</footer>
</div>
, а также не используйте свои скрипты в заголовке или начале тела, это плохая практика и снизит производительность страницы, используйте все свои скрипты в нижней части корпуса.