Remove footer white space on the left and right side - css

I'm trying to remove the white space on the right and left side of my footer, it keeps making it when I put the code "max-width: 1200px; margin: auto;" to center the content. What other ways can I center the content and at the same time remove the white gaps on both sides?
I tried using margin-top, margin-left, margin-right, bootstrap's pull-left and pull-right, margin and padding set to 0, width:100% etc. Nothing worked.
Thanks.
My code is this:
body {
margin-left: 0;
padding: 0;
}
footer{
position: relative;
bottom: 0;
max-width: 1200px;
margin: auto;
overflow-x: hidden;
}
.footer-distributed{
background-color: #2c2c2c;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
width: 100%;
text-align: left;
font: normal 16px 'Varela Round';
padding: 20px 50px;
margin-top: 10px;
}
.footer-distributed .footer-left,
.footer-distributed .footer-center,
.footer-distributed .footer-right, .mapouter .gmap_canvas{
display: inline-block;
vertical-align: top;
}
.footer-distributed .footer-left{
width: 40%;
}
.footer-distributed h3{
color: #ffffff;
font: normal 36px 'Varela Round', cursive;
margin: 0;
}
.footer-distributed h3 span{
color: #ffffff;
}
.footer-distributed .footer-links{
color: #ffffff;
margin: 20px 0 12px;
padding: 0;
}
.footer-distributed .footer-links a{
display:inline-block;
line-height: 1.8;
text-decoration: none;
color: inherit;
}
.footer-distributed .footer-company-name{
color: #8f9296;
font-size: 14px;
font-weight: normal;
margin: 0;
}
.footer-distributed .footer-center{
width: 35%;
padding-top:18px;
}
.footer-distributed .footer-center i{
background-color: #33383b;
color: #ffffff;
font-size: 25px;
width: 38px;
height: 38px;
border-radius: 50%;
text-align: center;
line-height: 42px;
margin: 10px 15px;
vertical-align: middle;
}
.footer-distributed .footer-center i.fa-envelope{
font-size: 17px;
line-height: 38px;
}
.footer-distributed .footer-center p{
display: inline-block;
color: #ffffff;
vertical-align: middle;
margin:0;
}
.footer-distributed .footer-center p span{
display:block;
font-weight: normal;
font-size:14px;
line-height:2;
}
.footer-distributed .footer-center p a{
color: #cd2030;
text-decoration: none;
}
.footer-distributed .footer-right{
width: 20%;
padding-top:18px;
}
.footer-distributed .footer-company-about{
line-height: 20px;
color: #92999f;
font-size: 13px;
font-weight: normal;
margin: 0;
}
.footer-distributed .footer-company-about span{
display: block;
color: #ffffff;
font-size: 17px;
font-weight: normal;
margin-bottom: 20px;
}
.footer-distributed .footer-icons{
margin-top: 25px;
}
.footer-distributed .footer-icons a{
display: inline-block;
width: 35px;
height: 35px;
cursor: pointer;
background-color: #33383b;
border-radius: 2px;
font-size: 20px;
color: #ffffff;
text-align: center;
line-height: 35px;
margin-right: 3px;
margin-bottom: 5px;
}
#media (max-width: 880px) {
.footer-distributed{
font: bold 14px 'varela round';
}
.copyright-info, .credit {
width: 100%;
text-align: center;
display: block;
vertical-align: middle;
margin-left: 0px;
margin-right: 0px;
}
.footer-distributed .footer-left,
.footer-distributed .footer-center,
.footer-distributed .footer-right{
display: block;
width: 100%;
margin-bottom: 40px;
text-align: center;
}
.footer-distributed .footer-center i{
margin-left: 0;
}
.main {
line-height: normal;
font-size: auto;
}
}

Use flexbox. All the elements within your footer will automatically center within the parent.
footer {
background-color: #2c2c2c;
position: relative;
bottom: 0;
left: 0;
width: 100vw;
display: flex;
align-items: center;
justify-content: center;
}
.footer-distributed {
padding: 1em;
display: flex;
align-items: flex-start;
justify-content: center;
max-width: 1200px;
width: 100%;
}

Related

Mkdocs with material theme: extra css not working on mobile devices

