CSS Responsive design problems - html

Im having some problems with this web page that I am building out. The code is pasted below but you can also take a look at it here:
Here are the major issues that are keeping me from completing it. The most important is the 1st issue. It is really driving me crazy!!!
Below 490px and above 320px window size there are 3 element's whose width shrinks more than the other elements that are full width. You can see that the header-left and header-right elements (which are stacked in mobile size), and the footer element all shrink more than the rest of the page causing the right side of the page to be out of line. Something is keeping the elements from collapsing evenly.
Also I have positioned the footer absolutely at the bottom of the page but I also moved it up 100px so that it slides up under the text above. But this leaves a gap at the bottom of the page. Is there any way to close up this gap?
Thank you very much for any help that you can give me.
Pete
* {
box-sizing: border-box;
}
html {
font-size: 16px;
}
html,
body,
p {
margin: 0;
padding: 0;
}
body {
font-family: "Arial Narrow", Helvetica, sans-serif;
color: black;
font-size: 16px;
font-size: 1rem;
}
p {
line-height: 1;
margin: 0;
padding: 0;
}
.container {
padding: 0;
max-width: 1239px;
margin: 0 auto;
margin-bottom: -137px;
}
header {
display: table;
vertical-align: top;
height: 200px;
z-index: 1004;
}
.header-left {
display: table-cell;
vertical-align: top;
width: 78%;
color: #fff;
background-color: #00948f;
box-shadow: 7px 15px 18px #aaa;
-webkit-box-shadow: 7px 15px 18px #aaa;
position: relative;
}
.header-left h1 {
font-size: 50px;
font-size: 3.125rem;
margin: 0;
letter-spacing: 2px;
background-color: #00948f;
width: 100%;
padding: 20px 85px 30px 138px;
line-height: 1.1;
margin: 0;
}
.header-left h1 span {
font-size: 30px;
font-size: 1.875rem;
line-height: 1;
display: inline-block;
margin-bottom: 20px;
}
.header-spacer {
display: table-cell;
width: 2%;
}
.header-right {
display: table-cell;
width: 21%;
background-color: #9fd2d0;
box-shadow: 7px 15px 18px #aaa;
-webkit-box-shadow: 7px 15px 18px #aaa;
z-index: 1002;
padding: 175px 61px 0 20px;
line-height: 1.3;
font-size: 28px;
font-size: 1.75rem;
}
.small-box {
width: 8%;
height: 33px;
background-color: #9fd2d0;
z-index: 1005;
padding: 0;
}
.center-table {
display: table;
width: 100%;
margin-top: 10px;
}
.center-row {
display: table-row;
}
.vert-spacer {
display: table-cell;
background-color: #e6e7e8;
z-index: -2;
width: 8%;
}
main {
display: table-cell;
width: 69%;
}
.main-body {
margin-left: 20px;
height: 100%;
}
.main-body p:first-child {
font-size: 44px;
font-size: 2.75rem;
}
.main-body p:nth-child(2) {
font-size: 27px;
font-size: 1.6875rem;
}
.main-body .hr {
border-top: 10px solid white;
margin: 20px 0;
}
.main-body p:nth-child(3) {
font-size: 27px;
font-size: 1.6875px;
}
.main-body-header {
background-color: #9fd2d0;
padding: 10px 25px 15px;
margin-bottom: 20px;
}
.main-body-header p:first-child {
font-size: 44px;
font-size: 2.75rem;
margin-bottom: 10px;
}
.main-body-header p:nth-child(2) {
font-size: 27px;
font-size: 1.6875rem;
}
.main-body-header hr {
border-width: 10px;
}
.main-body-header p:nth-child(4) {
font-size: 30px;
font-size: 1.875rem;
text-align: center;
margin-bottom: 5px;
}
.main-body-header p:nth-child(5) {
font-size: 24px;
font-size: 1.5rem;
text-align: center;
margin-bottom: 10px;
}
.main-body-header p:nth-child(6) {
font-size: 24px;
font-size: 1.5rem;
}
.foot-note {
font-size: 20px !important;
font-size: 1.25rem !important;
margin-bottom: 1.25rem;
}
.co-chairs {
font-size: 22px !important;
font-size: 1.375rem !important;
margin-bottom: 20px;
}
.co-chairs span {
color: #00837c;
}
table {
font-size: 23px;
font-size: 1.4375rem;
border-collapse: collapse;
}
table th {
text-align: left;
padding-left: 20px;
}
table tr td {
padding: 5px;
}
table tr td:first-child {
width: 20%;
}
table tr td:nth-child(2) {
width: 55%;
}
table tr td:nth-child(3) {
width: 25%;
text-align: right;
padding-right: 20px;
}
table tr.header {
text-transform: uppercase;
font-size: 28px;
font-size: 1.75rem;
background-color: #00948f;
color: white;
}
table tr.header th {
border-top: 5px solid black;
}
table tr:not(agenda) td {
border-bottom: 3px solid #00948f;
}
table tr.qa {
background-color: #e5f4f4;
}
table tr.break {
background-color: #cdeae9;
}
aside {
padding: 0 20px;
display: table-cell;
width: 21%;
text-align: top;
}
aside .list-header {
text-transform: uppercase;
color: #004a99;
font-size: 28px !important;
font-size: 1.75rem !important;
margin-bottom: 10px;
}
aside .faculty-list {
list-style: none;
padding: 0;
font-size: 18px;
font-size: 1.125rem;
color: #a0a0a0;
}
aside .faculty-list li {
margin-bottom: 15px;
}
aside .faculty-list li span {
display: inline-block;
color: black;
font-size: 23px;
font-size: 1.277777778rem;
}
footer {
position: absolute;
left: 0;
right: 0;
bottom: 137px;
z-index: 10000;
position: relative;
min-width: 420px;
background-color: #00948f;
width: 100%;
height: 402px;
z-index: -2;
}
footer p {
position: absolute;
left: 20px;
bottom: 30px;
font-size: 19px;
font-size: 1.1857rem;
line-height: 1.3;
}
footer .logo {
position: absolute;
right: 60px;
bottom: 30px;
width: 90px;
height: 90px;
background-color: #9fd2d0;
display: inline-block;
}
#media screen and (max-width: 767px) {
.header-left,
.header-right {
display: block;
width: auto;
}
.header-left {
margin: 0 20px;
}
.header-left h1 {
font-size: 40px !important;
font-size: 2.5rem !important;
padding: 20px !important;
}
.header-left h1 span {
font-size: 15px !important;
font-size: 0.9375rem !important;
}
.header-right {
padding: 20px !important;
margin: 30px 20px 0;
}
.small-box {
display: none;
}
.vert-spacer {
display: none;
}
main,
aside {
display: block;
width: auto;
}
.main-body {
margin: 20px;
}
.main-body-header p:first-child {
text-align: center;
font-size: 40px;
font-size: 2.5rem;
}
}
#media screen and (max-width: 1120px) {
footer p {
bottom: 100px;
}
footer .logo {
right: auto;
left: 20px;
bottom: 5px;
}
}
<!DOCTYPE html>
<html lang="en-us">
<head>
<title>Lorem ipsum dolor sit amet</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- strongly recommended by the Bootstrap -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="app.css">
</head>
<body>
<div class="container">
<header class="header">
<div class="tbl-row">
<div class="header-left">
<h1>
<span>Lorem ipsum dolor sit amet, consectetur adipiscing</span><br/> Excepteur sint occaecat cupidatat<br/> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
</h1>
</div>
<div class="header-spacer"></div>
<div class="header-right">
<p>Ut enim ad minim veniam, quis nostrud</p>
</div>
</div>
</header>
<div class="small-box"></div>
<!-- CENTER TABLE -->
<div class="center-table">
<!-- CENTER ROW -->
<div class="center-row">
<div class="vert-spacer"></div>
<!-- MAIN -->
<main>
<div class="main-body">
<div class="main-body-header">
<p><strong>WEBCAST</strong>TRANSMITTED LIVE ON</p>
<p>Sunday, 9 December 2018, 3:00 (EST) from New York, NY</p>
<div class="hr"></div>
<p><strong>Webcast:</strong><em>To View From Your Home or Office, Register at:</em></p>
<p>www.irure dolor in reprehenderit.com</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.</p>
</div>
<p class="foot-note">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.</p>
<p class="co-chairs"><span>Co-Chairs:</span> John Jones (Brazil), George Orwell (London, England)</p>
<table class="table">
<thead>
<tr class="header">
<th colspan="3">agenda</th>
</tr>
</thead>
<tbody>
<tr>
<td>09:00 – 09:05</td>
<td>Welcome and Introduction</td>
<td>Co-Chairs</td>
</tr>
<tr>
<td>09:05 – 09:30</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</td>
<td>John Jones</td>
</tr>
<tr class="qa">
<td>09:30 – 09:35</td>
<td colspan="2">Q&A</td>
</tr>
<tr>
<td>09:35 – 10:00</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</td>
<td>George Orwell</td>
</tr>
<tr class="qa">
<td>10:00 – 10:05</td>
<td colspan="2">Q&A</td>
</tr>
<tr>
<td>10:05 – 10:30</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</td>
<td>Who Cares</td>
</tr>
<tr class="qa">
<td>10:30 – 10:35</td>
<td colspan="2">Q&A</td>
</tr>
<tr class="break">
<td>10:35 – 11:05</td>
<td colspan="2">Break</td>
</tr>
<tr>
<td>11:05 – 11:30</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</td>
<td>Sam Man</td>
</tr>
<tr class="qa">
<td>11:30 – 11:35</td>
<td colspan="2">Q&A</td>
</tr>
<tr>
<td>11:35 – 12:35</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</td>
<td>Faculty</td>
</tr>
<tr>
<td>12:35 – 12:45</td>
<td>Closing Remarks</td>
<td>Co-Chairs</td>
</tr>
</tbody>
</table>
<!-- /table -->
</div>
<!-- /main-body -->
</main>
<!-- /MAIN -->
<!-- ASIDE -->
<aside>
<div class="main-body">
<p class="list-header">Co-Chairs</p>
<ul class="faculty-list">
<li>
<span>John Jacob</span>
<br/> Expert in Stuff
<br/> Lorum ipsum Division
<br/> Department of Lorem Ipsum
<br/> 200 Car Talk Tower, Dewey Cheatum & Howe
<br/> Cambridge, MA
</li>
<li>
<span>John Jacob</span>
<br/> Expert in Stuff
<br/> Lorum ipsum Division
<br/> Department of Lorem Ipsum
<br/> 200 Car Talk Tower, Dewey Cheatum & Howe
<br/> Cambridge, MA
</li>
</ul>
<p class="list-header">faculty</p>
<ul class="faculty-list">
<li>
<span>John Jacob</span>
<br/> Expert in Stuff
<br/> Lorum ipsum Division
<br/> Department of Lorem Ipsum
<br/> 200 Car Talk Tower, Dewey Cheatum & Howe
<br/> Cambridge, MA
</li>
<li>
<span>John Jacob</span>
<br/> Expert in Stuff
<br/> Lorum ipsum Division
<br/> Department of Lorem Ipsum
<br/> 200 Car Talk Tower, Dewey Cheatum & Howe
<br/> Cambridge, MA
</li>
<li>
<span>John Jacob</span>
<br/> Expert in Stuff
<br/> Lorum ipsum Division
<br/> Department of Lorem Ipsum
<br/> 200 Car Talk Tower, Dewey Cheatum & Howe
<br/> Cambridge, MA
</li>
<li>
<span>John Jacob</span>
<br/> Expert in Stuff
<br/> Lorum ipsum Division
<br/> Department of Lorem Ipsum
<br/> 200 Car Talk Tower, Dewey Cheatum & Howe
<br/> Cambridge, MA
</li>
</ul>
</div>
<!-- /main-body -->
</aside>
<!-- /ASIDE -->
</div>
<!-- /CENTER ROW -->
</div>
<!-- /CENTER TABLE -->
<!-- FOOTER -->
<footer>
<p>
Copyright © 2018 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
<br/> XXX-999999-YY
</p>
<div class="logo">LOGO GOES HERE</div>
</footer>
<!-- /FOOTER-->
</div>
<!-- /container -->
</body>
</html>

