so I have a fixed bottom navbar with 6 links and 4 icons on it (3 for different social medias and 1 to return the the index), which looks exactly how I want it to when the page is fullscreen but once the window reaches around 60% of maximised, everything goes out of position and isn't aligned.
#import url(http://fonts.googleapis.com/css?family=Raleway:300,400,700);
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.clearfix:before,
.clearfix:after {
content: '';
display: table;
}
.clearfix:after {
clear: both;
}
body {
background: #333;
color: #fff;
font-size: 16px;
font-family: 'Raleway', Arial, sans-serif;
}
a {
color: #fff;
text-decoration: none;
font-weight: 700;
outline: none;
}
/* Link Colours */
.fade {
background: #333;
}
.fade a {
color: #fff;
}
a:hover,
a:focus {
color: #333;
}
.social {
float: left;
clear: none;
}
#social {
padding: 5px;
}
/* Buttons */
.Streetworn-demos {
width: 100vw;
background-color: #ff9966;
margin: 0;
text-align: center;
position: fixed;
bottom: 0;
}
.Streetworn-demos a {
text-align: center;
display: inline-block;
margin: 0.5em 0.75em;
line-height: 1;
font-family: 'Raleway', cursive;
letter-spacing: 1px;
}
.about h3 {
font-family: 'Satisfy', cursive;
font-size: 32px;
margin: 5px;
padding-top: 6px;
padding-left: 10px;
border-radius: 5px 25px 25px 5px;
background-color: #ff9966;
}
.about p {
font-family: 'Raleway', cursive;
font-weight: 700;
font-size: 16px;
padding: 10px;
margin: auto;
}
.login {
width: 100%;
margin: auto;
text-align: right;
padding: 10px;
background: #ff9966;
}
#home {
padding: 5px;
}
.home {
float: right;
clear: none;
}
.brands {
padding-top: 13px;
}
.about {
margin-top: -100px;
margin-left: auto;
margin-right: auto;
width: 75%;
padding: 15px;
text-align: justify;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden] {
display: none;
}
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
mark {
background: #ff0;
color: #000;
}
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
pre {
white-space: pre-wrap;
}
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 0;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
button,
input,
select,
textarea {
font-family: inherit;
font-size: 100%;
margin: 0;
}
button,
input {
line-height: normal;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
vertical-align: top;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
<nav class="Streetworn-demos">
<a class="home" href="index.html"><img id="home" alt="Return to the landing page" src="https://image.ibb.co/m5Fxe7/home2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/m5Fxe7/home2.png'" onmouseout="this.src='https://image.ibb.co/m5Fxe7/home2.png'"></a>
<a class="brands" href="#">PALACE</a>
<a class="brands" href="#">GOLFWANG</a>
<a class="brands" href="#">SUPREME</a>
<a class="brands" href="#">BILLIONAIRE'S BOYS CLUB</a>
<a class="brands" href="#">STUSSY</a>
<a class="brands" href="#">ANTISOCIAL SOCIAL CLUB</a>
<div class="social">
<img id="social" alt="Follow Streetworn on Facebook!" src="https://image.ibb.co/hxnXCS/fb2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/hxnXCS/fb2.png'" onmouseout="this.src='https://image.ibb.co/hxnXCS/fb2.png'">
<img id="social" alt="Follow Streetworn on Instagram!" src="https://image.ibb.co/hxnXCS/fb2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/hxnXCS/fb2.png'" onmouseout="this.src='https://image.ibb.co/hxnXCS/fb2.png'">
<img id="social" alt="Follow Streetworn on Twitter!" src="https://image.ibb.co/hxnXCS/fb2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/hxnXCS/fb2.png'" onmouseout="this.src='https://image.ibb.co/hxnXCS/fb2.png'">
</div>
</nav>
How do I go about fixing it so that when the page is resized, the menu items are all centered and maybe make the home icon go below the links, next to the social icons (ignore the icons in the snippet, just needed icons to show what I meant).
Any advice would be appreciated! Thanks, Zane.
you can give a variable to the size of the font with .Streetworn-demos a {... font-size: 1.3vw;} but it is not easy to read on small screens, I recommend using #media all and (max-width: 768px) {}
and position differently for example centered
this
#media all and (max-width:768px){
.Streetworn-demos > a:first-of-type{display: block;width: 100%;margin: 0;padding: 0;}
.Streetworn-demos a{font-size: 1em;display: inline-block;text-align: center;width: 46%;margin: 3px 0;padding: 4px 0;}
.social a{display: inline-block;width: 20px;margin: 0 9px;}
}
or
#media all and (max-width:768px){
.Streetworn-demos a{font-size: 1em;display: inline-block;text-align: center;width: 100%;margin: 3px 0;padding: 4px 0;}
.social a{display: inline-block;width: 20px;margin: 0 9px;}
}
Related
I am trying to get the blue buttons to always stay lined up. Depending on the size of the screen and the text moving to multiple lines, it will cause the buttons to get out of alignment. Could I get help with how to get these to stay in line? http://marketing.geneia.com/himss2019/
Screenshot of buttons
#charset "utf-8";
/* CSS Document */
/* --------Resets-------- */
*{
margin:0;
padding:0;
border:0;
}
html, body {
margin: 0px;
padding: 0px;
border: 0px;
}
article, aside, details, figcaption, figure, footer, header, main, menu, nav, section, summary {
display: block;
}
body {
font-family: Averta-Regular, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
margin: 0 0 25px 0;
padding: 0;
font-family: Averta-Regular, sans-serif;
}
/* --------Styles-------- */
h1 {
font-size: 36px;
font-family: Averta-Extrabold, sans-serif;
font-weight: normal;
font-style: normal;
}
h2 {
font-size: 28px;
color: #125687;
font-family: Averta-Extrabold, sans-serif;
}
h2.smaller-blue {
font-size: 24px;
}
h3 {
font-size: 18px;
font-family: Averta-Semibold, sans-serif;
font-weight: normal;
line-height: 28px;
}
p, li {
color: #00354e;
font-size: 17px;
line-height: 30px;
}
ul {
list-style: none;
margin-bottom: 1.5rem;
}
li {
padding-left: 30px;
}
li:before {
content: "";
border-color: transparent #00aecb;
border-style: solid;
border-width: 0.35em 0 0.35em 0.45em;
display: block;
height: 0;
width: 0;
left: -1.2em;
top: 1.1em;
position: relative;
}
a {
position: relative;
display: inline-block;
transition: .3s;
text-decoration: none;
color: #00aecb;
}
a::after {
position: absolute;
bottom: .3em;
left: 0;
content: '';
width: 100%;
height: 1px;
background-color: #00adca;
opacity: 0;
transition: .3s;
}
a:hover::after {
bottom: 0;
opacity: 1;
color: #00adca;
}
a:hover {
color: #00adca;
text-decoration: none;
cursor: pointer;
}
b, strong, .bold {
font-weight: 700;
}
hr {
margin: 20px 0;
width: 100%;
border-top: 1px solid #cacfde;
}
.uppercase {
text-transform: uppercase;
}
.container, .container-fluid {
margin-right: auto;
margin-left: auto;
padding-left: 25px;
padding-right: 25px;
max-width: 1366px;
}
.uppercase {
text-transform: uppercase;
}
.vert-middle {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.green {
color: #a3d869;
}
.teal {
color: #00aecb;
}
.drk-blue {
color: #125687;
}
section.background-grey {
background: #eeeff2;
padding: 60px 20px;
}
section.background-white {
background: #fff;
padding: 60px 20px;
}
.center {
margin: 0 auto;
text-align: center;
}
.img-responsive {
display: block;
max-width: 100%;
height: auto;
}
.btn {
background-color: #4CAF50; /* Green */
border: none;
border-radius: 4px;
color: white;
font-family: Averta-Semibold;
font-weight: normal;
padding: 18px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
margin: 4px 2px;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
cursor: pointer;
}
a.btn:hover {
background-color: #42cfe6;
color: #fff;
}
a.btn::after {
display: none;
}
.btn-teal {
background-color: #00AECB;
}
a.btn.btn-teal:hover {
background-color: #42cfe6;
}
.btn-drkblue {
background-color: #0f5687;
}
a.btn.btn-drkblue:hover {
background-color: #0d3a5b;
}
a.anchor-link {
display: block;
}
a.anchor-link::after {
display: none;
}
a.link-image::after {
display: none;
}
/* --------Header/Top Nav-------- */
header {
background-color: #fff;
height: 100px;
width: 100%;
}
.logo {
padding: 15px 0;
}
nav {
padding: 40px 0;
float: right;
}
nav ul {
list-style-type: none;
text-align: right;
float: right;
margin: 0;
padding: 0;
}
nav li {
display: inline;
padding: 2px;
color: #005d91;
font-size: 16px;
}
nav li:before {
display: none;
}
nav a:hover {
color: #00aecb;
}
/* --------Hero-------- */
.hero {
position: relative;
padding: 125px 0 125px 0;
background: url(img/lp-hero-1.jpg) no-repeat;
background-size:cover;
background-position: center 20%;
color: #fff;
}
.hero.subscribe {
position: relative;
padding: 125px 0 125px 0;
background: url(img/lp-hero-2.jpg) no-repeat;
background-size:cover;
background-position: center 20%;
color: #fff;
}
.hero.sessions {
position: relative;
padding: 125px 0 125px 0;
background: url(img/lp-hero-3.jpg) no-repeat;
background-size:cover;
background-position: center 20%;
color: #fff;
}
.hero h1 {
font-size: 48px;
margin-top: 10px;
}
.mobile h1 {
color: #125687;
font-weight: 400;
font-size: 28px;
}
.mobile p {
font-size: 14px;
line-height: 24px;
}
.subtitle {
font-size: 18px;
font-weight: 700;
text-transform: uppercase;
margin-bottom: 10px;
letter-spacing: .1em;
color: #fff;
background: #73ca14;
padding: 10px 15px;
display: inline-block;
}
.hero-text p {
color: #fff;
}
.hero-text h3 {
/*color: #a3d06a;*/
}
/* --------Main Content-------- */
.main-content--text {
padding-right: 40px;
width: 60%;
}
img.pdf-thumb {
width: 225px;
margin: -30px 0 0 0;
-ms-transform: rotate(6deg);
-webkit-transform: rotate(6deg);
transform: rotate(6deg);
}
p.intro-text {
font-size: 22px;
line-height: 30px;
color: #125687;
}
.cta-callout {
background: rgba(255, 255, 255, 0.7); /* White background with 70% opacity */
padding: 25px;
margin: 0 0 20px 0;
}
.cta-callout p{
margin-bottom: 0;
}
p.subhead {
margin: 30px 0 5px 0;
color: #125687;
}
.col-lg-7.main-text {padding: 0 10px 0 50px;}
/* --------Form-------- */
form {
margin-top: 25px;
padding: 0 30px 30px;
}
input[type=text], select {
width: 100%;
padding: 8px;
margin: 0 0 10px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
font-size: 15px;
}
input[type=submit] {
background-color: #00aecb;
color: white;
padding: 14px 40px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
-webkit-transition: background-color .5s ease-out;
-moz-transition: background-color .5s ease-out;
-o-transition: background-color .5s ease-out;
transition: background-color .5s ease-out;
}
input[type=submit]:hover {
background-color: #125687;
}
label {
color: #5e5f60;
margin-bottom: 0;
font-size: 14px;
font-weight: 700;
}
.download-form {
background: #fff;
padding: 0;
}
.download-form h3 {
color: #fff;
font-size: 20px;
font-weight: 500;
}
.form-header {
background: #125687;
padding: 30px 20px;
text-align: center;
}
textarea,
input.text,
input[type="text"],
input[type="button"],
input[type="submit"],
.input-checkbox {
-webkit-appearance: none;
border-radius: 0;
}
/* --------Value Prop Content-------- */
.valueprop {
padding: 10px 30px;
}
.valueprop:nth-child(n+2) {
border-left: 1px solid #ebebeb;
}
.valueprop p {
text-align: center;
font-size: 15px;
line-height: 25px;
}
.valueprop h3 {
color: #00aecb;
text-transform: uppercase;
margin-bottom: 20px;
margin-top: 1.5em;
}
.valueprop-content h2 {
margin-bottom: 50px;
}
section.background-white.valueprop-content {
padding: 60px 20px;
}
section.background-white.valueprop-content h3 {
color: #00aecb;
text-transform: uppercase;
margin-bottom: 20px;
margin-top: 1.5em;
font-family: Averta-Bold, sans-serif;
}
.verticalLine {
border-left: 1px solid red;
}
/* --------Events-------- */
section.events {
padding: 60px 0;
}
.thead-blue {
background-color: #00aecc;
color: #fff;
}
/* --------Footer-------- */
.container-fluid--footer {
margin-right: auto;
margin-left: auto;
padding-left: 25px;
padding-right: 25px;
max-width: 800px;
}
.page-footer {
background-color: #125687;
bottom: 0;
margin: 0;
padding: 60px 0;
}
.footer-info {
display: inline;
}
.footer-1 {
text-align: center;
}
.footer-2 {
text-align: center;
}
.footer-1 h3, .footer-2 h3,
.footer-1 p, .footer-2 p,
.footer-1 a, .footer-2 a {
color: #fff;
}
.footer-nav {
padding-top: 60px;
text-align: center;
margin: 0 auto;
}
.footer-nav ul {
list-style-type: none;
text-align: center;
margin: 0;
padding: 0;
}
.footer-nav li {
display: inline;
padding: 0;
font-size: 14px;
}
.footer-nav li:before {
display: none;
}
.footer-nav li:after {
content: "|";
color: #a7a298;
padding: 0 10px;
}
.footer-nav li:nth-last-child(1):after {
display: none;
}
.footer-nav a {
color: #fff;
}
.copyright {
font-size: 14px;
padding-top: 15px;
margin: 0;
color: #fff;
}
/* --------Font Awesome Styles-------- */
#font-face {
font-family: 'FontAwesome';
src: url('fonts/fontawesome-webfont.eot?v=4.7.0');
src: url('fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.fa-twitter-square:before {
content: "\f081";
}
.fa-rss-square:before {
content: "\f143";
}
.fa-linkedin-square:before {
content: "\f08c";
}
i.fa.fa-rss-square, i.fa.fa-linkedin-square, i.fa-twitter-square, i.fa-facebook-square {
font-size: 20px;
color: #00aecb;
}
.fa-facebook-square:before {
content: "\f082";
}
i.fa:hover {
color: #125687;
}
a.social-icon::after {
background-color: #fff !important;
content: none;
}
/* --------Media Queries-------- */
#media (max-width: 1024px){
input[type=submit] {padding: 14px 25px;}
h1 {font-size: 32px;}
.hero h1 {font-size: 38px;}
h2 {font-size: 25px;}
}
#media (min-width: 901px) {
section.main-content>div.container-fluid {
display: flex;
flex-direction: row-reverse;
}
}
#media (max-width: 991px){
img.img-responsive.text-img {padding: 0 0 20px 0;}
.col-lg-7.main-text {padding: 0 20px;}
}
#media (max-width: 900px){
input[type=submit] {padding: 14px 40px;}
section.background-grey {
padding: 40px 0 30px 0;
}
.main-content--text {
padding: 0;
width: 100%;
}
h1 {font-size: 30px;}
.subtitle {
font-size: 16px;
}
.overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #007caa;
opacity: 0.6;
}
.col-sm-6.hero-text {
flex: 80%;
max-width: 80%;
}
}
#media (max-width: 767px){
.valueprop:nth-child(n+2) {
border-left: none;
}
.hero, .hero.sessions, .hero.subscribe {
padding: 80px 0 70px 0;
}
img.pdf-thumb {
width: 200px;
margin: -20px 0 0 0;
}
}
#media (max-width: 580px){
.hero, .hero.sessions, .hero.subscribe {padding: 48px 0 38px 0}
nav li {
padding: 0 3px;
}
header {
height: inherit;
}
.col-sm-6.hero-text {
flex: 100%;
max-width: 100%;
}
header .container-fluid {
text-align: center;
}
nav {
padding: 10px 0 20px 0;
float: none;
}
nav ul {
float: none;
text-align: center;
}
.logo {
width: 65%;
padding: 15px 0 0;
}
.hero h1 {font-size: 26px;}
.hero h3 {font-size: 16px;}
h1 {font-size: 26px;}
.subtitle {
font-size: 14px;
}
.btn {
width: 100%;
}
h2 {font-size: 22px;}
section.background-grey, section.background-white, section.events {padding: 30px 0 20px 0;}
section.background-white.valueprop-content {padding: 40px 20px;}
input[type=submit] {padding: 14px 25px;}
form {padding: 0 20px 30px;}
.download-form h3 {font-size: 16px;}
img.pdf-thumb {
width: 150px;
margin: -10px 0 0 0;
}
}
#media (max-width: 460px){
img.pdf-thumb {
width: 150px;
margin: 10px 0 0 0;
}
}
#media (max-width: 360px){
.hero {
/*background: url(img/hero-1-xsm.jpg) no-repeat;
background-size: cover;*/
}
}
#media (max-width: 320px){
.container, .container-fluid {
padding-left: 20px;
padding-right: 20px;
}
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<section class="background-white valueprop-content">
<div class="container-fluid">
<div class="center">
<div class="row">
<div class="col-lg-3 valueprop">
<img class="valueprop-icon" src="img/session-icon.png" alt="session icon" style="max-width: 100%; height: auto;" />
<h3>Explore sessions</h3>
<p>Tour Geneia’s educational sessions which include topics such as AI, machine learning and SDoH.</p>
<a class="btn btn-teal" href="explore-sessions.html" target="_blank">View sessions </a>
</div>
<hr class="d-block d-lg-none">
<div class="col-lg-3 valueprop">
<img class="valueprop-icon" src="img/meeting-icon.png" alt="meeting icon" style="max-width: 100%; height: auto;" />
<h3>Schedule a meeting</h3>
<p>Request a meeting with on-site experts to learn more about our offerings and views demos.</p>
<a class="btn btn-teal" href="mailto:geneia#geneia.com?subject=Schedule a meeting at HIMSS" target="_blank">Request a meeting</a></div>
<hr class="d-block d-lg-none">
<div class="col-lg-3 valueprop">
<img class="valueprop-icon" src="img/email-icon.png" alt="email icon" style="max-width: 100%; height: auto;" />
<h3>Connect with us</h3>
<p>Stay up-to-date on our activities, including HIMSS19</p>
<br class="d-none d-sm-block">
<a class="btn btn-teal" href="form.html" target="_blank">Sign up</a>
</div>
<hr class="d-block d-lg-none">
<div class="col-lg-3 valueprop">
<img class="valueprop-icon" src="img/find-icon.png" alt="find icon" style="max-width: 100%; height: auto;" />
<h3>Find us at HIMSS</h3>
<p>Explore our solutions and services at booth 541 in the exhibit hall.</p>
<br class="d-none d-sm-block">
<a class="btn btn-teal" href="https://himss19.mapyourshow.com/7_0/floorplan/index.cfm?hallID=S&selectedBooth=booth~541" target="_blank">Locate our booth</a>
</div>
</div>
</div>
</div>
</section>
Use Flexbox to evenly distribute the items in the div.
.col-lg-3 {
display: flex;
flex-direction: column;
justify-content: space-between;
}
I'm trying to change the way my menu looks by moving the links onto the same line as the social media icons and home button.
The links are inside a div under the main navbar class (streetworn-demos), the social media icons and homepage are floated to their respected sides in their own divs too. I've tried changing the width of the navbar class thinking it would just slot in, but it just changed the positioning of the links.
How do I make it so that the links and the
icons for each social media are on the same line, centered?
#import url(http://fonts.googleapis.com/css?family=Raleway:300,400,700);
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.clearfix:before,
.clearfix:after {
content: '';
display: table;
}
.clearfix:after {
clear: both;
}
body {
background: #333;
color: #fff;
font-size: 16px;
font-family: 'Raleway', Arial, sans-serif;
}
a {
color: #fff;
text-decoration: none;
font-weight: 700;
outline: none;
}
/* Link Colours */
.fade {
background: #333;
}
.fade a {
color: #fff;
}
a:hover,
a:focus {
color: #333;
}
.social {
float: left;
clear: none;
}
#social {
padding: 5px;
}
/* Buttons */
.Streetworn-demos {
width: 100vw;
background-color: #ff9966;
margin: 0;
text-align: center;
position: fixed;
bottom: 0;
}
.Streetworn-demos a {
text-align: center;
display: inline-block;
margin: 0.5em 0.75em;
line-height: 1;
font-family: 'Raleway', cursive;
letter-spacing: 1px;
}
.about h3 {
font-family: 'Satisfy', cursive;
font-size: 32px;
margin: 5px;
padding-top: 6px;
padding-left: 10px;
border-radius: 5px 25px 25px 5px;
background-color: #ff9966;
}
.about p {
font-family: 'Raleway', cursive;
font-weight: 700;
font-size: 16px;
padding: 10px;
margin: auto;
}
.login {
width: 100%;
margin: auto;
text-align: right;
padding: 10px;
background: #ff9966;
}
#home {
padding: 5px;
}
.homepage {
float: right;
clear: none;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden] {
display: none;
}
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
mark {
background: #ff0;
color: #000;
}
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
pre {
white-space: pre-wrap;
}
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 0;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
button,
input,
select,
textarea {
font-family: inherit;
font-size: 100%;
margin: 0;
}
button,
input {
line-height: normal;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
vertical-align: top;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
<div class="login">
<a class="loginlink" href="#">Login / Signup</a>
</div>
<nav class="Streetworn-demos">
<div class="navbar">
<a class="brands" href="#">PALACE</a>
<a class="brands" href="#">GOLFWANG</a>
<a class="brands" href="#">SUPREME</a>
<a class="brands" href="#">BILLIONAIRE'S BOYS CLUB</a>
<a class="brands" href="#">STUSSY</a>
<a class="brands" href="#">ANTISOCIAL SOCIAL CLUB</a>
</div>
<div class="homepage">
<a class="home" href="index.html"><img id="home" alt="Return to the landing page" src="https://image.ibb.co/fnApE7/home2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/bwSEgn/homeicon.png'" onmouseout="this.src='https://image.ibb.co/fnApE7/home2.png'"></a>
</div>
<div class="social">
<img id="social" alt="Follow Streetworn on Facebook!" src="https://image.ibb.co/ftLBSS/fb2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/ktUS1n/fbicon.png'" onmouseout="this.src='https://image.ibb.co/ftLBSS/fb2.png'">
<img id="social" alt="Follow Streetworn on Instagram!" src="https://image.ibb.co/fDPugn/ig2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/e5o9E7/igicon.png'" onmouseout="this.src='https://image.ibb.co/fDPugn/ig2.png'">
<img id="social" alt="Follow Streetworn on Twitter!" src="https://image.ibb.co/cK5Zgn/twitter2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/eGbJ7S/twittericon.png'" onmouseout="this.src='https://image.ibb.co/cK5Zgn/twitter2.png'">
</div>
</nav>
Any help would be massively appreciated!
Since you're using floats, the easiest thing to do would be to just reorder the homepage and social divs to come before the navbar div, so that they float out of the way first, and the navbar will occupy the space between them:
#import url(http://fonts.googleapis.com/css?family=Raleway:300,400,700);
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.clearfix:before,
.clearfix:after {
content: '';
display: table;
}
.clearfix:after {
clear: both;
}
body {
background: #333;
color: #fff;
font-size: 16px;
font-family: 'Raleway', Arial, sans-serif;
}
a {
color: #fff;
text-decoration: none;
font-weight: 700;
outline: none;
}
/* Link Colours */
.fade {
background: #333;
}
.fade a {
color: #fff;
}
a:hover,
a:focus {
color: #333;
}
.social {
float: left;
clear: none;
}
#social {
padding: 5px;
}
/* Buttons */
.Streetworn-demos {
width: 100vw;
background-color: #ff9966;
margin: 0;
text-align: center;
position: fixed;
bottom: 0;
}
.Streetworn-demos a {
text-align: center;
display: inline-block;
margin: 0.5em 0.75em;
line-height: 1;
font-family: 'Raleway', cursive;
letter-spacing: 1px;
}
.about h3 {
font-family: 'Satisfy', cursive;
font-size: 32px;
margin: 5px;
padding-top: 6px;
padding-left: 10px;
border-radius: 5px 25px 25px 5px;
background-color: #ff9966;
}
.about p {
font-family: 'Raleway', cursive;
font-weight: 700;
font-size: 16px;
padding: 10px;
margin: auto;
}
.login {
width: 100%;
margin: auto;
text-align: right;
padding: 10px;
background: #ff9966;
}
#home {
padding: 5px;
}
.homepage {
float: right;
clear: none;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden] {
display: none;
}
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
mark {
background: #ff0;
color: #000;
}
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
pre {
white-space: pre-wrap;
}
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 0;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
button,
input,
select,
textarea {
font-family: inherit;
font-size: 100%;
margin: 0;
}
button,
input {
line-height: normal;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
vertical-align: top;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
<div class="login">
<a class="loginlink" href="#">Login / Signup</a>
</div>
<nav class="Streetworn-demos">
<div class="homepage">
<a class="home" href="index.html"><img id="home" alt="Return to the landing page" src="https://image.ibb.co/fnApE7/home2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/bwSEgn/homeicon.png'" onmouseout="this.src='https://image.ibb.co/fnApE7/home2.png'"></a>
</div>
<div class="social">
<img id="social" alt="Follow Streetworn on Facebook!" src="https://image.ibb.co/ftLBSS/fb2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/ktUS1n/fbicon.png'" onmouseout="this.src='https://image.ibb.co/ftLBSS/fb2.png'">
<img id="social" alt="Follow Streetworn on Instagram!" src="https://image.ibb.co/fDPugn/ig2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/e5o9E7/igicon.png'" onmouseout="this.src='https://image.ibb.co/fDPugn/ig2.png'">
<img id="social" alt="Follow Streetworn on Twitter!" src="https://image.ibb.co/cK5Zgn/twitter2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/eGbJ7S/twittericon.png'" onmouseout="this.src='https://image.ibb.co/cK5Zgn/twitter2.png'">
</div>
<div class="navbar">
<a class="brands" href="#">PALACE</a>
<a class="brands" href="#">GOLFWANG</a>
<a class="brands" href="#">SUPREME</a>
<a class="brands" href="#">BILLIONAIRE'S BOYS CLUB</a>
<a class="brands" href="#">STUSSY</a>
<a class="brands" href="#">ANTISOCIAL SOCIAL CLUB</a>
</div>
</nav>
As a side note, remember that all your IDs must be unique
The background on this page isn't displaying and instead just shows the image i have set behind the background. Also I tried centering my table using the methods posted on other threads, but none of them worked for this specifically.
/*
Winter, Edwards, and Boyd style sheet
Filename: styles.css
Author: Justus Self
Date: 4/27/2017
Long giant project
*/
/* reset styles */
html {
font-size: 16px;
}
a, article, audio, body, div, figcaption, figure, footer, header, h1,
h2, h3, img, li, nav, p, section, source, ul, video {
border: 0;
padding: 0;
margin: 0;
}
img, video {
max-width: 100%;
height: auto;
width: auto;
}
ul {
list-style-type: none;
}
/* document-wide styles */
body {
margin: 0 auto;
font-family: Arial, Helvetica, sans-serif;
}
p {
line-height: 1.4em;
font-size: 1.3em;
}
a:link {
color: black;
}
a:visited {
color: #888;
}
/* skip navigation link */
p.skipnavigation a {
position: absolute;
left: -10000px;
}
p.skipnavigation a:focus {
color: ivory;
background-color: #34180f;
top: 0.4em;
left: auto;
right: 0.4em;
z-index: 2;
}
/* header section */
h1 {
text-align: center;
font-family: Bitter, "Times New Roman", Times, serif;
font-weight: 700;
color: ivory;
background-color: white;
font-size: 2.4em;
}
/* site navigation bar */
nav {
color: #34180f;
text-align: center;
background-color: #B8944D;
}
nav li {
margin: 0.3em 0.5em;
display: inline-block;
font-size: 1.3em;
line-height: 1.4em;
}
nav a:link {
text-decoration: none;
color: #744f42;
}
nav a:visited {
color: #744f42;
}
nav a:hover, nav a:focus {
color: ivory;
}
nav ul, nav div, nav iframe {
display: inline-block;
vertical-align: middle;
}
#AboutUs:hover {
color: ivory;
cursor: pointer;
}
#AboutUs {
color: #744f42;
}
/* main content */
article {
margin: 0 auto;
padding: 1.4em;
background: #7eccec;
background: url("images/bg.jpg");
}
article div {
max-width: 854px;
margin: 0 auto;
padding: 0 3% 1em;
background-color: ivory;
overflow: auto;
}
article div.welcome {
padding-top: 2em;
}
article div figure {
float: left;
padding-right: 2%;
padding-bottom: 2%
margin-top: 20px;
}
.container {
min-width: 600px;
max-width: 800px;
margin: 0 auto;
padding: 0 3% 0;
background-color: darkblue;
overflow: auto;
}
h2 {
padding: 0.4em;
text-align: left;
font-family: Bitter, "Times New Roman", Times, serif;
font-size: 2em;
font-weight: 700;
}
h3 {
margin: 1.4em 0 0;
font-size: 1.6em;
font-family: Bitter, "Times New Roman", Times, serif;
font-weight: 700;
clear: both;
}
h3 iframe.iframes{
border: none;
}
section p {
margin: 1em 0;
}
article figure {
max-width: 100%;
margin-left: 2em;
float: right;
}
article figcaption {
text-align: center;
}
.Bookkeeping {
clear: right;
float: left;
width: 60%;
}
.Testimonial1 {
border: 2px solid black;
background-color: white;
border-radius: 5px;
padding: 16px;
margin: 16px 0;
position: relative;
top: 6em;
}
.Testimonial{
border: 2px solid black;
background-color: white;
border-radius: 5px;
padding: 16px;
margin: 16px 0;
position: relative;
top: 6em;
}
.History {
clear: left;
float: right;
width: 47%;
}
.Olddude {
border-radius: 5px;
border: 1em solid #B8944D;
margin: 1em;
position: relative;
top: 10em;
}
.nonprofit1 {
width: 60%;
clear: left;
float: right;
}
.nonprofit {
margin: 1em;
float: left;
position: relative;
}
/* form styles */
form {
padding: 10px;
}
/* fieldsset styles */
fieldset {
margin-bottom: 0.8em;
}
fieldset fieldset {
margin-top: 1em;
padding: 0.8em;
border: 1px solid #777;
}
/* field styles */
.contactinfo input, #stay-nights, textarea {
border: 1px solid #ccc;
padding: 0.2em;
font-size: 1em;
}
select {
margin-bottom: 0.6em;
}
.contactinfo input {
position: absolute;
left: 5em;
}
.schedule input {
position: absolute;
left: 10em;
}
#nameinput, #emailinput {
width: 25em;
}
#phoneinput {
width: 12em;
}
#stay-nights {
width: 3em;
}
#submit {
border: none;
padding: 0.4em 0.6em;
background-color: #e3d5ba;
font-size: 1.25em;
border-radius: 10px;
}
/* main content table */
th, td {
border: 1px solid black;
padding: 0.5em;
}
th {
background-color: lightblue;
}
.email {
background-color: ivory;
}
.name {
background-color: pink;
}
.degree {
background-color: orange;
}
/* Main Content CSS Table */
.table {
margin: 1em 0;
font-size: 1.3em;
display: table;
}
.row {
display: table-row;
}
.row div {
padding: 0.25em 0.5em;
display: table-cell;
}
.day {
font-weight: bold;
}
/* label styles */
label {
font-size: 1em;
line-height: 1.6em;
}
.contactinfo label {
display: block;
position: relative;
margin: 0.8em 0;
}
.services label, .method label {
margin-right: 1.6em;
}
.schedule p{
width: 9.2em;
float: left;
}
.date-picker label {
position: absolute;
left: -10000px;
}
/* footer section */
footer {
padding: 0.6em;
background-color: darkblue;
color: ivory;
text-align: center;
}
.copyright {
text-align: center;
font-size: .8em;
color: white;
}
/* print styles */
#media print {
body, h1, article, footer {
color: rgb(0,0,0);
background: rgb(255,255,255);
}
body {
max-width: 100%;
}
nav {
display: none;
}
}
#page {
margin: 0.75in;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>WEB Managing Partners</title>
<!--
Winter, Edwards, and Boyd (WEB) main web page
Filename: index.html
Author: Justus Self
Date: 5/2/2017
A Giant Project that makes me really sad
-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="modernizr.custom.40753.js"></script>
<link href='http://fonts.googleapis.com/css?family=Bitter:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="styles.css">
<link rel="shortcut icon" href="images/favicon.ico">
</head>
<body>
<div class="container">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.9";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<p class="skipnavigation">Skip navigation</p>
<header>
<h1><img src="images/W.E.B.png" width="501" height="299" alt="Winter, Edwards, & Boyd"></h1>
</header>
<nav class="sitenavigation">
<ul>
<li>Home</li>
<li>About Us</li>
<li>Services</li>
<li>Contact</li>
</ul>
<ul>
<li>Managing Partners</li>
<li>Company History</li>
<li>Community Involvement</li>
</ul>
<div class="fb-like" data-href="https://facebook.com/cengagebrain"
data-layout="button" data-action="like" data-size="small" data-show-faces="true"
data-share="false">
</div>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
Tweet<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</nav>
<article id="contentstart">
<h2>Managing Partners</h2>
<h3>Our employees may be contacted using the e-mails shown below</h3>
<br>
<table>
<colgroup>
<col class="name">
<col class="email">
<col class="degree">
</colgroup>
<thead>
<tr>
<th>Employee Name</th>
<th>E-mail</th>
<th>Degree</th>
</tr>
</thead>
<tbody>
<tr>
<td>Mike Edwards</td>
<td>medwards#webcpa.com</td>
<td>Certified Public Accountant</td>
</tr>
<tr>
<td>Julia Winters</td>
<td>jwinter#webcpa.com</td>
<td>Certified Financial Planner</td>
<tr>
<td>Regina Boyd</td>
<td>rboyd#webcpa.com</td>
<td> Certified Public Accountant </td>
</tr>
</tbody>
</table>
<br>
<br>
<footer>
<nav class="sitenavigation">
<ul>
<li>Home</li>
<li>About Us</li>
<li>Services</li>
<li>Contact</li>
</ul>
</nav>
<p class="copyright">ⒸJustus Self</p>
<p class="copyright"> CIS 130 – SP16</p>
</footer>
</article>
</div>
</body>
</html>
background property needs height and (max-)width just use the values you want and you are good to go.
/*
Winter, Edwards, and Boyd style sheet
Filename: styles.css
Author: Justus Self
Date: 4/27/2017
Long giant project
*/
/* reset styles */
html {
font-size: 16px;
}
a,
article,
audio,
body,
div,
figcaption,
figure,
footer,
header,
h1,
h2,
h3,
img,
li,
nav,
p,
section,
source,
ul,
video {
border: 0;
padding: 0;
margin: 0;
}
img,
video {
max-width: 100%;
height: auto;
width: auto;
}
ul {
list-style-type: none;
}
/* document-wide styles */
body {
margin: 0 auto;
font-family: Arial, Helvetica, sans-serif;
}
p {
line-height: 1.4em;
font-size: 1.3em;
}
a:link {
color: black;
}
a:visited {
color: #888;
}
/* skip navigation link */
p.skipnavigation a {
position: absolute;
left: -10000px;
}
p.skipnavigation a:focus {
color: ivory;
background-color: #34180f;
top: 0.4em;
left: auto;
right: 0.4em;
z-index: 2;
}
/* header section */
h1 {
text-align: center;
font-family: Bitter, "Times New Roman", Times, serif;
font-weight: 700;
color: ivory;
background-color: white;
font-size: 2.4em;
}
/* TABLE CENTER*/
table { margin:auto}
/* site navigation bar */
nav {
color: #34180f;
text-align: center;
background-color: #B8944D;
}
nav li {
margin: 0.3em 0.5em;
display: inline-block;
font-size: 1.3em;
line-height: 1.4em;
}
nav a:link {
text-decoration: none;
color: #744f42;
}
nav a:visited {
color: #744f42;
}
nav a:hover,
nav a:focus {
color: ivory;
}
nav ul,
nav div,
nav iframe {
display: inline-block;
vertical-align: middle;
}
#AboutUs:hover {
color: ivory;
cursor: pointer;
}
#AboutUs {
color: #744f42;
}
/* main content */
article {
margin: 0 auto;
padding: 1.4em;
}
article div {
max-width: 854px;
margin: 0 auto;
padding: 0 3% 1em;
background-color: ivory;
overflow: auto;
}
article div.welcome {
padding-top: 2em;
}
article div figure {
float: left;
padding-right: 2%;
padding-bottom: 2% margin-top: 20px;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 0 3% 0;
background: url("http://lorempixel.com/1600/900") no-repeat 0 0 / cover;
height: 100vh;
max-width: 100%;
overflow: auto;
}
h2 {
padding: 0.4em;
text-align: left;
font-family: Bitter, "Times New Roman", Times, serif;
font-size: 2em;
font-weight: 700;
}
h3 {
margin: 1.4em 0 0;
font-size: 1.6em;
font-family: Bitter, "Times New Roman", Times, serif;
font-weight: 700;
clear: both;
}
h3 iframe.iframes {
border: none;
}
section p {
margin: 1em 0;
}
article figure {
max-width: 100%;
margin-left: 2em;
float: right;
}
article figcaption {
text-align: center;
}
.Bookkeeping {
clear: right;
float: left;
width: 60%;
}
.Testimonial1 {
border: 2px solid black;
background-color: white;
border-radius: 5px;
padding: 16px;
margin: 16px 0;
position: relative;
top: 6em;
}
.Testimonial {
border: 2px solid black;
background-color: white;
border-radius: 5px;
padding: 16px;
margin: 16px 0;
position: relative;
top: 6em;
}
.History {
clear: left;
float: right;
width: 47%;
}
.Olddude {
border-radius: 5px;
border: 1em solid #B8944D;
margin: 1em;
position: relative;
top: 10em;
}
.nonprofit1 {
width: 60%;
clear: left;
float: right;
}
.nonprofit {
margin: 1em;
float: left;
position: relative;
}
/* form styles */
form {
padding: 10px;
}
/* fieldsset styles */
fieldset {
margin-bottom: 0.8em;
}
fieldset fieldset {
margin-top: 1em;
padding: 0.8em;
border: 1px solid #777;
}
/* field styles */
.contactinfo input,
#stay-nights,
textarea {
border: 1px solid #ccc;
padding: 0.2em;
font-size: 1em;
}
select {
margin-bottom: 0.6em;
}
.contactinfo input {
position: absolute;
left: 5em;
}
.schedule input {
position: absolute;
left: 10em;
}
#nameinput,
#emailinput {
width: 25em;
}
#phoneinput {
width: 12em;
}
#stay-nights {
width: 3em;
}
#submit {
border: none;
padding: 0.4em 0.6em;
background-color: #e3d5ba;
font-size: 1.25em;
border-radius: 10px;
}
/* main content table */
th,
td {
border: 1px solid black;
padding: 0.5em;
}
th {
background-color: lightblue;
}
.email {
background-color: ivory;
}
.name {
background-color: pink;
}
.degree {
background-color: orange;
}
/* Main Content CSS Table */
.table {
margin: 1em auto;
font-size: 1.3em;
display: table;
}
.row {
display: table-row;
}
.row div {
padding: 0.25em 0.5em;
display: table-cell;
}
.day {
font-weight: bold;
}
/* label styles */
label {
font-size: 1em;
line-height: 1.6em;
}
.contactinfo label {
display: block;
position: relative;
margin: 0.8em 0;
}
.services label,
.method label {
margin-right: 1.6em;
}
.schedule p {
width: 9.2em;
float: left;
}
.date-picker label {
position: absolute;
left: -10000px;
}
/* footer section */
footer {
padding: 0.6em;
background-color: darkblue;
color: ivory;
text-align: center;
}
.copyright {
text-align: center;
font-size: .8em;
color: white;
}
/* print styles */
#media print {
body,
h1,
article,
footer {
color: rgb(0, 0, 0);
background: rgb(255, 255, 255);
}
body {
max-width: 100%;
}
nav {
display: none;
}
}
#page {
margin: 0.75in;
}
<body>
<div class="container">
<p class="skipnavigation">Skip navigation</p>
<header>
<h1>
<img src="images/W.E.B.png" width="501" height="299" alt="Winter, Edwards, & Boyd">
</h1>
</header>
<nav class="sitenavigation">
<ul>
<li>Home</li>
<li>About Us</li>
<li>Services</li>
<li>Contact</li>
</ul>
<ul>
<li>Managing Partners</li>
<li>Company History</li>
<li>Community Involvement</li>
</ul>
</nav>
<article id="contentstart">
<h2>Managing Partners</h2>
<h3>Our employees may be contacted using the e-mails shown below</h3>
<br>
<table>
<colgroup>
<col class="name">
<col class="email">
<col class="degree">
</colgroup>
<thead>
<tr>
<th>Employee Name</th>
<th>E-mail</th>
<th>Degree</th>
</tr>
</thead>
<tbody>
<tr>
<td>Mike Edwards</td>
<td>medwards#webcpa.com</td>
<td>Certified Public Accountant</td>
</tr>
<tr>
<td>Julia Winters</td>
<td>jwinter#webcpa.com</td>
<td>Certified Financial Planner</td>
<tr>
<td>Regina Boyd</td>
<td>rboyd#webcpa.com</td>
<td> Certified Public Accountant </td>
</tr>
</tbody>
</table>
<br>
<br>
<footer>
<nav class="sitenavigation">
<ul>
<li>Home</li>
<li>About Us</li>
<li>Services</li>
<li>Contact</li>
</ul>
</nav>
<p class="copyright">ⒸJustus Self</p>
<p class="copyright"> CIS 130 – SP16</p>
</footer>
</article>
</div>
So initially the top half of my black menu blocks appeared over the top of the banner, but now the top half of them are cut off underneath of the banner like this:
Here is my styles.css file:
/* Base */
* {
margin: 0;
padding: 0;
}
body {
/*background-color: #F5F4F1;*/
background-image: url('./img/bg.jpg');
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 15px;
line-height: 20px;
color: #353535;
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
}
#banner {
position: relative;
}
#banner__text-content {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
width: 100%;
text-align: center;
}
#banner__title {
font-size: 5.8rem;
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
}
h1,h2,h3,h4,h5,h6 {
margin: 30px 0;
/*font-weight: 200;*/
color: #8ca757;
}
h1 {
font-size: 35px;
}
h1 small {
font-size: 25px;
color: #666;
}
h2 + p {
margin-top: -20px;
}
h3 + p {
margin-top: -20px;
}
h2,h3,h4 {
font-size: 30px;
}
h4.error {
color: #faa722;
}
h5,h6 {
font-size: 20px;
}
p {
margin: 0 0 20px;
}
a:link, a:visited {
color: #8ca757;
}
a:hover {
color: #7a9347;
}
ul, ol {
margin: 0 0 10px 18px;
}
ul li, ol li {
margin: 0 0 15px;
}
hr {
border: none;
height: 18px;
width: 114px;
background-image: url('./img/hr.png') center center no-repeat;
margin: 20px auto;
}
small {
font-size: 12px;
}
blockquote {
background: white;
padding: 10px;
margin: 0 0 15px;
border-left: solid 4px #d1cbb8;
font-style: italic;
}
blockquote p {
margin: 5px 0 10px;
}
blockquote code {
font-style: normal;
}
code {
color: #006699;
font-weight: bold;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
}
sup {
font-size: 0.6em;
}
/* Layout */
.wrapper {
position: relative;
width: 620px;
margin: 40px auto;
padding: 40px;
background: white;
text-align: center;
}
.wrapper:before, .wrapper:after {
content: "";
position: absolute;
top: 5px;
left: -5px;
width: 100%;
height: 100%;
background: #97917e;
z-index: -1;
}
.wrapper:before {
top: 10px;
left: -10px;
background: #514933;
}
#logo {
width: 240px;
margin: 0 auto;
display: block;
}
.sandbox {
padding: 20px;
background: #f8f5f1;
text-align: left;
}
aside {
background: white;
border: dashed 2px #97917e;
padding: 10px 20px;
margin: 40px;
}
aside h3 {
font-size: 24px;
margin-top: 10px;
}
aside h6 {
margin: 15px 0 5px;
}
table {
width: 100%;
font-size: 13px;
background: white;
margin: 0 0 20px;
}
table td {
border-bottom: solid 1px #d1cbb8;
padding: 4px;
}
table th {
background: #8ca757;
color: white;
padding: 4px;
font-weight: normal;
font-size: 15px;
}
/* Global */
input {
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
}
autton, input.button {
display: inline-block;
background: #ccc;
outline: solid 2px #ccc;
border: solid 2px white;
color: white;
padding: 10px 15px;
margin: 20px 0;
text-decoration: none;
font-family: inherit;
font-size: inherit;
font-weight: bold;
cursor: pointer;
}
.button:hover, input.button:hover {
background: #bbb;
outline-color: #bbb;
}
.button.prev {
float: left;
background: #514933;
outline-color: #514933;
}
.button.prev:hover {
background: #494331;
outline-color: #494331;
}
.button.next, input.button.next {
background: #8ca757;
outline: solid 2px #8ca757;
float: right;
}
.button.next:hover, input.button.next:hover {
background: #7c9745;
}
input.button.next {
display: block;
float: none;
width: 100%;
}
.block {
display: block;
}
.cf:before,
.cf:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.cf:after {
clear: both;
}
/**
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.cf {
*zoom: 1;
}
.copyright-info h4, .copyright-info h5 {
margin: 0;
line-height: 18px;
font-size: 14px;
text-align: center;
}
.copyright-info h4 {
font-weight: bold;
}
.copyright-info {
margin: 20px 0 40px;
}
/* Final example website */
#final-example .wrapper {
width: 800px;
padding: 0;
}
#final-example .content {
padding: 20px 50px 50px;
text-align: left;
}
#final-example #nav {
margin: -27px 0 0;
}
#final-example #nav ul {
display: inline-block;
list-style: none;
text-align: left;
}
#final-example #nav ul li {
display: inline-block;
text-align: center;
margin: 0 10px;
}
#final-example #nav ul li a {
display: block;
background: #353535;
outline: solid 2px #353535;
border: solid 2px white;
color: white;
padding: 10px 15px;
text-decoration: none;
}
#final-example #nav ul li a:hover {
background: #8ca757;
outline: solid 2px #8ca757;
}
#final-example #philosophy {
text-align: center;
font-size: 18px;
line-height: 22px;
}
#final-example #footer {
font-size: 12px;
line-height: 15px;
margin: 60px 0 0 0;
}
#final-example #footer strong {
display: block;
margin: 0 0 20px;
}
#final-example .column {
display: block;
float: left;
}
#final-example .column.three {
width: 203px;
margin-right: 45px;
}
#final-example .column.last {
margin: 0;
}
#final-example small {
display: block;
text-align: center;
margin: 40px 0 0;
}
#final-example .member {
width: 203px;
float: left;
margin-right: 45px;
}
#final-example .member:last-child {
margin: 0;
}
#final-example .member img {
max-width: 100%;
}
#final-example .closed {
color: #d13916;
}
#final-example .open {
color: #67b512;
}
#menu-items ul {
list-style: none;
margin: 0;
padding: 20px 0;
text-align: center;
font-size: 18px;
}
#menu-items ul li a {
text-decoration: none;
font-weight: bold;
}
.price {
float: right;
font-size: 18px;
font-weight: bold;
color: #353535;
}
#contact {
width: 320px;
margin: 0 auto;
}
#contact-form label {
display: block;
font-size: 11px;
font-weight: bold;
text-transform: uppercase;
}
#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form textarea {
border: solid 2px #353535;
outline: none;
font-size: 18px;
padding: 10px;
margin: 0 0 10px;
width: 300px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
}
#contact-form textarea {
resize: vertical;
height: 120px;
}
#contact-form input[type="checkbox"] + label {
display: inline;
cursor: pointer;
}
When I try to do this:
#final-example #nav {
margin: -27px 0 0;
position: absolute;
}
to this
#final-example #nav {
margin: -27px 0 0;
}
this happens:
and text-align:center; did not work. Any ideas?
Here is the index.php:
<!DOCTYPE html>
<html>
<head>
<title>MicroUrb</title>
<link rel="stylesheet" href="assets/styles.css">
</head>
<body id="final-example">
<div class="wrapper">
<div id="banner">
<a href="/" title="Return to Home">
<img src="assets/img/banner0.jpg" alt="MicroUrb">
<div id="banner__text-content">
<h1 id="banner__title">MicroUrb</h1>
</div>
</a>
</div><!-- banner -->
<div id="nav">
<ul>
<li>Home</li>
<li>Team</li>
<li>Products</li>
<li>Contact</li>
</ul>
</div><!-- nav -->
<div class="content">
<div id="footer" class="cf">
<div class="column three">
<strong>Phone</strong>
609.505.3395
</div><!-- column -->
<div class="column three">
<strong>Location</strong>
<!-- location to go here -->
</div><!-- column -->
<div class="column three last">
<strong>Hours</strong>
<em>Tuesday - Thursday</em><br>
1:00pm - 9:00pm<br><br>
<em>Friday and Saturday</em><br>
4:00pm - 11:00pm<br><br>
<em>Sunday - Monday</em>
Closed<br><br>
</div><!-- column -->
</div><!-- footer -->
<small>©2017 MicroUrb</small>
</div><!-- content -->
</div><!-- wrapper -->
<div class="copyright-info">
<?php includes('../assets/includes/copyright.php'); ?>
</div><!-- copyright-info -->
</body>
</html>
Put a z-index on the nav and set the position to relative
#final-example #nav {
margin: -27px 0 0;
z-index: 5;
position: relative;
}
I believe to get the navigation in front of the banner like you are trying to achieve you could utilise the z-index property.
Add a z-index of 1 to your #final-example #nav {} and a z-index of 0 to your #banner {} which will bring the navigation in front of the banner while keeping its absolute positioning in the centre.
The final outcome will be:
#final-example #nav {
margin: -27px 0 0;
position: absolute;
z-index: 1;
}
#banner {
position: relative;
z-index: 0;
}
Let me know if you need any other help.
You can use z-index on the nav element to make it appear above the banner if you set the banner to a lower z-index compared to the nav element.
So for example:
#final-example #nav {
z-index:1;
position:relative;
margin:-27px auto 0;
}
That said, it would be useful if you would've posted your html part as well.
Edit:
Further investigation and with a temporary asset, the code seems to work fine with the code posted above as can be seen in this JSFiddle: https://jsfiddle.net/t2d70q3y/2/
Let me know if you require further assistance.
Notice how the page is centered in the middle. How can I make it expand to fit the screen, including the columns? Sorry, I'm brand new to coding. I included most of the code because I have no idea where to find it. Hopefully one of you can help. I'm assuming it must be on body or on the home page?
/* Base styles */
*, input[type=search] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
background-color: $color_2;
}
body {
color: $color_4;
font-family: $font_1;
font-size: 13px;
font-weight: lighter;
line-height: 1.5;
margin: 0;
margin-left: 0px;
padding-bottom: 100px;
}
img {
max-width: 100%;
vertical-align: middle;
}
img[width], img[height] {
max-width: none;
}
figure > img {
display: block;
}
a {
color: $color_5;
font-family: $font_2;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
ul, ol {
list-style: none;
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
text-align: left;
width: 100%;
}
[dir="rtl"] table {
text-align: right;
}
td, th {
border-color: #eeeeee;
border-style: solid;
padding: 18px;
}
th {
border-width: 1px 0;
color: #bebebe;
font-size: 11px;
font-weight: normal;
white-space: nowrap;
}
td {
border-width: 0 0 1px 0;
}
h1, h2, h3, h4, h5, h6 {
color: black;
font-weight: 400;
}
h1 {
font-size: 20px;
}
input, label {
display: inline-block;
vertical-align: middle;
}
label {
font-size: 12px;
}
input[type="checkbox"] + label {
margin-left: 5px;
}
input, textarea {
border: 1px solid #dddddd;
border-radius: 2px;
padding: 10px;
}
textarea {
height: 100px;
padding: 7px 10px;
resize: vertical;
}
textarea, input[type=text] {
width: 100%;
}
input, textarea, select {
color: #555;
}
input::-ms-clear {
display: none;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
margin: 0;
-webkit-appearance: none;
}
::-webkit-input-placeholder {
color: #cccccc;
}
:-ms-input-placeholder {
color: #cccccc;
}
::-moz-placeholder {
color: #cccccc;
}
/* Buttons */
button, [role=button], [type=button], [type=submit] {
border-radius: 4px;
border: 1px solid #dddddd;
color: $color_5;
cursor: pointer;
display: inline-block;
padding: 5px 10px;
position: relative;
vertical-align: middle;
white-space: nowrap;
}
a[role=button]:hover {
text-decoration: none;
}
input[type=submit] {
background: #444;
border-color: transparent;
color: #FFF;
padding: 10px 30px;
}
input[type=submit][disabled] {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
/* IE 8 */
opacity: 0.4;
}
button img, [role=button] img {
border-radius: 4px;
margin: 0 5px 0 0;
height: 20px;
position: relative;
top: -1px;
vertical-align: middle;
}
[dir="rtl"] button img, [dir="rtl"] [role=button] img {
margin: 0 0 0 5px;
}
/* Forms */
.form {
max-width: 505px;
}
.form-field + .form-field {
margin-top: 25px;
}
.form-field label {
display: block;
font-weight: bold;
margin-bottom: 5px;
}
.form-field input[type=checkbox] + label {
margin: 0 0 0 10px;
}
.form-field.required > label:after {
content: "*";
color: red;
margin-left: 2px;
}
.form-field p {
color: #bebebe;
font-size: 11px;
}
.form-field input[type=number], .form-field input.datepicker {
width: 150px;
}
.form form + form, .searchbox {
margin-top: 25px;
}
.searchbox-suggestions {
background-color: #fff;
border: 1px solid #eeeeee;
border-radius: 4px;
padding: 10px 20px;
}
.searchbox-suggestions li {
padding: 5px 0;
}
[data-loading="true"] input,
[data-loading="true"] textarea {
background: transparent url(/hc/assets/loader.gif) 99% 50% no-repeat;
background-size: 16px 16px;
}
.form footer {
border-top: 1px solid #eeeeee;
margin-top: 40px;
padding-top: 30px;
text-align: right;
}
.form footer a {
color: #cccccc;
cursor: pointer;
margin-right: 15px;
}
/* Navigation menus */
.nav li, .nav-bordered li, .nav-spaced li {
display: inline-block;
font-weight: bold;
}
.nav li a, .nav-bordered li a, .nav-spaced li a {
font-weight: normal;
}
.nav-bordered li + li {
border-color: #eeeeee;
border-style: solid;
border-width: 0 0 0 1px;
margin: 0 0 0 30px;
padding: 0 0 0 30px;
}
[dir="rtl"] .nav-bordered li + li {
border-width: 0 1px 0 0;
margin: 0 30px 0 0;
padding: 0 30px 0 0;
}
.nav-spaced li + li {
margin: 0 0 0 40px;
}
[dir=rtl] .nav-spaced li + li {
margin: 0 40px 0 0;
}
/* Search box */
.search-box, .sub-nav .search {
position: relative;
}
.search-box:before, .sub-nav .search:before {
content: "\1F50D";
font-family: "entypo";
font-size: 1.25em;
line-height: 0;
position: absolute;
text-align: center;
top: 50%;
width: 2.5em;
z-index: 1;
}
.search-box input, .sub-nav .search input {
line-height: 1.2em;
font-weight: lighter;
padding: .75em 2.7em;
width: 100%;
-webkit-appearance: none;
}
.search-box input[type="submit"], .sub-nav .search input[type="submit"] {
display: none;
}
/* Breadcrumbs */
.breadcrumbs li {
color: #bebebe;
display: inline-block;
font-size: 12px;
}
.breadcrumbs li + li:before {
content: ">";
margin: 0 4px;
}
.breadcrumbs li a {
color: $color_4;
}
/* Labels */
.label, .request-status {
border-radius: 20px;
display: inline-block;
font-size: 10px;
padding: 3px 10px;
text-transform: uppercase;
white-space: nowrap;
}
/* Metadata */
.meta, .meta-group {
color: #cccccc;
display: inline-block;
font-size: 11px;
}
.meta-group * + *:before {
content: "\2022";
font-size: 8px;
margin: 0 10px;
}
/* Helper classes */
.clearfix:before, .clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
/* Social share links */
.share {
white-space: nowrap;
}
.share li, .share a {
display: inline-block;
}
.share a {
height: 30px;
line-height: 30px;
overflow: hidden;
vertical-align: middle;
width: 30px;
}
.share a:before {
background: #CCC;
border-radius: 50%;
color: #FFF;
display: inline-block;
font-family: "entypo";
text-align: center;
width: 100%;
}
.share a:hover {
text-decoration: none;
}
.share-twitter:before {
content: "\F309";
}
.share-facebook:before {
content: "\F30C";
}
.share-linkedin:before {
content: "\F318";
}
.share-googleplus:before {
content: "\F30F";
}
/* Pagination */
.pagination {
margin: 20px 0;
text-align: center;
}
.pagination * {
display: inline-block;
}
.pagination li {
border: 1px solid #eeeeee;
float: left;
margin-left: -1px;
}
[dir="rtl"] .pagination li {
float: right;
}
.pagination a, .pagination span {
color: inherit;
font-size: 12px;
padding: 5px 12px;
}
.pagination-current {
background-color: #f9f9f9;
color: #bebebe;
}
.pagination-first {
border-radius: 3px 0 0 3px;
}
[dir="rtl"] .pagination-first {
border-radius: 0 3px 3px 0;
}
.pagination-last {
border-radius: 0 3px 3px 0;
}
[dir="rtl"] .pagination-last {
border-radius: 3px 0 0 3px;
}
/* Markdown styles */
.markdown {
word-wrap: break-word;
line-height: 1.7;
}
.markdown img {
max-width: 70%;
}
.markdown hr {
background-color: #eeeeee;
border: 0;
height: 1px;
}
.markdown ul, .markdown ol {
list-style-position: inside;
padding: 0 15px;
}
.markdown ul {
list-style-type: disc;
}
.markdown ol {
list-style-type: decimal;
}
.markdown pre {
background: #f9f9f9;
border: 1px solid #eeeeee;
border-radius: 3px;
padding: 10px 15px;
overflow: auto;
white-space: pre;
}
.markdown blockquote {
border-left: 1px solid #eeeeee;
color: #bebebe;
font-style: italic;
padding: 0 15px;
}
/* Frame */
main, .header-inner, .footer-inner {
margin: 0 auto;
padding: 20 20px;
width: 500px;
}
/* Columns */
.main-column, .side-column {
display: inline-block;
vertical-align: top;
}
.main-column {
width: 620px;
}
.side-column {
width: 270px;
margin-left: 45px;
}
[dir=rtl] .side-column {
margin-left: 0;
margin-right: 45px;
}
/* Header */
.header {
background: $color_1;
border-bottom: 1px solid #eeeeee;
}
.header-inner {
display: table;
height: 100px;
}
.logo, .user-nav {
display: table-cell;
vertical-align: middle;
}
.logoHD, .user-navHD {
display: table-cell;
position: left;
left: 80px;
vertical-align: middle;
}
.logo img {
max-height: 60px;
}
.logoHD img {
max-height: 60px;
}
.user-nav {
text-align: right;
}
.user-navHD {
left: center;
}
.user-nav > * {
display: inline-block;
margin: 0 0 0 25px;
}
.user-navHD > * {
display: inline-block;
margin: 0 0 0 25px;
}
[dir=rtl] .user-nav {
text-align: left;
}
[dir=rtl] .user-nav > * {
margin: 0 25px 0 0;
}
/* Home page */
.hero-unit {
display: block;
font-size: 22px;
padding: 80px 60px;
}
body.community-enabled .knowledge-base, body.community-enabled .community {
display: inline-block;
vertical-align: top;
}
body.community-enabled .knowledge-base {
width: 620px;
}
.knowledge-base, .community {
display: inline-block;
vertical-align: top;
}
.knowledge-base {
width: 100%;
}
Change
.side-column {
width: 270px;
margin-left: 45px;
}
.main-column {
width: 620px;
}
To
.side-column {
width: 0px;
margin-left: 0px;
}
.main-column {
width: 100%;
}
You have to either use percentages or use something like media queries to set certain widths of the content. An example of percentages would be:
main, .header-inner, .footer-inner {
margin: 0 auto;
width: 90%;
}
You have main set to 500px width. You need to remove that width style. Then main will take up the full width of it's parent container which is the body.
The principle behind this is that a block-level element takes up the full width of it's parent container by default. Since main is a block-level element you don't have to set 100%; it defaults to 100% automatically.
As an aside, your padding style for main is malformed. You have padding: 20 20px; you need to use units, not just numbers. So either write padding: 20px 20px; or even better just padding: 20px;
It looks like you're using fixed sizes in your CSS. For example, the lines below:
.main-column {
width: 620px;
}
.side-column {
width: 270px;
margin-left: 45px;
}
are assigning fixed width values. (By fixed, I mean using units like px, mm, in). Rather, it'd be appropriate to use relative sizes (i.e., percents usually). For larger, containing elements, I tend to use units of vw (viewport width) and vh (viewport height). Doing likewise in your CSS where appropriate should help. Also this makes it easier to optimize for other device sizes should you choose to use CSS media queries later.