I'm using Mkdocs with material theme for products documentation on my company. I'd made some customize on the original theme using the extra.css file.
When people navigate on my site on web browser it's working ok.
When they navigate on mobile devices, the extra.css is not working, or having a very strange behavior.
On the images of mobile devices, the left side is when I open the menu. The right side is when I click in a link in the menu.
Here is my extra.css file.
.md-header__button.md-logo :-webkit-any(img,svg) {
display: block;
width: auto;
height: 2rem;
fill: currentColor;
}
.md-nav--primary {
font-size: .75rem;
line-height: 1.5;
background-color: #0000cc;
border-color: #eee;
border-width: thin;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
padding-top: .6rem;
padding-bottom: .6rem;
}
.md-header {
background-color: #0000cc;
}
input.md-search__input {
width: 100%;
height: 1.8rem;
padding-left: 2.2rem;
font-size: .8rem;
opacity: 1;
background-color: rgba(0,0,0,1);
border-radius: 16px;
text-align: left;
letter-spacing: 0px;
color: #ffffff;
opacity: 1;
}
.md-search__input:hover {
background-color: rgba(0,0,0,1);
}
.md-search-result__teaser {
display: -webkit-box;
max-height: 2rem;
color: #00348b;
margin: .5em 0;
overflow: hidden;
font-size: .64rem;
line-height: 1.6;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
[data-md-toggle=search]:checked~.md-header .md-search__input {
text-overflow: clip;
background-color: var(--md-default-bg-color);
border-radius: .1rem .1rem 0 0;
color: #00348b;
}
.md-search-result__meta {
padding: 0 .8rem;
color: #00348b;
font-size: .64rem;
line-height: 1.8rem;
scroll-snap-align: start;
}
.md-nav--primary, .md-nav--secondary {
font-size: .75rem;
line-height: 1.5;
background-color: #eee;
-moz-border-radius: 8px;
border-radius: 8px;
padding-top: .6rem;
padding-bottom: .6rem;
background: #00348B 0% 0% no-repeat padding-box;
}
.md-nav__title {
display: block;
padding: 0 .6rem;
overflow: hidden;
font-weight: 700;
text-overflow: ellipsis;
color: #ffffff;
}
.md-nav__item .md-nav__link--active {
text-align: left;
font: normal normal normal 14px/18px Open Sans;
letter-spacing: 0.35px;
color: #FFFFFF;
opacity: 1;
}
.md-nav__item--nested>.md-nav__link {
color: #FFFFFF;
}
.md-nav__link {
display: block;
margin-top: .625em;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
transition: color 125ms;
scroll-snap-align: start;
text-align: left;
letter-spacing: 0.33px;
color: #FFFFFF;
opacity: 1;
}
.md-nav__link[data-md-state=blur] {
color: #d5d5d5;
}
.md-footer {
color: #FFFFFF;
background : #00348B 0% 0% no-repeat padding-box;
}
.md-float-right {
height: 100%;
margin: 430px 0 0 650px;
display: inline-block;
align-items: flex-end;
position: fixed;
}
p {
display: block;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
text-align: justify;
}

Multiple Identical RGBA colours not working

basically I wanted to try have the same rgba value in three different areas. I wanted my body, nav and footer all to have rgba(0,0,0,.8).
My body works but the nav and footer just show was solid black without the transparency...
I've tried changing the transparency slightly so they're different but that doesn't work either.
Are you only allowed to use it once?
Joe
#font-face {
font-family: 'telegraficoregular';
src: url('../FONTS/telegrafico-webfont.eot');
src: url('../FONTS/telegrafico-webfont.eot?#iefix') format('embedded-opentype'),
url('../FONTS/telegrafico-webfont.woff2') format('woff2'),
url('../FONTS/telegrafico-webfont.woff') format('woff'),
url('../FONTS/telegrafico-webfont.ttf') format('truetype'),
url('../FONTS/telegrafico-webfont.svg#telegraficoregular') format('svg');
font-weight: normal;
font-style: normal;
}
.cf:after {
content: "";
display: table;
clear: both;
}
html, body, head, nav, article, aside, section, h3, h4, footer, ul, li {
margin: 0;
padding: 0;
}
/*Global Styles*/
html {
margin: 0;
padding: 0;
}
body {
width: 100%;
margin: 0 auto;
padding: 0;
background:rgba(0,0,0,.9);
font-family: serif, arial, helvetica, georgia;
font-size: 16px;
}
h1 {
font-family: telegraficoregular;
font-size: 3em;
color: rgb(50,153,187);
padding: 0;
margin:0;
text-align: center;
}
h2 {
font-family: telegraficoregular;
font-size: 1em;
font-style: italic;
color: #003366;
padding: 0;
margin: 0;
text-align: center;
}
p {
font-family: serif;
font-size: 1.1em;
color: black;
text-align:left;
padding-left:70px;
}
h4 + p {
font-family: serif;
font-size: 1.1em;
color: black;
text-align:left;
padding-left:70px;
padding-top: 10px;
}
/*Nav Styles */
header {
background:rgb(233,233,233);
width: 100%;
height: 160px;
margin:0 auto;
}
nav {
background:rgba(0,0,0,.8);
width: auto;
height: 64px;
}
nav ul.TopMenu li {
float: left;
list-style: none;
width: 150px;
}
nav ul.TopMenu {
width: 600px;
margin: 0 auto;
}
nav ul.TopMenu li a {
display:block;
line-height: 64px;
padding:0 2em;
text-align: center;
font-family: telegraficoregular;
font-size: 1.2em;
text-decoration: none;
}
li {
position: relative;
}
nav ul.SubMenu{
float: none;
text-align: center;
border-bottom: 1px solid white;
position: absolute;
left: -9000em;
top: 64px;
height: auto;
max-height: 0;
-moz-transition: max-height 0.5s ease-in-out;
-webkit-transition: max-height 0.5s ease-in-out;
-o-transition: max-height 0.5s ease-in-out;
transition: max-height 0.5s ease-in-out;
overflow:hidden;
z-index:999;
}
nav ul.SubMenu li{
height: 32px;
font-family: telegraficoregular;
font-size: 1em;
padding: 0;
margin: 0;
border-bottom: 1px solid white;
}
nav ul.SubMenu li a{
display:block;
line-height: 32px;
padding: 0px;
margin: 0;
}
.TopMenu li:hover ul{
left: 0;
max-height: 20em;
}
ul.SubMenu li a{
background: rgba(0,0,0,.8);
border-bottom: 1px solid white;
}
ul.SubMenu li a:visited {
color: white;
}
ul.SubMenu li a:hover {
background: rgba(255,165,0,.8);
}
a:visited {
color: white;
}
a:hover {
color: orange;
}
/* Article Styles */
article {
width: 896px;
padding: 32px;
}
/*Section Styles */
section.China {
text-align: center;
margin: 20px auto;
padding: 20px;
}
section h3 {
font-family: telegraficoregular;
font-size: 2em;
border-bottom: 1px solid black;
padding: 5px;
}
section h4 {
font-family: telegraficoregular;
font-size: 1.4em;
padding-top: 60px;
padding-left: 70px;
text-align: left;
text-decoration: underline;
}
section.China img {
position: relative;
top: 20px;
border-radius: 5px;
}
section.Australia {
text-align: center;
margin: 20px auto;
padding: 20px;
}
section.Australia img {
position: relative;
top: 20px;
border-radius: 5px;
}
section.Thailand {
text-align: center;
margin: 20px auto;
padding: 20px;
}
section.Thailand img {
position: relative;
top: 20px;
border-radius: 5px;
}
/* Link Styles*/
/* About Styles */
#AboutContent{
width: 960px;
height: 1200px;
margin: 0 auto;
padding: 0;
background: white;
font-family: serif, arial, helvetica, georgia;
font-size: 16px;
color: black;
}
#AboutHeader {
text-align: center;
margin: 20px auto;
padding: 20px;
}
#AboutHeader img {
display: block;
margin: 0 auto;
text-align: center;
}
#AboutHeader h2 {
font-family: telegraficoregular;
font-size: 1.5em;
text-decoration: underline;
color: black;
padding: 0;
margin-top: 20px;
text-align: center;
}
h2 + img {
position: relative;
top: 50px;
border-radius: 5px;
}
#AboutHeader p {
font-family: serif;
font-size: 1.1em;
color: black;
text-align:left;
padding:50px 0 0 100px;
}
/*Photos Content */
#PhotoContent{
width: 960px;
height:auto;
margin: 0 auto;
padding: 0;
background: white;
font-family: serif, arial, helvetica, georgia;
font-size: 16px;
color: black;
}
/* Photos Gallery */
#ChinaPhotos {
width: 960px;
height:1200px;
margin: 0 auto;
padding: 0;
background: white;
font-family: serif, arial, helvetica, georgia;
font-size: 16px;
color: black;
}
#ChinaPhotos h3 {
font-family: telegraficoregular;
font-size: 2em;
border-bottom: 1px solid black;
padding: 5px;
text-align: center;
margin-top: 20px;
}
#ChinaPhotos img {
margin-top: 20px;
border: 1px solid black;
}
#ChinaPhotos a .Thumb:hover {
width: 320px;
height: 240px;
}
/* Container Styles */
#Content {
width: 960px;
height: auto;
margin: 0 auto;
padding: 0;
background: white;
font-family: serif, arial, helvetica, georgia;
font-size: 16px;
color: black;
}
/* Footer Styles */
.Footer {
width: 100%;
height: 80px;
background: rgba(0,0,0,.7);
}
.Footer p {
font-family: telegraficoregular;
color: white;
font-style: italic;
line-height: 80px;
text-align: center;
}
So, it looks as though it's the overlap that is causing your problems (see comment above. I changed the background colours in the nav and footer and they show up just find.
It's the fact that you have two elements with 80% opacity overlapped, and the outcome looks black.
html, body, head, nav, article, aside, section, h3, h4, footer, ul, li {
margin: 0;
padding: 0;
}
/*Global Styles*/
html {
margin: 0;
padding: 0;
}
body {
width: 100%;
margin: 0 auto;
padding: 0;
background:rgba(0,0,0,.9);
font-family: serif, arial, helvetica, georgia;
font-size: 16px;
}
h1 {
font-family: telegraficoregular;
font-size: 3em;
color: rgb(50,153,187);
padding: 0;
margin:0;
text-align: center;
}
h2 {
font-family: telegraficoregular;
font-size: 1em;
font-style: italic;
color: #003366;
padding: 0;
margin: 0;
text-align: center;
}
p {
font-family: serif;
font-size: 1.1em;
color: black;
text-align:left;
padding-left:70px;
}
h4 + p {
font-family: serif;
font-size: 1.1em;
color: black;
text-align:left;
padding-left:70px;
padding-top: 10px;
}
/*Nav Styles */
header {
background:rgb(233,233,233);
width: 100%;
height: 160px;
margin:0 auto;
}
nav {
background:rgba(255,0,0,.8);
width: auto;
height: 64px;
}
nav ul.TopMenu li {
float: left;
list-style: none;
width: 150px;
}
nav ul.TopMenu {
width: 600px;
margin: 0 auto;
}
nav ul.TopMenu li a {
display:block;
line-height: 64px;
padding:0 2em;
text-align: center;
font-family: telegraficoregular;
font-size: 1.2em;
text-decoration: none;
}
li {
position: relative;
}
nav ul.SubMenu{
float: none;
text-align: center;
border-bottom: 1px solid white;
position: absolute;
left: -9000em;
top: 64px;
height: auto;
max-height: 0;
-moz-transition: max-height 0.5s ease-in-out;
-webkit-transition: max-height 0.5s ease-in-out;
-o-transition: max-height 0.5s ease-in-out;
transition: max-height 0.5s ease-in-out;
overflow:hidden;
z-index:999;
}
nav ul.SubMenu li{
height: 32px;
font-family: telegraficoregular;
font-size: 1em;
padding: 0;
margin: 0;
border-bottom: 1px solid white;
}
nav ul.SubMenu li a{
display:block;
line-height: 32px;
padding: 0px;
margin: 0;
}
.TopMenu li:hover ul{
left: 0;
max-height: 20em;
}
ul.SubMenu li a{
background: rgba(0,0,0,.8);
border-bottom: 1px solid white;
}
ul.SubMenu li a:visited {
color: white;
}
ul.SubMenu li a:hover {
background: rgba(255,165,0,.8);
}
a:visited {
color: white;
}
a:hover {
color: orange;
}
/* Article Styles */
article {
width: 896px;
padding: 32px;
}
/*Section Styles */
section.China {
text-align: center;
margin: 20px auto;
padding: 20px;
}
section h3 {
font-family: telegraficoregular;
font-size: 2em;
border-bottom: 1px solid black;
padding: 5px;
}
section h4 {
font-family: telegraficoregular;
font-size: 1.4em;
padding-top: 60px;
padding-left: 70px;
text-align: left;
text-decoration: underline;
}
section.China img {
position: relative;
top: 20px;
border-radius: 5px;
}
section.Australia {
text-align: center;
margin: 20px auto;
padding: 20px;
}
section.Australia img {
position: relative;
top: 20px;
border-radius: 5px;
}
section.Thailand {
text-align: center;
margin: 20px auto;
padding: 20px;
}
section.Thailand img {
position: relative;
top: 20px;
border-radius: 5px;
}
/* Link Styles*/
/* About Styles */
#AboutContent{
width: 960px;
height: 1200px;
margin: 0 auto;
padding: 0;
background: white;
font-family: serif, arial, helvetica, georgia;
font-size: 16px;
color: black;
}
#AboutHeader {
text-align: center;
margin: 20px auto;
padding: 20px;
}
#AboutHeader img {
display: block;
margin: 0 auto;
text-align: center;
}
#AboutHeader h2 {
font-family: telegraficoregular;
font-size: 1.5em;
text-decoration: underline;
color: black;
padding: 0;
margin-top: 20px;
text-align: center;
}
h2 + img {
position: relative;
top: 50px;
border-radius: 5px;
}
#AboutHeader p {
font-family: serif;
font-size: 1.1em;
color: black;
text-align:left;
padding:50px 0 0 100px;
}
/*Photos Content */
#PhotoContent{
width: 960px;
height:auto;
margin: 0 auto;
padding: 0;
background: white;
font-family: serif, arial, helvetica, georgia;
font-size: 16px;
color: black;
}
/* Photos Gallery */
#ChinaPhotos {
width: 960px;
height:1200px;
margin: 0 auto;
padding: 0;
background: white;
font-family: serif, arial, helvetica, georgia;
font-size: 16px;
color: black;
}
#ChinaPhotos h3 {
font-family: telegraficoregular;
font-size: 2em;
border-bottom: 1px solid black;
padding: 5px;
text-align: center;
margin-top: 20px;
}
#ChinaPhotos img {
margin-top: 20px;
border: 1px solid black;
}
#ChinaPhotos a .Thumb:hover {
width: 320px;
height: 240px;
}
/* Container Styles */
#Content {
width: 960px;
height: auto;
margin: 0 auto;
padding: 0;
background: white;
font-family: serif, arial, helvetica, georgia;
font-size: 16px;
color: black;
}
/* Footer Styles */
.Footer {
width: 100%;
height: 80px;
background: rgba(0,0,255,.5);
}
.Footer p {
font-family: telegraficoregular;
color: white;
font-style: italic;
line-height: 80px;
text-align: center;
}
<nav>
<ul>
<li>something</li>
<li>something else</li>
</ul>
</nav>
<footer class="Footer">
This is a footer
</footer>