This should fix issue #1 :
.container {
width: fit-content;
}

Related

Footer not in the correct place

Somehow, my HTML and CSS won't work properly. My main doubt is in the span. Because it's all working on any other pages.
The footer is not detecting any object, so it is staying at the most top of the page. (I've also tried putting the footer on the <footer> tag and it still shows the same result.)
The situation is illustrated in the picture that is attached.
Here is my code snippet:
.aboutuspagetitle {
width: 100%;
color: rgba(159,74,74,1);
position: absolute;
top: 176px;
left: 660px;
font-family: Merriweather Sans;
font-weight: Bold;
font-size: 40px;
opacity: 1;
}
.aboutuspagedesc {
width: 100%;
color: rgba(0,0,0,1);
position: absolute;
top: 313px;
left: 30px;
font-family: Merriweather Sans;
font-weight: normal;
font-size: 33px;
opacity: 1;
text-align: left;
}
.footer {
clear: both;
position: absolute;
height: 75px;
background-color: #121212;
font-family: Karla Tamil Upright;
color: white;
text-align: center;
left: 0px;
width: 300%;
}
.foot1{
width: 304px;
color: rgba(255,255,255,1);
position: absolute;
top: 0px;
left: 568px;
font-family: Karla Tamil Upright;
font-weight: normal;
font-size: 18px;
opacity: 1;
text-align: center;
}
.foot2{
width: 304px;
color: rgba(255,255,255,1);
position: absolute;
top: 45px;
left: 568px;
font-size: 14px;
opacity: 1;
text-align: center;
}
<body>
<span class="aboutuspagetitle">ABOUT US</span>
<span class="aboutuspagedesc">
<p>Lorem ipsum dolor sit amet.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut commodo nisl ut justo tincidunt, ac laoreet nunc elementum.</p>
</span>
<div class="footer">
<p class="foot1">THIS IS AN ADDRESS</p>
<span class="foot2">© 2021</span>
</div>
</body>
You just forgot to add bottom: 0; to the footer style. And position it using position: fixed; so it will stay at the bottom even when you scroll.
.aboutuspagetitle {
color: rgba(159,74,74,1);
font-family: Merriweather Sans;
font-weight: Bold;
font-size: 40px;
text-align: center;
}
.aboutuspagedesc {
width: 100%;
color: rgba(0,0,0,1);
font-family: Merriweather Sans;
font-weight: normal;
font-size: 33px;
text-align: left;
padding-bottom: 75px;
}
.footer {
display: flex;
position: fixed;
height: 75px;
background-color: #121212;
font-family: Karla Tamil Upright;
font-weight: normal;
color: white;
text-align: center;
left: 0px;
bottom:0;
width: 100%;
align-items: center;
justify-content: center;
flex-direction: column;
}
.foot1{
color: rgba(255,255,255,1);
font-size: 18px;
margin: 0;
}
.foot2{
color: rgba(255,255,255,1);
font-size: 14px;
}
<body>
<h1 class="aboutuspagetitle">ABOUT US</h1>
<span class="aboutuspagedesc">
<p>Lorem ipsum dolor sit amet.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut commodo nisl ut justo tincidunt, ac laoreet nunc elementum.</p>
</span>
<footer class="footer">
<p class="foot1">THIS IS AN ADDRESS</p>
<span class="foot2">© 2021</span>
</footer>
</body>
Here are some advices.
First, as said in the comments, don't use position absolute on everything !! As the moment you'll try a different screen size, everything will be offest.
Second, try not to add too many style that won't do anything at all at the end. If you try something and it doesn't work, remove it from the style !

Why is the viewport met-tag not working as expected

Im having some problems with this web page that I am building out. The code is pasted below but you can also take a look at it here: www.petermingione.com/Webcast2/
When the page loads on mobile devices the page is zoomed in and I have to pinch to get the zoom to the initial scale. I am confused as to why this is happening since I have included the viewport meta-tag:
Thank you very much for any help that you can give me. Pete
HTML:
<!DOCTYPE html>
<html lang="en-us">
<head>
<title>Lorem ipsum dolor sit amet</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- strongly recommended by the Bootstrap -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="app.css">
</head>
<body>
<div class="container">
<header class="header">
<div class="tbl-row">
<div class="header-left">
<h1>
<span>Lorem ipsum dolor sit amet, consectetur adipiscing</span><br/>
Excepteur sint occaecat cupidatat<br/>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
</h1>
</div>
<div class="header-spacer"></div>
<div class="header-right">
<p>Ut enim ad minim veniam, quis nostrud</p>
</div>
</div>
</header>
<div class="small-box"></div>
<!-- CENTER TABLE -->
<div class= "center-table">
<!-- CENTER ROW -->
<div class= "center-row">
<div class="vert-spacer"></div>
<!-- MAIN -->
<main>
<div class="main-body">
<div class="main-body-header">
<p><strong>WEBCAST</strong>TRANSMITTED LIVE ON</p>
<p>Sunday, 9 December 2018, 3:00 (EST) from New York, NY</p>
<div class="hr"></div>
<p><strong>Webcast:</strong><em>To View From Your Home or Office, Register at:</em></p>
<p>www.irure dolor in reprehenderit.com</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.</p>
</div>
<p class="foot-note">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.</p>
<p class="co-chairs"><span>Co-Chairs:</span> John Jones (Brazil), George Orwell (London, England)</p>
<table class="table">
<thead>
<tr class="header">
<th colspan="3">agenda</th>
</tr>
</thead>
<tbody>
<tr>
<td>09:00 – 09:05</td>
<td>Welcome and Introduction</td>
<td>Co-Chairs</td>
</tr>
<tr>
<td>09:05 – 09:30</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</td>
<td>John Jones</td>
</tr>
<tr class="qa">
<td>09:30 – 09:35</td>
<td colspan="2">Q&A</td>
</tr>
<tr>
<td>09:35 – 10:00</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</td>
<td>George Orwell</td>
</tr>
<tr class="qa">
<td>10:00 – 10:05</td>
<td colspan="2">Q&A</td>
</tr>
<tr>
<td>10:05 – 10:30</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</td>
<td>Who Cares</td>
</tr>
<tr class="qa">
<td>10:30 – 10:35</td>
<td colspan="2">Q&A</td>
</tr>
<tr class="break">
<td>10:35 – 11:05</td>
<td colspan="2">Break</td>
</tr>
<tr>
<td>11:05 – 11:30</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</td>
<td>Sam Man</td>
</tr>
<tr class="qa">
<td>11:30 – 11:35</td>
<td colspan="2">Q&A</td>
</tr>
<tr>
<td>11:35 – 12:35</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</td>
<td>Faculty</td>
</tr>
<tr>
<td>12:35 – 12:45</td>
<td>Closing Remarks</td>
<td>Co-Chairs</td>
</tr>
</tbody>
</table>
<!-- /table -->
</div>
<!-- /main-body -->
</main>
<!-- /MAIN -->
<!-- ASIDE -->
<aside>
<div class="main-body">
<p class="list-header">Co-Chairs</p>
<ul class="faculty-list">
<li>
<span>John Jacob</span><br/>
Expert in Stuff<br/>
Lorum ipsum Division<br/>
Department of Lorem Ipsum<br/>
200 Car Talk Tower, Dewey Cheatum & Howe<br/>
Cambridge, MA
</li>
<li>
<span>John Jacob</span><br/>
Expert in Stuff<br/>
Lorum ipsum Division<br/>
Department of Lorem Ipsum<br/>
200 Car Talk Tower, Dewey Cheatum & Howe<br/>
Cambridge, MA
</li>
</ul>
<p class="list-header">faculty</p>
<ul class="faculty-list">
<li>
<span>John Jacob</span><br/>
Expert in Stuff<br/>
Lorum ipsum Division<br/>
Department of Lorem Ipsum<br/>
200 Car Talk Tower, Dewey Cheatum & Howe<br/>
Cambridge, MA
</li>
<li>
<span>John Jacob</span><br/>
Expert in Stuff<br/>
Lorum ipsum Division<br/>
Department of Lorem Ipsum<br/>
200 Car Talk Tower, Dewey Cheatum & Howe<br/>
Cambridge, MA
</li>
<li>
<span>John Jacob</span><br/>
Expert in Stuff<br/>
Lorum ipsum Division<br/>
Department of Lorem Ipsum<br/>
200 Car Talk Tower, Dewey Cheatum & Howe<br/>
Cambridge, MA
</li>
<li>
<span>John Jacob</span><br/>
Expert in Stuff<br/>
Lorum ipsum Division<br/>
Department of Lorem Ipsum<br/>
200 Car Talk Tower, Dewey Cheatum & Howe<br/>
Cambridge, MA
</li>
</ul>
</div>
<!-- /main-body -->
</aside>
<!-- /ASIDE -->
</div>
<!-- /CENTER ROW -->
</div>
<!-- /CENTER TABLE -->
<!-- FOOTER -->
<footer>
<p>
Copyright © 2018 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt<br/>
XXX-999999-YY
</p>
<div class="logo">LOGO GOES HERE</div>
</footer>
<!-- /FOOTER-->
</div>
<!-- /container -->
</body>
</html>
CSS:
* {
box-sizing: border-box;
}
html {
font-size: 16px;
}
html, body, p {
margin: 0;
padding: 0;
}
body {
font-family: "Arial Narrow", Helvetica, sans-serif;
color: black;
font-size: 16px;
font-size: 1rem;
}
p {
line-height: 1;
margin: 0;
padding: 0;
}
.container {
padding: 0;
max-width: 1239px;
margin: 0 auto;
margin-bottom: -137px;
width: fit-content;
}
header {
display: table;
vertical-align: top;
height: 200px;
z-index: 1004;
}
.header-left {
display: table-cell;
vertical-align: top;
width: 78%;
color: #fff;
background-color: #00948f;
box-shadow: 7px 15px 18px #aaa;
-webkit-box-shadow: 7px 15px 18px #aaa;
position: relative;
}
.header-left h1 {
font-size: 50px;
font-size: 3.125rem;
margin: 0;
letter-spacing: 2px;
background-color: #00948f;
width: 100%;
padding: 20px 85px 30px 138px;
line-height: 1.1;
margin: 0;
}
.header-left h1 span {
font-size: 30px;
font-size: 1.875rem;
line-height: 1;
display: inline-block;
margin-bottom: 20px;
}
.header-spacer {
display: table-cell;
width: 2%;
}
.header-right {
display: table-cell;
width: 21%;
background-color: #9fd2d0;
box-shadow: 7px 15px 18px #aaa;
-webkit-box-shadow: 7px 15px 18px #aaa;
z-index: 1002;
padding: 175px 61px 0 20px;
line-height: 1.3;
font-size: 28px;
font-size: 1.75rem;
}
.small-box {
width: 8%;
height: 33px;
background-color: #9fd2d0;
z-index: 1005;
padding: 0;
}
.center-table {
display: table;
width: 100%;
margin-top: 10px;
}
.center-row {
display: table-row;
}
.vert-spacer {
display: table-cell;
background-color: #e6e7e8;
z-index: -2;
width: 8%;
}
main {
display: table-cell;
width: 69%;
}
.main-body {
margin-left: 20px;
height: 100%;
}
.main-body p:first-child {
font-size: 44px;
font-size: 2.75rem;
}
.main-body p:nth-child(2) {
font-size: 27px;
font-size: 1.6875rem;
}
.main-body .hr {
border-top: 10px solid white;
margin: 20px 0;
}
.main-body p:nth-child(3) {
font-size: 27px;
font-size: 1.6875px;
}
.main-body-header {
background-color: #9fd2d0;
padding: 10px 25px 15px;
margin-bottom: 20px;
}
.main-body-header p:first-child {
font-size: 44px;
font-size: 2.75rem;
margin-bottom: 10px;
}
.main-body-header p:nth-child(2) {
font-size: 27px;
font-size: 1.6875rem;
}
.main-body-header hr {
border-width: 10px;
}
.main-body-header p:nth-child(4) {
font-size: 30px;
font-size: 1.875rem;
text-align: center;
margin-bottom: 5px;
}
.main-body-header p:nth-child(5) {
font-size: 24px;
font-size: 1.5rem;
text-align: center;
margin-bottom: 10px;
}
.main-body-header p:nth-child(6) {
font-size: 24px;
font-size: 1.5rem;
}
.foot-note {
font-size: 20px !important;
font-size: 1.25rem !important;
margin-bottom: 1.25rem;
}
.co-chairs {
font-size: 22px !important;
font-size: 1.375rem !important;
margin-bottom: 20px;
}
.co-chairs span {
color: #00837c;
}
table {
font-size: 23px;
font-size: 1.4375rem;
border-collapse: collapse;
}
table th {
text-align: left;
padding-left: 20px;
}
table tr td {
padding: 5px;
}
table tr td:first-child {
width: 20%;
}
table tr td:nth-child(2) {
width: 55%;
}
table tr td:nth-child(3) {
width: 25%;
text-align: right;
padding-right: 20px;
}
table tr.header {
text-transform: uppercase;
font-size: 28px;
font-size: 1.75rem;
background-color: #00948f;
color: white;
}
table tr.header th {
border-top: 5px solid black;
}
table tr:not(agenda) td {
border-bottom: 3px solid #00948f;
}
table tr.qa {
background-color: #e5f4f4;
}
table tr.break {
background-color: #cdeae9;
}
aside {
padding: 0 20px;
display: table-cell;
width: 21%;
text-align: top;
}
aside .list-header {
text-transform: uppercase;
color: #004a99;
font-size: 28px !important;
font-size: 1.75rem !important;
margin-bottom: 10px;
}
aside .faculty-list {
list-style: none;
padding: 0;
font-size: 18px;
font-size: 1.125rem;
color: #a0a0a0;
}
aside .faculty-list li {
margin-bottom: 15px;
}
aside .faculty-list li span {
display: inline-block;
color: black;
font-size: 23px;
font-size: 1.277777778rem;
}
footer {
position: absolute;
left: 0;
right: 0;
bottom: 137px;
z-index: 10000;
position: relative;
min-width: 420px;
background-color: #00948f;
width: 100%;
height: 402px;
z-index: -2;
}
footer p {
position: absolute;
left: 20px;
bottom: 30px;
font-size: 19px;
font-size: 1.1857rem;
line-height: 1.3;
}
footer .logo {
position: absolute;
right: 60px;
bottom: 30px;
width: 90px;
height: 90px;
background-color: #9fd2d0;
display: inline-block;
}
#media screen and (max-width: 767px) {
.header-left,
.header-right {
display: block;
width: auto;
}
.header-left {
margin: 0 20px;
}
.header-left h1 {
font-size: 40px !important;
font-size: 2.5rem !important;
padding: 20px !important;
}
.header-left h1 span {
font-size: 15px !important;
font-size: 0.9375rem !important;
}
.header-right {
padding: 20px !important;
margin: 30px 20px 0;
}
.small-box {
display: none;
}
.vert-spacer {
display: none;
}
main, aside {
display: block;
width: auto;
}
.main-body {
margin: 20px;
}
.main-body-header p:first-child {
text-align: center;
font-size: 40px;
font-size: 2.5rem;
}
}
#media screen and (max-width: 1120px) {
footer p {
bottom: 100px;
}
footer .logo {
right: auto;
left: 20px;
bottom: 5px;
}
}
Maybe you should try to make it maximum scale to 0. However, it will disable the zoom feature. you cannot pinch out to zoom.
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

