I am using a joomla template with a built-in dropdown menu wich doesn't have many options.
This is how i want my menu to look like:
http://i.stack.imgur.com/GMdIc.png
I tried many tricks like making 2-3 or 4 columns but if a "continent" has less countries to be shown then the next item appears in the same continent. How do i make it to be like a table from the 1st image? Thanks
This is the css code in my menu: http://jsfiddle.net/AUCGy/
.gf-menu {
// Menu positioning margin: 0px auto 0;
list-style: none;
// Clears &:after {
display: table;
content:'';
clear: both;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
hover {
background:#000;
}
// Basic font stuff .item {
font-size: #menuFontSize;
line-height: #menuLineHeight;
color: #000000;
padding: 10px 15px;
text-align: left;
text-shadow: 1px 1px 0 #menuTextShadow;
text-decoration: none;
display: block;
outline1: 0;
cursor: pointer;
.transition(background 0.2s ease-out, border 0.2s ease-out);
// Subtext styling &.subtext {
> em {
bottom: -42px;
height: 42px;
font-size: #menuFontSize + 2;
color: #000000;
font-style: normal;
}
}
// Menu icon tweaks &.icon {
[class^="icon-"], [class*=" icon-"] {
background-image: none !important;
width: auto;
&:before {
text-indent: 0;
margin-right: 5px;
}
}
}
// Menu Image tweaks .menu-image {
max-width: inherit;
vertical-align: text-top;
margin-top: 0px;
margin-left: -2px;
}
}
// Level 1 Style Overrides &.l1 {
> li.active {
}
> li > .item {
font-size: #menuFontSize + 3;
line-height: #menuLineHeight + 2;
padding-top: 30px;
padding-bottom: 30px;
padding-left: 1px;
padding-right: 1px;
position: relative;
&.subtext {
padding-top:1px;
padding-bottom: 4px;
}
.menu-image {
margin-top: -1px;
}
}
}
// Default items li {
float: left;
display: block;
text-align: center;
position: relative;
padding: 0;
border: none;
border: none;
margin-right: 10px;
}
// Parent items li.parent {
> .item {
position: relative;
&:after {
color: #menuArrowColor;
position: absolute;
right: 6px;
top: 50%;
margin-top: -12px;
font-family: FontAwesome;
// content:"\f0d7";
// icon-caret-down content: none;
// icon-chevron-down font-size: 25px;
}
}
}
// Dropdown styling .dropdown {
margin: 0 auto;
margin-left: 1px;
padding: 0px 0;
position: absolute;
opacity: 0;
left: -999em;
text-align: left;
border: none;
background: #FAEFAA;
.transition(opacity 0.2s ease-out);
.border-radius(0 !important);
.box-shadow(#menuFullShadow);
z-index: 1000;
.flyout {
display: block;
}
ul {
li {
display:block;
float:none;
font-size: 20px;
margin-right: 0;
padding: 0 0px;
border: 0;
border-bottom: 1px solid #menuDropdownborderbottom;
&.active {
> .item {
color: #menuTextHover;
background:#fff url(templates/insightfx/images/icons/afri.png) no-repeat 0 -20px;
}
}
.item {
color: #000000 !important;
text-shadow1: 1px 1px 0 #menuTextShadow1 !important;
font-size: 12px;
}
&.parent {
> .item:after {
margin-top: -10px;
font-family: FontAwesome;
// content:"\f0da";
// icon-caret-right content:"\f054";
// icon-chevron-right font-size: 25px;
}
}
}
}
// Grouped styling .grouped {
&.parent {
> .item {
.border-fixer {
display:none;
}
&:after {
font-family: FontAwesome;
// content:"\f0d7";
// icon-caret-down content:"\f078";
// icon-chevron-down font-size: 11px;
}
}
}
ol {
background: #menuActiveBack;
border: 1px solid #menuActiveBorder;
.box-shadow(#menuActiveShadow);
margin: 0px 0px;
padding: 0px 0;
> li {
> .item {
font-size: #menuFontSize - 1;
padding-top: 3px;
padding-bottom: 3px;
}
}
}
}
// Module styling .modules {
text-align: left;
color: #moduleTextColor;
.module-content {
padding: 5px 10px;
h1, h2, h3, h4, h5 {
color: #moduleHeaderColor;
}
a {
color: #moduleLinkColor;
}
p {
margin: 0 0 10px 0;
font-size: #menuFontSize - 1;
line-height: #menuLineHeight - 3;
}
}
}
}
// Flyout Dropdown (3rd Level +) .flyout {
border-top: 1px solid #menuBorder;
}
// Columns .column {
float: left;
position: relative;
}
// Alignment Helpers .position-left {
float: left;
margin-right: 15px;
}
.position-right {
float: right;
margin-left: 15px;
}
// Splitmenu specific fixes &.gf-splitmenu {
li.parent {
&:hover {
.border-radius(#menuItemRadius);
}
}
}
}
Firstly you want to work in rows instead of columns as then you won't need to worry about that
Here is the css I would use:
.row-item {
display: block;
float: left;
padding: 5px;
border-left: solid 1px black;
border-right: solid 1px black;
}
.row {
position: relative;
display: block;
float: left;
clear: left;
}
.continent {
background: maroon;
color: wheat;
}
.country {
background: wheat;
color: maroon;
}
HTML:
<div class='row'>
<div class='continent row-item'>
Continent
</div>
<div class='row-item country'>
Country
</div>
</div>
<div class='row'>
<div class='continent row-item'>
Continent
</div>
<div class='row-item country'>
Country
</div>
</div>
Here is a fiddle demo
http://jsfiddle.net/Hive7/vMu8e/
Related
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.
I'm currently using this website's code and it stopped working once one of the timers was finished. When one timer was finished, the second timer stopped showing up. Now, the second timer doesn't show up at all.
Codepen : http://codepen.io/anon/pen/jPvOYj
CSS because I need code for whatever reason:
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background-image: url("images/bg.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
margin-top: 0px;
margin-bottom: 0px;
}
header {
position: fixed;
overflow: hidden;
}
ul,
ol,
dl {
padding: 0;
margin: 0;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
margin-top: 0px;
padding-right: 10px;
padding-left: 10px;
margin: 10px;
}
h1 {
font-size: 28px;
}
h2 {
font-size: 24px;
}
h3 {
font-size: 20px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 14px;
}
.container {
width: 1200px;
background-color: #FFFFFF;
margin: 0 auto;
}
.sidebar1 {
margin-top: 150px;
position: fixed;
float: left;
width: 200px;
background-color: #EADCAE;
padding-bottom: 10px;
float: left;
z-index: 100;
bottom: 0;
top: 0;
border-bottom: 1px solid #666;
border-left: 1px solid #666;
}
.content {
margin-top: 150px;
margin-left: 200px;
padding-right: 0;
padding-left: 0;
padding-bottom: 20px;
width: 999px;
float: left;
background: #FFF;
border-top: 1px solid #666;
border-bottom: 1px solid #666;
border-left: 1px solid #666;
border-right: 1px solid #666;
position: fixed;
overflow-y: auto;
bottom: 0;
top: 0;
}
aside {
float: left;
width: 200px;
background-color: #EADCAE;
padding: 10px 0;
overflow: hidden;
}
.content ul,
.content ol {
padding: 0 10px 10px 40px;
}
.fltrt {
float: right;
margin-left: 8px;
}
.fltlft {
float: left;
margin-right: 8px;
}
.clearfloat {
clear: both;
height: 0;
font-size: 1px;
line-height: 0px;
}
header,
section,
footer,
aside,
article,
figure {}
ul,
ol,
dl {
padding: 0;
margin: 0;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
color: #0B09CB;
}
a:active {
text-decoration: none;
}
#navbar {
position: relative;
width: 100%;
padding: 0;
text-align: center;
}
nav ul il .subnav {
display: block;
display: none;
}
nav ul {
list-style: none;
border-top: 1px solid #666;
}
nav li {
border-bottom: 1px solid #666;
}
nav a,
nav a:visited {
padding: 5px 5px 5px 15px;
display: block;
width: 180px;
text-decoration: none;
background-color: #C6D580;
}
nav a:hover,
nav a:active,
nav a:focus {
background-color: #ADB96E;
color: #FFF;
}
nav ul li {
position: relative;
text-align: center;
}
nav ul li > ul {
display: none;
position: absolute;
left: 100%;
top: -1px;
}
nav ul li:hover > ul {
display: block;
}
table {
width: 96%;
border-collapse: collapse;
}
th {
background-color: #D6DCED;
}
a.back-to-top {
display: none;
width: 60px;
height: 60px;
position: fixed;
bottom: 40px;
right: 40px;
background: gold url("images/up-arrow.png") no-repeat center 43%;
text-indent: -9999px;
border-radius: 30px;
}
a:hover.back-to-top {
background-color: #000;
}
#table1, #table2 {
font-weight: bold;
}
hi i am having provlems with my drop down menu on my index page, the drop down items are hidden below my image slider which is directly below my nav bar, i would like to be able to see the drop down menu items, any help would be greatly appreciated
thank you very much;
here is my html for the nav bar:
<div class="nav">
<ul>
<li class="home">Home</li>
<li class="">sports news
<ul>
<li>headlines</li>
<li>when an where</li>
<li>rewind</li>
<li>manager of the week </li>
</ul>
</li>
<li class="about"><a class="active" href="#">music</a></li>
<li class="news">events
<ul>
<li>News #1</li>
<li>News #2###</li>
<li>News #3</li>
</ul>
</li>
<li class="contact">events</li>
<li class="contact">gallery</li>
<li class="contact">Contact</li>
</ul>
</div>
<div class="cleaner"></div>
and here is my css:
/*
jmc
*/
body {
margin: 0px;
padding: 0px;
color: #4d4638;
font-family: Tahoma, Geneva, sans-serif;
font-size: 13px;
line-height: 1.7em;
background: url(images/tooplate_body.jpg);
background-color: #c2b8a1;
background-repeat: repeat-x;
background-position: top
}
a, a:link, a:visited { color: #000; font-weight: bold; text-decoration: none; }
a:hover { text-decoration: underline; }
.orange {
color: #FC0;
}
.green {
color: #CF6;
}
p { margin: 0 0 10px 0; padding: 0; }
img { border: none; }
em { color: #000; font-weight: bold; font-style: normal }
h1, h2, h3, h4, h5, h6 { color: #000; font-weight: normal; }
h1 { font-size: 34px; margin: 0 0 20px 0; padding: 5px 0 }
h2 { font-size: 28px; margin: 0 0 20px 0; padding: 5px 0; }
h3 { font-size: 24px; margin: 0 0 15px; padding: 0; }
h4 { font-size: 18px; margin: 0 0 15px; padding: 0; }
h5 { font-size: 16px; margin: 0 0 10px; padding: 0; }
h6 { font-size: 14px; margin: 0 0 5px; padding: 0; }
.cleaner { clear: both }
.h10 { height: 10px }
.h20 { height: 20px }
.h30 { height: 30px }
.h40 { height: 40px }
.h50 { height: 50px }
.h60 { height: 60px }
a.more {
clear: both;
display: block;
width: 87px;
height: 31px;
padding-right: 15px;
line-height: 30px;
text-align: center;
color: #000;
font-weight: bold;
background: url(images/tooplate_btn.png);
}
a.more:hover {
text-decoration: none;
color: #960;
}
.float_l { float: left }
.float_r { float: right }
.tooplate_margin { margin: 10px; }
.image_wrapper {
display: inline-block;
border: 1px solid #cac2b1;
background: #b5ac98;
padding: 4px;
margin-bottom: 5px;
}
.image_fl {
float: left;
margin: 3px 15px 0 0;
}
.image_fr {
float: right;
margin: 3px 0 0 15px;
}
.tooplate_list {
margin: 20px 0 20px 20px;
padding: 0;
list-style: none;
}
.tooplate_list li {
color:#000;
margin: 0 0 5px 0;
padding: 0 0 0 25px;
background: url(images/tooplate_list.png) no-repeat scroll 0 5px;
}
.tooplate_list li a {
color: #000;
font-weight: normal;
}
.tooplate_list li a:hover {
text-decoration: underline;
}
#tooplate_header {
width: 960px;
padding: 10px 0;
margin: 0 auto;
}
#site_title {
float: left;
}
#site_title h1 {
margin: 30px 0 0 0;
padding: 0;
}
#site_title h1 a {
display: block;
width: 278px;
height: 50px;
color: #fff;
text-indent: -10000px;
background: url(images/tooplate_logo.png) no-repeat;
}
/* menu */
#tooplate_menu {
float: right;
width: 632px;
height: 48px;
margin-top: 40px;
background: url(images/tooplate_menu.png)
}
#tooplate_menu ul {
width: 600px;
margin: 0 auto;
padding: 0;
list-style: none;
}
#tooplate_menu ul li {
float: left;
display: block;
padding: 0;
margin: 0;
display: inline;
text-align: center;
}
#tooplate_menu ul li a {
display: block;
width: 116px;
padding: 9px 4px 9px 0;
margin: 0;
font-size: 14px;
text-align: center;
text-decoration: none;
color: #000000;
text-shadow: 1px 1px 1px #cec8ba;
font-weight: normal;
outline: none;
border: none;
background: url(images/tooplate_menu_divider.png) center right no-repeat
}
#tooplate_menu ul li a:hover, #tooplate_menu ul li .current {
color: #fff;
text-shadow: 1px 1px 1px #3d3728;
}
#tooplate_menu ul .last {
background: none;
}
#search_box {
float: right;
margin: 12px 0 0 0;
width: 170px;
height: 27px;
background: url(images/tooplate_search.png) no-repeat;
}
#search_box form {
clear: both;
width: 170px;
height: 26px;
padding: 0;
margin: 0;
}
#searchfield {
float: left;
display: block;
height: 16px;
width: 130px;
padding: 5px;
font-size: 12px;
color: #ccc;
line-height: 0;
background: none;
border: none;
}
#searchbutton {
float: right;
display: block;
height: 26px;
width: 30px;
padding: 0;
margin: 0;
cursor: pointer;
background: none;
border: none;
}
/* end of menu */
/* slider */
#tooplate_middle {
clear: both;
width: 940px;
height: 307px;
padding: 10px 40px;
margin: 0 auto;
background: url(images/tooplate_middle_home.png) no-repeat
}
#tooplate_middle_subpage {
clear: both;
width: 820px;
height: 207px;
padding: 60px 100px;
margin: 0 auto;
font-family: Georgia, "Times New Roman", Times, serif;
background: url(images/tooplate_middle_subpage.png) no-repeat;
}
#tooplate_middle_subpage h2 {
font-size: 48px;
color: #000;
}
#tooplate_middle_subpage p {
font-size: 18px;
color: #000;
line-height: 30px;
}
#tooplate_middle_subpage a {
color: #507921;
font-weight: normal;
}
#slider {
float: right;
width: 940px;
height: 300px;
overflow: hidden;
}
/* end of slider */
#tooplate_main {
clear: both;
width: 960px;
padding: 30px 0;
margin: 0 auto;
}
.col_w960 { width: 960px; margin-bottom: 40px }
.col_w600 { width: 600px }
.col_w450 { width: 450px }
.col_w300 { width: 300px }
.col_allw300 { width: 300px; float: left; margin-right: 30px }
.col_last { margin: 0 }
.col_w960_last { margin: 0; background: none; }
.col_last { margin: 0; }
.wwd_box { clear: both; margin-top: 20px; margin-bottom: 40px }
.wwd_box img { float: left; width: 80px; margin-right: 30px }
.wwd_box h3 { font-size: 16px; margin-bottom: 0 }
.wwd_box h3 a { color: #507921; font-size: 16px; font-weight: normal }
.wwd_box p { margin-bottom: 30px; }
.lp_box { float: left; width: 300px; margin-right: 30px }
.lp_box h6 { font-weight: bold; color: #507921 }
.lp_box_last { margin: 0 }
.lp_box img { border: 1px solid #CCC; padding: 4px }
#cp_contact_form {
margin: 10px;
padding: 0;
width: 412px;
}
#cp_contact_form form {
margin: 0px;
padding: 0px;
}
#cp_contact_form form .input_field {
width: 400px;
padding: 10px;
border: 1px solid #ccc;
background: #fff;
color: #333;
font-family: Verdana,Geneva,sans-serif;
font-size: 12px;
margin-top: 5px;
}
#cp_contact_form form label {
display: block;
width: 100px;
margin-right: 10px;
font-size: 14px;
}
#cp_contact_form form textarea {
width: 400px;
height: 160px;
padding: 10px;
border: 1px solid #ccc;
background: #fff;
color: #333;
font-family: Verdana,Geneva,sans-serif;
font-size: 12px;
margin-top: 5px;
}
#cp_contact_form form .submit_btn {
margin: 5px 0px;
padding: 5px 14px;
text-decoration: none;
border: 1px solid #ccc;
background: #fff;
font-size: 14px;
}
#map {
margin: 10px;
}
#map img {
width: 300px;
height: 200px;
border: 1px solid #d9d3c5;
background: #b5ac98;
padding: 7px;
margin-bottom: 10px;
}
.news_box {
clear: both;
margin-bottom: 30px;
padding-bottom: 30px;
border-bottom: 1px dashed #333;
}
.news_box h2 {
font-size: 20px;
margin-bottom: 0;
}
.news_box p.date {
color: #000;
}
.news_box img {
float: left;
padding: 4px;
border: 1px solid #000;
margin-right: 30px;
}
.news_box a.more {
clear:none;
float: right;
}
.sb_lp_box {
clear: both;
margin-bottom: 20px;
}
.sb_lp_box img {
border: 1px solid #cac2b1;
background: #b5ac98;
padding: 8px;
margin-bottom: 10px;
}
.post_box {
clear: both;
margin-bottom: 30px;
}
.post_box h2 {
font-size: 20px;
margin-bottom: 10px;
}
.post_box p.post_meta {
margin-bottom: 0;
}
.post_box p span.cat a {
color: #507921;
font-weight: 400;
}
.post_box img {
width: 550px;
height: 160px;
border: 1px solid #cac2b1;
background: #b5ac98;
padding: 8px;
margin-bottom: 10px;
}
.post_box a.more {
float: left;
}
.lbe_box {
clear: both;
margin-bottom: 20px;
}
.lbe_box h3 {
font-size: 16px;
margin-bottom: 0;
}
.lbe_box h3 a {
color: #507921;
font-size: 16px;
font-weight: normal;
}
.lbe_box h3 a span {
font-size: 12px;
color: #507921;
}
.lbe_box p {
margin-bottom: 0;
}
.lbe_box p.date {
font-size: 10px;
font-weight: 700;
color: #507921;
}
#gallery {
margin: 0;
padding: 0;
}
#gallery ul {
margin: 0;
padding: 0;
}
#gallery ul li {
display: block;
float: left;
width: 281px;
margin: 0 30px 30px 0;
padding: 8px;
border: 1px solid #d0c9b8;
background: #b6ac97;
}
#gallery ul .third {
margin: 0 0 30px 0;
}
#gallery ul li a img {
border: 1px solid #ccc;
margin-bottom: 5px;
}
#tooplate_footer_wrapper {
clear: both;
width: 100%;
background: #a19882;
border-top: 10px solid #d0c8b4;
}
#tooplate_footer {
width: 960px;
margin: 0 auto;
padding: 15px 0;
text-align: center;
color: #000;
background: url(images/tooplate_footer.jpg) top center no-repeat
}
#tooplate_cr a {
color: #5fa008;
font-weight: normal;
}
.nav ul {
list-style: none;
background-color: #444;
text-align: center;
padding: 0;
margin: 0;
}
.nav li {
font-family: 'Oswald', sans-serif;
font-size: 1.2em;
line-height: 40px;
text-align: left;
}
.nav a {
text-decoration: none;
color: #fff;
display: block;
padding-left: 15px;
border-bottom: 1px solid #888;
transition: .3s background-color;
}
.nav a:hover {
background-color: #005f5f;
}
.nav a.active {
background-color: #aaa;
color: #444;
cursor: default;
}
/* Sub Menus */
.nav li li {
font-size: .8em;
}
/*******************************************
Style menu for larger screens
Using 650px (130px each * 5 items), but ems
or other values could be used depending on other factors
********************************************/
#media screen and (min-width: 650px) {
.nav li {
width: 130px;
border-bottom: none;
height: 50px;
line-height: 50px;
font-size: 1.4em;
display: inline-block;
margin-right: -4px;
}
.nav a {
border-bottom: none;
}
.nav > ul > li {
text-align: center;
}
.nav > ul > li > a {
padding-left: 0;
}
/* Sub Menus */
.nav li ul {
position: absolute;
display: none;
width: inherit;
}
.nav li:hover ul {
display: block;
}
.nav li ul li {
display: block;
}
}
#nav ul {
z-index: 9999;
}
thanks again;
From what I can see from the snippet provided, my best guess would be to add:
position:relative;
to your:
#nav ul{
z-index:9999;
}
HOWEVER I cannot see div id="nav" in your html! If you have just not included it in your snippet, that's fine, but if this is also an error and you mean to assign that css to div class="nav", then try changing that whole block to:
.nav ul{
position:relative;
z-index:9999;
}
One final note to remember, assign z-index to elements that ALSO have a position set (be it relative or absolute etc) - as far as i'm aware, z-index doesn't work unless the block has a position attribute set to it also.
Hope this works for you.
So here's what I should be getting
But this is what I'm getting
As you can see the yellow section is missing. Here's my working example http://jsfiddle.net/Qk543/ but for some weird reason I cannot replicate it. Here's my code for the defective page.
<div class="wrap">
<div class="foot">
<ul class="styl">
<a id="html" href="#">
<li style="background: #F16529">
WORD
</li>
</a>
<a id="css" href="#">
<li style="background: #2AA9E0">
WORD
</li>
</a>
<a id="php" href="#">
<li style="background: #8892BF">
WORD
</li>
</a>
<a id="js" href="#">
<li style="background: #F0DB4F">
WORD
</li>
</a>
</ul>
</div>
</div>
And the CSS to it...
h1 {
padding: 80px 0 40px;
font-size: 40px;
line-height: 48px;
color: #505762;
}
.search h1 {
padding: 60px 0;
}
.slidey {
overflow: hidden;
padding: 30px 0;
background: #f3f5f8;
border-bottom: 1px solid #e5e8ed;
}
.js-enabled .slidey {
-webkit-transition: margin-top .2s;
-moz-transition: margin-top .2s;
transition: margin-top .2s;
}
.slidey b, .slidey label {
display: block;
font-weight: 500;
padding-bottom: 15px;
font-size: 15px;
font-weight: 500;
}
.slidey form, .slidey aside {
float: left;
width: 50%;
}
.slidey form input {
padding: 20px;
width: 75%;
}
.slidey li {
list-style: none;
}
.slidey a {
display: block;
text-decoration: none;
color: #717985;
}
.slidey a:hover {
color: #414b59;
}
.slidey li span {
float: right;
opacity: .6;
}
#top {
overflow: hidden;
padding: 20px 35px;
background: #fff;
border-bottom: 1px solid rgba(22,36,54,.1);
}
#top a {
float: left;
font-size: 13px;
font-weight: 500;
text-decoration: none;
color: #8895a7;
}
#top #logo:hover, #top ul a:hover, #top ul .active a, .posts .items li:first-child h2 a:hover, p a:hover {
color: #4171b1;
}
#top ul {
list-style: none;
float: right;
}
#top ul li {
float: left;
padding-left: 40px;
}
#top ul a {
display: inline-block;
color: #555f6d;
}
#top ul img {
display: inline-block;
vertical-align: middle;
position: relative;
top: -2px;
width: 16px;
height: 16px;
opacity: .4;
}
#top ul a:hover img {
opacity: .7;
}
#top ul a.active img {
opacity: 1;
}
/**
* Index page listing, category listing, search page results
*/
.items {
list-style: none;
}
.items > li {
padding: 70px 0 60px;
color: #97aec9;
background: #3c4552;
}
.posts .items > li:first-child {
background: #fff !important;
padding: 110px 0;
}
.items li h1 a, .posts .items > li:first-child h2 a {
color: #3d4551;
}
.items h1 {
padding: 0 0 8px;
}
.items h1 a {
text-decoration: none;
}
.items h2 {
font-size: 32px;
line-height: 41px;
}
.items h2 a {
display: block;
padding-bottom: 12px;
color: #fff;
color: rgba(176,200,236,.8);
text-decoration: none;
}
.items h2 a:hover {
color: #fff;
}
.items .content {
padding: 10px 0 0;
}
.items .content p {
padding-bottom: 15px;
}
/**
* Pagination
*/
.pagination {
overflow: hidden;
padding: 30px 0;
margin-bottom: 50px;
border-top: 1px solid rgba(22,36,54,.1);
border-bottom: 1px solid rgba(22,36,54,.1);
}
.pagination:empty {
display: none;
}
.pagination a {
float: left;
text-decoration: none;
font-size: 13px;
font-weight: 500;
color: #6f7b8b;
}
.pagination a:hover {
color: #3c4857;
}
.pagination a.next {
float: right;
}
/**
* Give some extra space to single-page wrappers
*/
.content.wrap {
padding-bottom: 50px;
}
.content.wrap ul, .content.wrap ol, .items li ul {
padding: 20px 30px;
}
.content.wrap ul ul, .content.wrap ol ol, .items li ul ul {
padding: 0 20px;
}
/**
* Footnotes and straplines
*/
.footnote, .commentlist time, .items footer {
display: block;
padding: 5px 0 15px;
color: #98a2b1;
font-size: 14px;
font-style: italic;
white-space: nowrap;
}
.footnote {
padding: 20px 0 40px;
}
/**
* Comment form
*/
ul.commentlist {
margin-bottom: 40px;
list-style: none;
border-top: 1px solid rgba(22,36,54,.1);
}
ul.commentlist .wrap {
position: relative;
}
ul.commentlist li {
padding: 40px 0;
border-bottom: 1px solid rgba(22,36,54,.1);
}
ul.commentlist time {
font-size: 13px;
}
ul.commentlist h2 {
font-size: 25px;
line-height: 33px;
}
ul.commentlist .counter {
position: absolute;
right: 0;
top: 0;
font-size: 25px;
font-weight: 300;
color: #cdd2da;
}
#comment {
overflow: hidden;
}
#comment label[for] {
display: none;
}
#comment p {
float: left;
width: 48%;
margin-right: 4%;
margin-bottom: 10px;
text-indent: 0;
}
#comment p + p {
margin-right: 0;
}
#comment p.textarea {
float: none;
width: 100%;
}
#comment input, #comment textarea {
width: 100%;
padding: 10px 15px;
font-size: 15px;
font-weight: normal;
border: 1px solid rgba(22,36,54,.2);
border-radius: 4px;
}
#comment input:focus, #comment textarea:focus {
outline: none;
background: #f7f9fc;
}
#comment textarea {
min-height: 150px;
max-height: 800px;
resize: vertical;
}
#comment button {
display: inline-block;
padding: 9px 18px;
background: #4e82ce;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 13px;
font-weight: 500;
}
#comment button:hover {
background: #3c6eb7;
}
*{padding:0;margin:0;}
body {
text-align: center;
padding-top: 50px;
font-family: "Helvetica Neue", sans-serif;
}
.foot{
bottom: 0px;
position: fixed;
width:100%;
margin: 0px;
font-weight: 400;
}
.foot li{
opacity: 0.95;
position: relative;
float: left;
list-style: none;
width: 25%;
height: 60px;
text-align: center;
}
.foot a{
font-size: 1.5em;
color: #fff;
height: 75px;
position: relative;
text-indent: 0;
text-decoration: none;
line-height: 60px;
}
.foot li:nth-child(1){
background: #B36C4E;
}
.foot li:nth-child(2){
background: #2AA9E0;
}
.foot li:nth-child(3){
background: #8892BF;
}
.foot li:nth-child(4){
background: #F0DB4F;
}
a:link{text-decoration: none}
a:hover{text-decoration: none}
a:visited{text-decoration: none}
a:active{text-decoration: none}
.content {
padding-right: 5%;
padding-left: 5%;
}
Any ideas?
You're using floats, so there's a good chance your last element is a pixel or so too wide for the container it's in and it's floating to the next line.
Try changing the width to 24% on each element and you'll probably see all four.
If you don't want to play with the width, try adding this to your css:
* {
box-sizing: border-box;
}
That includes any padding/margin in the width so that 25% width will be the true width instead of 25% plus padding/margin.
Hi everyone I am having trouble getting to stay in place while I scroll, essentially making it 'fixed'. I have set the CSS to fixed, as you can see below, but the header still disappears when I scroll.
HTML PAGE
<title>Final Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script>
window.open = function(){};
window.print = function(){};
// Support hover state for mobile.
if (false) {
window.ontouchstart = function(){};
}
</script>
<body>
**<div class="fixed">
<h1>Packit<br>
<style>
.col-group {
overflow: hidden;
}
.col-group > div {
padding: 1em;
}
#media screen and (min-width: 44em) {
.col-group > div {
float: left;
width: 50%;
}
.col-group > div:nth-child(odd) {
clear: left;
}
}
#media screen and (min-width: 50em) {
.col-group > div {
float: left;
width: 33.3333333%;
}
.col-group > div:nth-child(3n+1) {
clear: left;
}
.col-group > div:nth-child(odd) {
clear: none;
}
}
#media screen and (min-width: 70em) {
.col-group > div {
width: 20%;
}
.col-group > div:nth-child(odd), .col-group > div:nth-child(3n+1) {
clear: none;
}
}body h1 {
font-size: 12em;
}
body h1 {
font-size: 3em;
}
body h1 {
font-size: 16em;
}
body h1 {
font-size: 16px;
}
body h1 {
font-size: 12px;
}
</style>
<link href="../Documents/Unnamed Site 2/stylesheet2.css" rel="stylesheet" type="text/css">
Hi there. We are here to help.</h1>
</div>**
CSS PAGE
/*
colors
red: #e51837; rgb(229,24,55)
gray: #808080;
*/
/************Reset**************/
* {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html, body, div, object, iframe, fieldset {
margin: 0;
padding: 0;
border: 0;
}
input, select
{
width: 120px;
}
ol, ul {
list-style: none;
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
header, footer, nav, section, article, hgroup, figure {
display: block;
}
legend {
display: none;
}
/************End Reset**************/
/************Global**************/
.fixed
{ position:fixed;
top:0;
left:0;
width:100%;
margin:0 auto;
}
.form
{ position:fixed;
margin: auto;
width: auto;
line-height: 1;
}
body {
background: #fff;
color: #000;
font: 100%/1.4 "HelveticaNeue", "Helvetica", "Arial", sans-serif;
padding: 0;
-webkit-text-size-adjust: none;
}
a {
color: #808080;
text-decoration: none;
}
a:hover, a:focus {
color: #e51837;
}
p {
margin: 0 0 1em;
}
img, object, video {
max-width: 100%;
border: 0;
}
a img {
border: 0;
outline: 0;
}
h1 {
font-size: 3em;
line-height: 1;
letter-spacing: -0.02em;
margin-bottom: 0.2em;
}
h2 {
font-size: 2em;
line-height: 1.1;
margin-bottom: 0.2em;
}
h3 {
font-weight: normal;
line-height: 1.1;
padding-bottom: 0.4em;
border-bottom: 1px solid #ccc;
}
h1 a, h2 a, h3 a {
display: block;
color: #000;
}
h1 a:hover, h2 a:hover, h3 a:hover {
color: #e51837;
}
blockquote {
border-left: 0.5em solid #ddd;
padding-left: 1em;
margin-left: 1em;
}
small {
color: #e51837;
}
input[type=search] {
-webkit-appearance: none;
border-radius: 0;
}
::-webkit-input-placeholder {
color: #808080;
}
:-moz-placeholder {
color: #808080;
}
/************End Global**************/
/************Classes**************/
.inactive {
color: #ddd;
}
/************End Classes**************/
/************Structure**************/
.container {
max-width: 70em;
margin: 0 auto;
padding: 0 1em;
overflow: hidden;
}
div[role=main] {
padding-bottom: 1em;
}
/*Footer*/
footer[role=contentinfo] {
color: #fff;
background: #000;
margin: 0 -1em;
position: fixed;
z-index: 2;
}
footer[role=contentinfo] > div {
max-width: 70em;
padding: 0 1em;
margin: 0 auto;
overflow: hidden;
}
footer[role=contentinfo] p {
margin: 0;
}
footer[role=contentinfo] .nav li a {
display: block;
border-bottom: 1px solid #808080;
padding: 1em;
margin: 0 -1em;
}
footer[role=contentinfo] a {
display: inline-block;
padding: 0.5em 0;
}
footer[role=contentinfo] a.nav-home {
color: #fff;
}
footer[role=contentinfo] .f-rga {
padding: 0.6em 0;
}
footer[role=contentinfo] img {
max-width: 4.4em;
display: inline-block;
margin-bottom: -0.22em;
}
/*End Footer*/
/*Grid*/
.grid {
margin: 0 -1em;
overflow: hidden;
}
.grid:target {
-webkit-animation: fadeout 5s 1 ease-out;
-moz-animation: fadeout 5s 1 ease-out;
-o-animation: fadeout 5s 1 ease-out;
animation: fadeout 5s 1 ease-out;
}
.grid > h2 {
margin-left: 0.45em;
}
.grid > section {
padding: 1em 1em 0.5em;
}
.grid > section:target {
-webkit-animation: fadeout 5s 1 ease-out;
-moz-animation: fadeout 5s 1 ease-out;
-o-animation: fadeout 5s 1 ease-out;
animation: fadeout 5s 1 ease-out;
}
.grid ul {
overflow: hidden;
}
.grid ul li {
margin-bottom: 0.3em;
}
.featured:after {
content: "*";
color: #e51837;
}
/*Fluid*/
.fluid {
display: block;
margin: 0 auto;
max-width: 40em;
}
/*Homepage*/
.home h1 {
margin-bottom: 0.2em;
}
.intro {
font-size: 1.8em;
line-height: 1.2;
margin: 0 auto;
}
.intro a:hover ,.intro a:focus {
color: #000;
border-bottom-color: #000;
}
.ani {
position: relative;
height: 15em;
margin: 1em 0 0;
width: 100%;
z-index: 0;
}
.ani div {
width: 100%;
}
.ani div b {
display: block;
position: absolute;
top: 5%;
right: 5%;
bottom: 5%;
left: 5%;
background: rgba(229,24,55,0.22);
}
/*Patterns*/
.mod {
padding: 1em;
}
.pattern {
background: #f7f7f7;
border-bottom: 1px solid #808080;
margin-bottom: 1em;
overflow: hidden;
}
.pattern-description h1 {
font-size: 3.4em;
margin-bottom: 0.5em;
}
.pattern-description {
max-width: 40em;
margin: 0 auto;
}
.pattern-description ul, .pattern-description ol {
margin-bottom: 2em;
}
.pattern-description li {
margin-bottom: 1em;
}
/*Blog*/
/*Blog Header*/
.blog .container {
max-width: 62em;
}
.blog header[role=banner] {
overflow: hidden;
margin-bottom: 2em;
padding: 2em 0 1em;
border-bottom: 1px solid #000;
}
.blog-logo {
font-weight: normal;
font-size: 1.2em;
margin: 0 0 1em;
}
.blog-logo img {
width: 3.3em;
}
.blog-logo a {
color: #000;
}
.search-form {
width: 100%;
margin-bottom: 1em;
}
.search-field {
width: 100%;
padding: 0.5em 0;
border: 0;
border-bottom: 1px solid #808080;
outline: none;
}
.search-field:focus {
background: #e51837;
color: #fff;
}
.search-field:focus::-webkit-input-placeholder {
color: #fff;
}
.search-field:focus :-moz-placeholder {
color: #fff;
}
.blog .nav {
clear: both;
}
.blog .nav a {
display: block;
font-weight: bold;
color: #000;
}
.blog .nav a:hover {
color: #e51837;
}
/*Posts*/
.posts ol > li {
padding-bottom: 1em;
border-bottom: 1px solid #ccc;
margin-bottom: 1em;
overflow: hidden;
}
.posts h2 {
font-size: 1.4em;
margin: 0.28em 0 0.1em;
font-weight: normal;
}
.posts h2 a {
color: #000;
}
.posts h2 a:hover, .posts h2 a:focus {
color: #e51837;
}
.permalink {
display: block;
font-size: 0.8em;
margin-bottom: 1.2em;
}
.post-body a {
border-bottom: 1px solid #ccc;
}
.posts blockquote {
margin: 0 0 1em;
color: #666;
border-left: 0.25em solid #ccc;
padding-left: 1em;
}
.tags {
float: left;
}
.tags li {
display: inline-block;
font-size: 0.8em;
margin-right: 0.5em;
}
.posts ol > li .tags a, .permalink {
color: #ccc;
-webkit-transition: color 0.3s ease-out;
-moz-transition: color 0.3s ease-out;
-ms-transition: color 0.3s ease-out;
-o-transition: color 0.3s ease-out;
transition: color 0.3s ease-out;
}
.posts ol > li:hover .tags a, .posts ol > li:hover .permalink {
color: #808080;
}
.blog-nav {
text-align: center;
overflow: hidden;
padding: 1em 0;
}
.posts .blog-nav a {
border: 0;
}
.nav-next {
float: right;
}
.nav-prev {
float: left;
}
/* Sidebar */
.sidebar {
font-size: 0.8em;
padding-bottom: 1.4em;
}
.sidebar div {
margin-bottom: 2em;
}
.sidebar h3 {
font-weight: bold;
font-size: 0.9em;
line-height: 1;
border-bottom: 1px solid #000;
}
.sidebar a {
color: #808080;
}
.sidebar a:hover, .sidebar a:focus {
color: #e51837;
}
.social-links {
overflow: hidden;
}
.social-links li {
float: left;
margin-right: 1.2em;
}
.social-links li a {
display: block;
height: 17px;
width: 16px;
text-indent: -99999em;
background: url(images/sprite_social.png) no-repeat;
}
.social-links li a.s-fb {
background-position: -0px -76px;
}
.social-links li a.s-fb:hover {
background-position: -16px -76px;
}
.social-links li a.s-twitter {
background-position: -0px -37px;
}
.social-links li a.s-twitter:hover {
background-position: -16px -37px;
}
.social-links li a.s-linkedin {
background-position: -0px -113px;
}
.social-links li a.s-linkedin:hover {
background-position: -16px -113px;
}
.social-links li a.s-rss {
background-position: -0px -0px;
}
.social-links li a.s-rss:hover {
background-position: -16px -0px;
}
.top {
clear: both;
display: block;
padding: 1em 0;
}
.top:before {
content: '▲';
}
/******Media Queries*******/
/* Medium Screens*/
#media all and (min-width: 35em) {
.blog-logo {
float: left;
font-size: 2em;
margin: 0 0 1em;
}
.blog-logo img {
width: auto;
}
}
#media all and (min-width:40em) {
h1 {
font-size: 5.6em;
}
.container {
padding-bottom: 4em;
}
footer[role=contentinfo] {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
margin: 0;
}
footer[role=contentinfo] .nav {
float: left;
}
footer[role=contentinfo] .nav li {
display: inline-block;
margin-right: 0.8em;
}
footer[role=contentinfo] .nav li a {
border: 0;
}
footer[role=contentinfo] .f-rga {
float: right;
}
.grid ul li {
width: 50%;
float: left;
}
.grid ul li:nth-child(odd) {
padding-right: 1em;
clear: left;
}
.ani {
position: absolute;
top: 0;
right: 0;
bottom: 4em;
left: 0;
width: 100%;
height: 90%;
margin: 0;
z-index: 0;
}
.home {
position: absolute;
top: 0;
right: 0;
bottom: 5em;
left: 0;
z-index: 1;
width: 100%;
height: 90%;
display: table;
text-align: center;
color: #fff;
color: rgba(255,255,255,0.7);
}
.home > div {
display: table-cell;
vertical-align: middle;
}
.home .intro a {
color: #fff;
color: rgba(255,255,255,0.8);
border-bottom: 1px solid rgba(255,255,255,0.8);
}
.home .intro a:hover, .home .intro a:focus {
color: #000;
border-bottom-color: #000;
}
/*Blog*/
.search-form {
float: right;
width: 30%;
max-width: 16em;
padding-left: 0.8em;
margin-top: 0.4em;
}
.posts {
float: left;
width: 64%;
}
.sidebar {
float: right;
width: 30%;
max-width: 21em;
margin: 0 0 1em;
padding-left: 0.8em;
}
}
/* Large Screens */
#media all and (min-width: 54em) {
h1 {
font-size: 6.4em;
}
.grid > section {
float: left;
width: 33.3333333%;
}
.grid > section:nth-of-type(3n+1) {
clear: left;
}
.grid ul li {
width: auto;
float: none;
}
.grid ul li:nth-child(odd) {
padding-right: 0;
}
}
/* CSS Animations */
#-webkit-keyframes fadeout {
0% { background: #fff; }
10% { background: #eee; }
100% { background: #fff; }
}
#-moz-keyframes fadeout {
0% { background: #fff; }
10% { background: #eee; }
100% { background: #fff; }
}
#-o-keyframes fadeout {
0% { background: #fff; }
10% { background: #eee; }
100% { background: #fff; }
}
#keyframes fadeout {
0% { background: #fff; }
10% { background: #eee; }
100% { background: #fff; }
}
The problem in your case is the formatting of your HTML-Code, so improve it like this:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="../Documents/Unnamed Site 2/stylesheet2.css" rel="stylesheet" type="text/css">
<script>
window.open = function(){};
window.print = function(){};
// Support hover state for mobile.
if (false) {
window.ontouchstart = function(){};
}
</script>
<style>
.col-group {
overflow: hidden;
}
.col-group > div {
padding: 1em;
}
// ... AND SO ON... //
</style>
<title>JS Bin</title>
</head>
<body>
<div class="fixed">
<h1>Packit</h1><br> // YOU DON'T CLOSED HERE THE H1 TAG
</div>
</body>
</html>
And why don`t you put your css style in an extern file instead of embedded style sheet?
The reason you're having this problem is because you're HTML code is incorrectly formatted. You have the CSS stylesheet "Stylesheet2.css" in the body section and unfortunately external style sheets need to be linked to in the head or else they don't work. The same cannot be said for however it is common practice to also put in the section of the page too.
I was having the same issue with Chrome, it seems to be a bug that occurs when there is too much going on inside the page, I was able to fix it by adding the following transform code to the fixed position element, (transform: translateZ(0);-webkit-transform: translateZ(0);) that forces the browser to use hardware acceleration to access the device’s graphical processing unit (GPU) to make pixels fly. Web applications, on the other hand, run in the context of the browser, which lets the software do most (if not all) of the rendering, resulting in less horsepower for transitions. But the Web has been catching up, and most browser vendors now provide graphical hardware acceleration by means of particular CSS rules.
Using -webkit-transform: translate3d(0,0,0); will kick the GPU into action for the CSS transitions, making them smoother (higher FPS).
Note: translate3d(0,0,0) does nothing in terms of what you see. it moves the object by 0px in x,y and z axis. It's only a technique to force the hardware acceleration.
.fixed {
position: fixed;
background: white;
border-bottom: 2px solid #eaeaea;
width: 100%;
left: 0;
top: 0;
z-index: 9994;
height: 80px;
/* MAGIC HAPPENS HERE */
transform: translateZ(0);
-webkit-transform: translateZ(0);
}