My links shift to the left when clicked

I'm designing a website and having a problem with my links. When I click on them they shift to the left. Sometimes this prevents them from actually being clickable. I have not been able to find a single solution through googling and have no idea what part of my code is causing this. Any help would be appreciated.
Website
body {
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
color: #151515;
font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: #F9F9F9;
font-style: normal;
font-variant: normal;
font-weight: lighter;
font-size: small;
list-style-type: none;
text-align: center;
}
#header {
background-color: #171717;
float: left;
text-align: center;
height: 75px;
width: 100%;
}
#header1 {
padding-top: 21px;
background-color: #171717;
width: 20%;
float: left;
text-align: center;
}
#header2 {
background-color: #171717;
float: left;
text-align: center;
width: 20%;
padding-top: 33px;
font-size: 11px;
}
#header2 ul {
list-style-type: none;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
padding-left: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
background-color: undefined;
font-size: small;
}
#header2 a {
width: 20%;
display: block;
float: left;
text-align: center;
font-size: 11px;
font-weight: bold;
text-decoration: none;
color: #CCCCCC;
}
#header2 a:hover , a:active, a:focus{
text-decoration: none;
color: #ffffff;
float: left;
}
#header3 {
float: left;
width: 20%;
text-align: center;
font-size: 11px;
padding-top: 23px;
font-weight: bold;
-webkit-box-shadow: 0px 0px;
box-shadow: 0px 0px;
}
#search {
width: 15%;
}
#search input[type="text"] {
background-repeat: no-repeat;
background-position: 10px 6px;
background-image: url(https://gray.secure-host.com/thefilterconnection/shopsite_sc/store/html/media/search-dark.png);
background-color: #909090;
border: 0 none;
font: bold 12px Arial,Helvetica,Sans-serif;
color: #CCCCCC;
padding-top: 6px;
padding-bottom: 6px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
-webkit-transition: all 0.7s ease 0s;
-moz-transition: all 0.7s ease 0s;
-o-transition: all 0.7s ease 0s;
transition: all 0.7s ease 0s;
padding-left: 35px;
}
#header4 {
width: 20%;
text-align: center;
float: left;
padding-top: 16px;
font-size: 11px;
font-weight: bold;
color: #CCCCCC;
}
#header5 {
width: 20%;
background-color: #171717;
text-align: center;
padding-top: 13px;
font-size: 11px;
font-weight: bold;
float: left;
color: #CCCCCC;
}
#productmenucontainer {
background-color: #171717;
width: 100%;
clear: both;
float: center;
height: 30px;
}
#productmenu {
width: 100%;
background-color: #171717;
padding-top: 3px;
text-align: center;
right: auto;
left: auto;
max-width: 100%;
}
#container1 {
float: left;
width: 100%;
background-color: #EBEBEB;
position: relative;
right: 75%;
}
#container2 {
float: left;
width: 100%;
background-color: #FFFFFF;
overflow: hidden;
position: relative;
}
#container3 {
min-width: 740px;
max-width: 1000px;
margin-left: auto;
margin-right: auto;
clear: left;
float: none;
display: inline-block;
-webkit-box-shadow: 1px 1px 5px 1px #DBDBDB;
box-shadow: 1px 1px 5px 1px #DBDBDB;
width: 100%;
}
#sidebar1 {
float: left;
width: 17%;
position: relative;
left: 75%;
padding-left: 4%;
padding-top: 2%;
text-align: left;
padding-bottom: 2%;
padding-right: 4%;
}
#sidebar1 ul {
list-style-type: none;
margin-left: -25px;
margin-top: 2px;
float: left;
width: 100%;
text-align: left;
}
#main {
float: left;
width: 64%;
position: relative;
left: 75%;
padding-left: 4%;
padding-top: 2%;
padding-bottom: 2%;
padding-right: 4%;
}
#footer {
background-color: #F9F9F9;
font-weight: lighter;
padding-top: 4px;
font-size: 11px;
text-align: center;
clear: left;
padding-bottom: 4px;
color: #6C6C6C;
min-width: 740px;
max-width: 1000px;
width: 100%;
margin-right: auto;
margin-left: auto;
position: relative;
display: inline-block;
}
#disclaimer {
text-align: center;
float: left;
width: 23%;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 1%;
padding-right: 1%;
}
#creditcards {
width: 35%;
float: left;
padding-top: 5px;
}
#share {
width: 20%;
text-align: center;
float: left;
padding-top: 5px;
}
#follow {
float: left;
padding-top: 5px;
width: 20%;
}
#copyright {
clear: left;
float: left;
text-align: center;
padding-top: 5px;
width: 100%;
background-color: #626262;
color: #F3F3F3;
font-size: x-small;
font-weight: bold;
font-style: italic;
}
a:link {
color: #575757;
text-decoration: none;
font-weight: bold;
font-size: small;
}
a:visited {
color: #6C6C6C;
}
a:hover, a:active, a:focus {
text-decoration: none;
color: #7F7F7F;
}
.menu {
background-color: #B1CCE0;
text-align: center;
width: 100%;
min-width: 740px;
max-width: 1000px;
left: auto;
right: auto;
float: left;
margin-left: auto;
margin-right: auto;
}
.menu > span {
display:inline-block;
margin:0 auto;
}
#nav {
display: inline;
text-align: left;
position: relative;
list-style-type: none;
z-index: 1000;
}
#nav > li {
float: left;
padding: 0;
position: relative;
color: #6C6C6C;
}
#nav > li > a {
border: 1px solid transparent;
color: #CCCCCC;
display: block;
font-size: small;
padding: 3px 10px;
position: relative;
text-decoration: none;
font-weight: bolder;
-webkit-box-shadow: 0px 0;
box-shadow: 0px 0;
text-shadow: 0px 0;
}
#nav > li > a:hover {
background-color: #e4ecf4;
border-color: #999;
}
#nav > li.selected > a {
background-color: #171717;
border-color: #999999 #999999 #FFFFFF;
z-index: 2;
}
#nav li div {
position:relative;
}
#nav li div div {
background-color: #FFFFFF;
border: 1px solid #999999;
padding: 12px 0;
display: none;
margin: 0;
position: absolute;
top: -1px;
z-index: 1;
width: 190px;
}
#nav li div div.wrp2 {
width: 380px;
background-color: #171717;
}
#nav .sep {
left:190px;
border-left:1px solid #E3E3E3;
bottom:0;
height:auto;
margin:15px 0;
position:absolute;
top:0;
width:1px;
}
#nav li div ul {
padding-left: 10px;
padding-right: 10px;
position: relative;
width: 170px;
float: left;
list-style-type: none;
background-color: #171717;
}
#nav li div ul li {
margin:0;
padding:0;
}
#nav li div ul li h3 {
border-bottom: 1px solid #E3E3E3;
color: #4F87C5;
font-weight: bold;
margin: 0 5px 4px;
padding-bottom: 3px;
padding-top: 3px;
font-size: small;
}
#nav li div ul li h3 a {
color: #4F87C5;
font-weight: bold;
font-size: small;
}
#nav li div ul li h3 a:hover {
color: #89B3E1;
font-weight: bold;
font-size: small;
}
#nav li ul ul {
padding-top: 0;
padding-right: 0;
padding-left: 0;
padding-bottom: 0;
bottom: 8px;
}
#nav li ul ul li {
margin-bottom: 1px;
padding-top: 3px;
padding-right: 5px;
padding-left: 5px;
padding-bottom: 3px;
}
#nav li ul ul li a {
color: #CCCCCC;
display: block;
text-decoration: none;
font-size: 10px;
font-weight: bold;
}
#nav li ul ul li a:hover{
background-color: #171717;
color: #ffffff;
}
#header2 a:hover , a:active, a:focus{
text-decoration: none;
color: #ffffff;
**float: left;**
}
This is the part I'm most suspicious of. What happens without the float: left - or, if you apply it to those links in their original CSS rule, not the :active one?
You have an issue in your css file demopage.css on line 61, you need to remove a:active and a:focus from that declaration. Basically on every click on all a tags on your page they get a float: left value. So if you remove them from it everything will work perfectly :)
I have tested it on your site and it works :)
So from this
#header2 a:hover, a:active, a:focus {
text-decoration: none;
color: #ffffff;
float: left;
}
to this
#header2 a:hover {
text-decoration: none;
color: #ffffff;
float: left;
}