Why is the background image scrolling?

I'm trying to make this background image fit the width of the browser window without scrolling horizontally. I'm also running into issues with centering everything on the page because of this. Unfortunately this issue keeps occuring in my recent projects, and I've tried everything I can think of to solve it.
Is it something wrong with my code, the image sizes, am I missing something?
body {
margin: 0 auto;
padding: 0;
width: 100%;
height: 100%;
}
.main-nav {
display: none;
font-family: 'Yantramanav', sans-serif;
}
.logo {
color: #fff;
font-family: 'Yantramanav', sans-serif;
position: absolute;
top: 70;
left: 15;
font-size: .5em;
}
.promo {
position: fixed;
top: 0;
z-index: 99;
padding: 10px;
width: 100%;
height: 60px;
background-color: #000;
color: #fff;
font-size: .7em;
text-align: center;
}
.welcome {
color: #fff;
font-family: 'Yantramanav', sans-serif;
background-color: lightgrey;
background:
linear-gradient(#303030, transparent 90%),
url('../imgs/camerabg.jpg') no-repeat center;
background-size: cover;
height: 100%;
width: 100%;
text-align: center;
margin-top: -10px;
padding: 200px;
}
.welcome h1 {
font-size: 2em;
}
.welcome a {
text-decoration-style: underline;
color: lightgrey;
font-size: 2em;
display: inline-block;
}
.welcome ul {
list-style-type: none;
}
.location {
font-size: 1.5em;
margin-top: 10px;
padding: 10px;
border: 2px solid lightgrey;
color: lightgrey;
}
.products {
font-family: 'Raleway', sans-serif;
height: 150px;
width: 100%;
background-color: #000;
background: linear-gradient(#181818, transparent 90%),
url('../imgs/oldcamera.jpg') no-repeat center;
background-size: cover;
color: #fff;
text-align: center;
padding: 150px;
margin-bottom: 40px;
}
.products h1 {
font-size: 3em;
}
.products a {
padding: 10px;
border: 2px solid lightgrey;
color: lightgrey;
font-size: 2em;
}
/*===============================
Intro
==============================*/
.intro1, .intro2 p {
font-family: 'Yantramanav', sans-serif;
}
.intro1, .intro2 span {
font-family: 'Yantramanav', sans-serif;
}
<DOCTYPE! html>
<html>
<head>
<meta name="viewport" content="width=device-width, user-scalable=no">
<link href="https://fonts.googleapis.com/css?family=Raleway|Yantramanav" rel="stylesheet">
<link rel="stylesheet" href="styles/stylesheet.css">
<title>TITLE HERE</title>
</head>
<body>
<header>
<div class="promo">
<p>BUY 1 GET 1 Free 1/2 OFF CLOCK FRAME COMBOS<br>
*Offer Valid 5/1/18. May not be combined with another offer or promotion. While supplies last.*<p>
</div>
<div class="logo">
<h1> Name Here</h1>
</div>
<div class="main-nav">
<ul>
<li>Home</li>
<li>About</li>
<li>Blog</li>
<li> Hire Us</li>
</ul>
</div>
<div class="welcome">
<h1>Welcome To Our New Site</h1>
<p>Let us help you with your best moments.</p>
<ul>
<li>Order Now</li>
<li><a class="location" href="#">Find Our New Location</a></li>
</ul>
</div>
</header>
<div class="intro1">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,</p>
<span> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod</span>
</div>
</body>
</html>

Absolute div height being cut off inside relative div

I'm having trouble getting one of my absolutely positioned divs to display correctly. It's getting cut off unless I set a height for the parent (relative) div which I can't do as I will never know the height required.
I originally wasn't using any absolute positioning but the contents of the comm div were wrapping underneath the avatar div so I thought absolute positioning would fix it and it has, apart from the text being cut off at the bottom.
This is the structure and you can see what's happening in this fiddle.
body {
background: #212121;
font-family: arial;
}
.main {
width: 80%;
margin: 20px auto;
}
.wrap {
width: 100%;
background: white;
padding: 10px;
overflow: hidden;
position: relative;
}
a.avatar {
width: 45px;
height: 45px;
border-radius: 50%;
overflow: hidden;
display: inline-block;
float: left;
margin-right: 10px;
position: relative;
}
a.avatar img {
width: 100%;
}
.top {
display: block;
overflow: hidden;
position: absolute;
left: 70px;
}
a.name {
font-weight: bold;
margin-right: 10px;
float: left;
}
.posted {
color: #BBB;
font-size: 12px;
padding-top: 3px;
float: left;
}
p.comm {
display: block;
position: absolute;
left: 70px;
top: 20px;
height: 100%;
}
<div class="main">
<div class="wrap">
<img src="http://www.tangoflooring.ca/wp-content/uploads/2015/07/user-avatar-placeholder.png" />
<div class="top">
John Doe
<div class="posted">8 mins ago</div>
</div>
<p class="comm">Lorem ipsum dolor sit amet.
</p>
</div>
<div class="wrap">
<img src="http://www.tangoflooring.ca/wp-content/uploads/2015/07/user-avatar-placeholder.png" />
<div class="top">
Jane Doe
<div class="posted">11 mins ago</div>
</div>
<p class="comm">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
<div class="wrap">
<img src="http://www.tangoflooring.ca/wp-content/uploads/2015/07/user-avatar-placeholder.png" />
<div class="top">
Jimmy Doe
<div class="posted">18 mins ago</div>
</div>
<p class="comm">Ut enim ad minim veniam.
</p>
</div>
</div>
Try using this modified css code.
body {
background: #212121;
font-family: arial;
}
.main {
width: 80%;
margin: 20px auto;
}
.wrap {
width: 100%;
background: white;
padding: 10px;
position: relative;
}
a.avatar {
width: 45px;
height: 45px;
border-radius: 50%;
overflow: hidden;
display: inline-block;
float: left;
margin-right: 10px;
position: relative;
}
a.avatar img {
width: 100%;
}
.top {
display: flex;
margin-left: 70px;
}
a.name {
font-weight: bold;
margin-right: 10px;
}
.posted {
color: #BBB;
font-size: 12px;
padding-top: 3px;
}
p.comm {
display: block;
margin-left: 70px;
height: 100%;
}
You need to wrap .top and .comm in a div and with the use of flex you can achieve it
body {
background: #212121;
font-family: arial;
}
.main {
width: 80%;
margin:20px auto;
}
.wrap {
width: 100%;
background: white;
padding: 10px;
overflow: hidden;
position: relative;
display: flex;
}
a.avatar {
margin-right: 10px;
}
a.avatar img {
width: 45px;
height: 45px;
border-radius: 50%;
}
.top {
width: 100%;
overflow: hidden;
}
a.name {
font-weight: bold;
margin-right: 10px;
float: left;
}
.posted {
color: #BBB;
font-size: 12px;
padding-top: 3px;
float: left;
}
p.comm {
margin-top: 5px;
}
.right {
max-width: 88%;
}
<div class="main">
<div class="wrap">
<img src="http://www.tangoflooring.ca/wp-content/uploads/2015/07/user-avatar-placeholder.png">
<div class="right">
<div class="top">
Jane Doe
<div class="posted">11 mins ago</div>
</div>
<p class="comm">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do </p>
</div>
</div>
<div class="wrap">
<img src="http://www.tangoflooring.ca/wp-content/uploads/2015/07/user-avatar-placeholder.png">
<div class="right">
<div class="top">
Jane Doe
<div class="posted">11 mins ago</div>
</div>
<p class="comm">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
</div>
<div class="wrap">
<img src="http://www.tangoflooring.ca/wp-content/uploads/2015/07/user-avatar-placeholder.png">
<div class="right">
<div class="top">
Jane Doe
<div class="posted">11 mins ago</div>
</div>
<p class="comm">Lorem ipsum dolor sit amet</p>
</div>
</div>
</div>
Working fiddle here
Just modify on your p.comm selector like below:
p.comm {
display: block;
position: relative;
top: 10px;
padding-left: 60px;
}

Align divs to the right and prevent container to collapse

I'm having trouble trying to get the event-info class text to align to the right of the events calendar as a vertical list. Floating the events-list to the right seems to collapse my text altogether, which I don't want. Here is my HTML and CSS:
.workshop-events {
width: 100%;
background-color: #f2f2f2;
padding: 1px 20px;
/*padding: 20px;*/
}
.calendar {
width: 75px;
display: table-cell;
}
.calendar .month {
text-transform: uppercase;
font-size: 16px;
border: 1px solid #b2b2b2;
padding: 3px 0;
background: #FFF;
}
.calendar .day {
font-size: 30px;
font-weight: 500;
border: 1px solid #b2b2b2;
border-top: none;
padding: 7px 0;
background: #FFF;
}
.calendar .day {
font-size: 30px;
font-weight: 500;
border: 1px solid #b2b2b2;
border-top: none;
padding: 7px 0;
background: #FFF;
}
.events-info {
font-weight: bold;
font-size: 14px;
}
<div class="workshop-events">
<h1 class="section-heading">WORKSHOP & EVENTS</h1>
<!-- EVENT CALENDAR -->
<div class="calendar">
<div class="month text-center">June</div>
<div class="day text-center">30</div>
</div>
<!--EVENTS CALENDAR-->
<div class="events-info">Lorem Ipsum</div>
<div class="events-info">Dolor Sit Amet Sed</div>
<div class="events-info">Libero</div>
<button class="view-all-events">VIEW ALL</button>
</div>
<!-- WORKSHOP AND EVENTS-->
You can simply float the calendar box to the left. For a better result, wrap all events-info + button into a container (to avoid the text to wrap to new lines below the calendar box, see the demo).
HTML updates:
<div class="events-container">
<div class="events-info">Lorem Ipsum</div>
<div class="events-info">Dolor Sit Amet Sed</div>
<div class="events-info">Libero</div>
<button class="view-all-events">VIEW ALL</button>
</div>
CSS updates:
.workshop-events {
overflow: auto; /*fix possible collapses caused by floating*/
}
.calendar {
float: left;
margin-right: 20px;
}
.events-container {
overflow: auto; /*prevent the text to wrap below the calendar*/
}
.workshop-events {
width: 100%;
background-color: #f2f2f2;
padding: 20px;
}
.calendar {
width: 75px;
display: table-cell;
}
.calendar .month {
text-transform: uppercase;
font-size: 16px;
border: 1px solid #b2b2b2;
padding: 3px 0;
background: #FFF;
}
.calendar .day {
font-size: 30px;
font-weight: 500;
border: 1px solid #b2b2b2;
border-top: none;
padding: 7px 0;
background: #FFF;
}
.calendar .day {
font-size: 30px;
font-weight: 500;
border: 1px solid #b2b2b2;
border-top: none;
padding: 7px 0;
background: #FFF;
}
.events-info {
font-weight: bold;
font-size: 14px;
}
/*NEW RULES BELOW*/
.workshop-events {
overflow: auto;
}
.calendar {
float: left;
margin-right: 20px;
}
.events-container {
overflow: auto;
}
<div class="workshop-events">
<h1 class="section-heading">WORKSHOP & EVENTS</h1>
<!-- EVENT CALENDAR -->
<div class="calendar">
<div class="month text-center">June</div>
<div class="day text-center">30</div>
</div>
<!-- EVENTS INFO-->
<div class="events-container">
<div class="events-info">1. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
<div class="events-info">2. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
<div class="events-info">3. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
<button class="view-all-events">VIEW ALL</button>
</div>
</div>
<!-- WORKSHOP AND EVENTS-->