CSS Navigation Bar Center

<head>
<title>WCK&TMB</title>
<style>
* {
margin: 0px;
padding: 0px;
}
html, body {
width: 100%;
background-color: #FFC18F;
}
div#container {
width: 100%;
min-width: 1024px;
}
header {
height: 100px;
width: 100%;
background-color: #ff8400;
text-align: center;
}
header img {
clear: left;
float: left;
margin: 10px;
}
header a#purchase {
background: url("http://i.imgur.com/RJe8a1D.png") repeat-x;
width: 500px;
height: 25px;
margin: 30px;
padding: 5px;
border: 3px double #ccc;
text-align: center;
float: right;
font-family: Arial;
font-size: 20px;
text-decoration: none;
color: #ffffff;
}
section#main {
padding: 0px 0px 10px 0px;
text-align: center;
}
section#main div#head_announcements {
padding-top: 10px;
color: #000;
font-family: "Arial";
}
section#main div#head_announcements h2 {
font-size: 24px;
font-weight: lighter;
line-height: 26px;
}
section#main h2 a {
color: #FFFFFF;
text-decoration: none;
}
section#main h2 a:hover {
color: #000000;
}
section#main nav {
background: url("./images/navBG.png") repeat-x;
width: 100%;
height: 35px;
text-align: center;
}
section#main nav a.link {
font-family: "Century Gothic";
text-decoration: none;
color: white;
font-size: 25px;
vertical-align: top;
float:center;
}
section#main nav a.link:nth-of-type(1) {
float:center;
}
section#main nav a.link:hover {
color: #39F;
}
section#main nav a.link.active {
color: #39F;
}
section#main section#frames {
margin-top: 10px;
width: 100%;
}
section#main section#frames iframe {
border: 0px;
outline: 0px;
overflow: hidden;
margin: 0px;
padding: 0px;
}
section#main section#frames iframe#frame1 {
width: 650px;
height: 450px;
background-color: black;
}
section#main section#frames iframe#frame2 {
width: 350px;
height: 450px;
}
footer {
padding: 10px 0px 10px 0px;
width: 100%;
text-align: center;
height: 110px;
}
</style>
</head>
URL: http://skyaccess.se/forum/misc.php?page=hdppvs
I can't seem to center the navigation bar text. Can someone please correct this?
Also, I'm trying to learn CSS so if anyone could show me a great site, I'd be very thankful. Considering paying $29/mo are some interaction website with points.
add float:left in your css:
section#main nav {
background: url("./images/navBG.png") repeat-x;
width: 100%;
height: 35px;
text-align: center;
float: left;
also add this css for create gaping between navigation: "padding-right: 40px;".
section#main nav a.link {
font-family: "Century Gothic";
text-decoration: none;
color: white;
font-size: 25px;
vertical-align: top;
float: center;
padding-right: 40px;

mobile browser not allowing scrolling

I just tested my new site with my android phone and I am not able to scroll anywhere on the page. On Firefox, opera, ie, and chrome desktop browsers I get vertical scroll when needed. In my html, body css rule I've got overflow-y to scroll; Width should not be scrolled. I'm probably missing something simple here but I've never come across this in any other sites I've done.
Here's my css for the site:
#charset "utf-8";
/* CSS Document */
#body{
min-width: 900px;
width: 75%;
background-size: cover;
background-image: url(../graphics/back2.jpg);
position: relative;
margin: 40px auto;
padding: 10px;
border-style: groove;
border-width: 5px;
border-color: #000;
background-repeat: repeat-y;
}
a:link, a:visited, a:active{
text-decoration: none;
color: inherit;
}
a:hover{
color: #FFF;
text-decoration: underline;
}
html, body{
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow-y: scroll;
background-image: url(../graphics/craig-smith-background.jpg);
line-height: 25px;
}
h1{
font-size: 36px;
font-family: "Times New Roman", Times, serif;
color: #000;
margin: 10px;
}
h2{
font-size: 30px;
font-family:"Times New Roman", Times, serif;
margin-left: 30px;
color: #333;
font-weight: 700;
margin: 20px;
}
h3{
font-size: 24px;
margin: 10px;
}
p{
font-size: 20px;
font-family: "Times New Roman", Times, serif;
color: #FFF;
text-indent: 1.5em;
margin-left: 1.5em;
}
#quote{
margin-left: 30px;
font-style: italic;
font-family: lucida;
font-size: 18px;
border-style: inset;
border-color: #333;
border-width: 2px;
height: 80px;
}
#header{
width: auto;
margin: 0 auto;
position: relative;
text-align: center;
}
#nav{
position: absolute;
z-index: 1;
left: 25%;
top: 150px;
}
.picture{
display: inline-block;
position: relative;
margin: 0 auto;
border-style: groove;
border-width: 5px;
border-color: #999;
}
.clear-left{
clear: left;
position: relative;
}
.clear-right{
clear: right;
position: relative;
}
.clear-all{
clear: both;
position: relative;
}
#left-col{
width: 25%;
min-width: 300px;
position: relative;
float: left;
text-wrap: normal;
overflow: hidden;
margin-bottom: 10px;
margin-top: 10px;
text-align: right;
}
#right-col{
min-height: 500px;
min-width: 500px;
width: 65%;
text-align: left;
float: right;
border-style: groove;
border-width: 5px;
border-color: #CCC;
margin-bottom: 10px;
margin-top: 10px;
text-wrap: normal;
text-indent: 10px;
}
#footer{
width: 85%;
height: 40px;
background-color: #999;
text-align: center;
margin: 10px auto;
padding: 0px;
padding-bottom: 10px;
border-style: groove;
border-width: 2px;
border-color: #999;
}
#project-description h1{
text-align: center;
font-size: 36px;
}
.project-description h2{
color: #333;
font-weight: bold;
}
.project-description{
border-style: inset;
border-width: 3px;
border-color: #333;
margin: 10px;
padding: 5px;
}
.project-description p{
margin-left: 70px;
text-indent: 0;
}
table{
border-spacing: 0;
border-collapse: collapse;
}
td, th, tr{
padding: 0;
line-height: 20px;
}
And here's a link the live site.
You don't need to give the body and html tags the overflow-y: scroll; style. That is resulting in a double scrollbar which is failing in mobile browsers. You don't even need to specify that as it is default behavior. You may want to set overflow-y: scroll; and overflow-x: hidden; on the body tag only.

Resources