Cyclone slider images are not in center - css

I'm using Cyclone slider for one of my website here: http://www.malithaisouthcenter.com/
if you zoom out you can see the images are not in center position(they are in left side of the page) though {margin: 0 auto} has been applied. how can I fix it?
/*** Template Standard ***/
.cycloneslider-template-standard{
position:relative;
outline: none;
}
.cycloneslider-template-standard .cycloneslider-slides{
position:relative;
overflow:hidden;
}
.cycloneslider-template-standard .cycloneslider-slide{
text-align: center;
width: 100%; /* For slides in scrollHorz to work */
display: none; /* Hide slides to prevent FOUC when JS hasn't kicked in yet */
background: #fff; /* Add background to prevent slides from peeking behind the current slide when fx=scrollHorz and hideNonActive=false */
}
.cycloneslider-template-standard .cycle-slide{
display: block; /* Show slide so that getBoundingClientRect().height will not return 0. Class .cycle-slide is added when cycle has initialized. */
}
.cycloneslider-template-standard div[data-cycle-hide-non-active="false"] .cycloneslider-slide{
opacity: 0; /* Avoid youtube and vimeo or other slides from peeking behind the current slide whe in transit */
}
.cycloneslider-template-standard div[data-cycle-dynamic-height="off"] .cycloneslider-slide-image{
height: 100%; /* To prevent cutting off captions when dynamic height is off */
}
.cycloneslider-template-standard .cycloneslider-slide:first-child, /* Show first slide */
.cycloneslider-template-standard .cycle-sentinel + .cycloneslider-slide{ /* Select next slide when using sentinel slide */
display: block;
}
.cycloneslider-template-standard .cycloneslider-slide img{
display:block;
margin:0 auto;
padding:0;
max-width:100%;
border:0;
}
.cycloneslider-template-standard.cycloneslider-width-full .cycloneslider-slide img{
/*width:100%;*/
}
.cycloneslider-template-standard .cycloneslider-slide iframe, /* Make our videos fluid */
.cycloneslider-template-standard .cycloneslider-slide object,
.cycloneslider-template-standard .cycloneslider-slide embed {
position: absolute;
left: 0;
top: 0;
width: 100% !important; /* Override width attrib */
height: 100% !important; /* Override height attrib */
}
.cycloneslider-template-standard .cycloneslider-slide-youtube,
.cycloneslider-template-standard .cycloneslider-slide-vimeo{
background: #000;
}
.cycloneslider-template-standard .cycloneslider-slide-custom,
.cycloneslider-template-standard .cycloneslider-slide-testimonial{
min-height: 100%;
}
.cycloneslider-template-standard div[data-cycle-dynamic-height="on"] .cycloneslider-slide-custom,
.cycloneslider-template-standard div[data-cycle-dynamic-height="on"] .cycle-sentinel + .cycloneslider-slide-testimonial{
min-height: 100px; /* Disable 100% min height when dynamic height is on. To fix issue with scrollHorz */
}
.cycloneslider-template-standard .cycloneslider-slide-testimonial{
font-style: italic;
}
.cycloneslider-template-standard .cycloneslider-slide-testimonial blockquote{
margin-bottom: 0;
}
.cycloneslider-template-standard .cycloneslider-slide-testimonial p{
margin: 0;
}
.cycloneslider-template-standard .cycloneslider-slide-testimonial .cycloneslider-testimonial-author{
text-align: right;
font-style: normal;
}
.rtl .cycloneslider-template-standard .cycloneslider-slide-testimonial .cycloneslider-testimonial-author{
text-align: left;
}
.cycloneslider-template-standard .cycloneslider-slide-testimonial .cycloneslider-testimonial-author a{
text-decoration: none;
}
/*** Prev/Next ***/
.cycloneslider-template-standard .cycloneslider-prev,
.cycloneslider-template-standard .cycloneslider-next,
.cycloneslider-template-standard .cycloneslider-pager span {
cursor:pointer;
}
.cycloneslider-template-standard .cycloneslider-prev,
.cycloneslider-template-standard .cycloneslider-next{
position:absolute;
top:50%;
z-index:501;
display: block;
margin-top:-12px;
width:24px;
height:24px;
border-radius: 40px;
background: #fefefe;
opacity: 0;
-webkit-transition: all 0.5s ;
-moz-transition: all 0.5s ;
-ms-transition: all 0.5s ;
-o-transition: all 0.5s ;
transition: all 0.5s ;
-webkit-box-shadow: 1px 1px 2px 0px #333333;
box-shadow: 1px 1px 2px 0px #333333;
}
.cycloneslider-template-standard:hover .cycloneslider-prev,
.cycloneslider-template-standard:hover .cycloneslider-next{
opacity: 0.4;
}
.cycloneslider-template-standard .cycloneslider-prev:hover,
.cycloneslider-template-standard .cycloneslider-next:hover{
opacity: 1;
}
.cycloneslider-template-standard .cycloneslider-prev.disabled,
.cycloneslider-template-standard .cycloneslider-next.disabled{
display: none;
}
.cycloneslider-template-standard .arrow{
position: absolute;
top: 50%;
left: 50%;
margin-top: -6px;
width: 0;
height: 0;
}
.cycloneslider-template-standard .cycloneslider-prev{
left:10px;
}
.rtl .cycloneslider-template-standard .cycloneslider-prev{
left:auto;
right:10px;
}
.cycloneslider-template-standard .cycloneslider-prev .arrow{
margin-left: -4px;
border-top: 6px solid transparent;
border-right: 6px solid #333;
border-bottom: 6px solid transparent;
}
.rtl .cycloneslider-template-standard .cycloneslider-prev .arrow{
margin-left: -2px;
border: 0;
border-top: 6px solid transparent;
border-left: 6px solid #333;
border-bottom: 6px solid transparent;
}
.cycloneslider-template-standard .cycloneslider-next{
right:10px;
}
.rtl .cycloneslider-template-standard .cycloneslider-next{
right:auto;
left:10px;
}
.cycloneslider-template-standard .cycloneslider-next .arrow{
margin-left: -2px;
border-top: 6px solid transparent;
border-left: 6px solid #333;
border-bottom: 6px solid transparent;
}
.rtl .cycloneslider-template-standard .cycloneslider-next .arrow{
margin-left: -4px;
border: 0;
border-top: 6px solid transparent;
border-right: 6px solid #333;
border-bottom: 6px solid transparent;
}
/*** Pager ***/
.cycloneslider-template-standard .cycloneslider-pager{
position:absolute;
bottom:-22px;
left:0;
z-index:100;
width: 100%;
height: 12px;
text-align: center;
}
.cycloneslider-template-standard .cycloneslider-pager span {
display: inline-block;
margin: 0 3px;
width: 12px;
height: 12px;
border-radius: 6px;
background: #333;
vertical-align: top;
font-size: 0;
line-height: 0;
-webkit-box-shadow: 1px 1px 2px 0px #333333;
box-shadow: 1px 1px 2px 0px #333333;
}
.ie7 .cycloneslider-template-standard .cycloneslider-pager span{
zoom: 1;/* IE 7 inline-block */
*display: inline;/* IE 7 inline-block */
}
.cycloneslider-template-standard .cycloneslider-pager span.cycle-pager-active {
background-color: #ccc;
}
/*** Caption ***/
.cycloneslider-template-standard .cycloneslider-caption{
position:absolute;
bottom:0;
left:0;
z-index:500;
width:100%;
background: #222;
color:#fff;
opacity: 0.7;
text-align: left;
}
.rtl .cycloneslider-template-standard .cycloneslider-caption{
text-align: right;
}
.cycloneslider-template-standard .cycloneslider-caption-title{
margin-bottom:0;
padding:10px 20px 5px 20px;
font-size:22px;
line-height:1;
}
.cycloneslider-template-standard .cycloneslider-caption-description{
padding:0 20px 15px 20px;
font-size:12px;
line-height:1.5;
}

The parent div should have an auto-margin.
.cycloneslider {
margin: 0 auto;
}
The reason for this is that the img has the exact same width as the parent, as inherited. Therefor the difference is only 0px, and that is what auto will work with

you can use container class for center slider when zoomed in and zoomed out
<div class="container-fluid">
<div class="slider">
<div> <img src="LED-web-banner-updated-1.jpg" title="banner" class="img-responsive"></div>
<div><img src="Lighting_mainBanner.png" title="mainbanner" class="img-responsive" ></div>
<div><img src="Stealth_mainbanner.PNG" title="another banner" class="img-responsive"></div>
</div>
</div>

Related

Is there a way to add a border to an arrow shape with CSS?

I have an arrow-like shape created with CSS only. I want to apply a border to it and if possible, a box-shadow as well. I've tried following this answer, but it won't work. I also wonder if there's a way to make the left white triangle (the one that gives the arrow the shape) transparent instead of white.
This is what I'm trying to achieve:
This is what I have. As you can see, I'm only missing the border and shadow:
.box {
width: 180px;
height: 30px;
background: -webkit-linear-gradient(-211.23000000000002deg, #B07537 0, #F0B971 100%);
background: -moz-linear-gradient(301.23deg, #B07537 0, #F0B971 100%);
background: linear-gradient(301.23deg, #B07537 0, #F0B971 100%);
text-align: center;
color: #fff;
position: absolute;
display: table;
z-index: 1;
top: 20px;
right: 7px;
filter: drop-shadow(0px 3px 4px rgba(0, 0, 0, 0.25));
}
.box span {
display: table-cell;
vertical-align: middle;
font-size: 1em;
font-weight: 500;
}
.box:before {
content: '';
position: absolute;
border-left: 15px solid white;
border-top: 15px solid transparent;
border-bottom: 17px solid transparent;
left: 0px;
top: 0px;
width: 0;
height: 0;
display: block;
}
<div class="box">
<span>Text</span>
</div>
That is the closest thing which I can achieve with pure css. I hope it can help you at least a little bit. Let me know it does.
.box{
font-size:20px;
position:relative;
display:inline-block;
margin:5em;
text-align:center;
filter: drop-shadow(0px 3px 4px rgba(0, 0, 0, 0.5));
}
.arrow {
height: 30px;
display:inline;
position:relative;
}
.content{
display:inline-block;
padding: 0.7em 1em 0.5em;
min-width: 10em;
background: linear-gradient(270deg, #B07537 0, #F0B971 100%);
position:relative;
color: white;
font-weight: 500;
}
.box:before,
.box:after,
.arrow:before,
.arrow:after {
content:'';
position:absolute;
border-style:solid;
}
.arrow:before {
top: -0.2em;
bottom: 0;
left:-1.85em;
margin: auto;
border-width: 1.4em 1em 1.4em 1.15em;
border-color: #fccc4f #fccc4f #fccc4f transparent;
z-index:-1;
}
.arrow:after {
left:-1.5em;
margin: auto;
border-width: 1.2em 1em 1.2em 1em;
border-color: #F0B971 #F0B971 #F0B971 transparent ;
z-index:-1;
}
.box:before{
top: -0.15em;
bottom: -0.15em;
left:0;
right: 0;
margin: auto;
border-width: 1.4em 1em 1.4em 1.15em;
border-color: #fccc4f #fccc4f #fccc4f transparent;
z-index:-1;
}
.box:after{
bottom: -.6em;
right:0;
border-width: 0 0 .4em .7em;
border-color: gray transparent transparent gray ;
}
.text {
margin-left: -2em;
line-height: 1;
letter-spacing: 2px;
font-weight: bold;
}
/* .text:before{
top:100%; left:0;
border-width: .5em 2em 0 0;
border-color: #FC9544 transparent transparent transparent;
} */
<div class="box">
<div class="arrow"></div>
<div class="content">
<span class="text">Text</span>
</div>
</div>

Drop down menu is not opening while mouse over

i am just a beginning in HTML5 and CSS. Im trying to make a dropdown menu but something is going wrong. Looking a while into it but cannot find my mistake. I hope somebody is willing to help me! Here below my CSS coding.. If theres some questions or details needed comments i would love to hear them ofcourse.
*{
margin: 0;
padding: 0;
front-family: century gothic;
}
header{
background-image:linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5)), url(image.jpg);
height: 100vh;
background-size: cover;
background-position: center;
}
ul{
float: right;
list-style-type: none;
margin-top: 25px;
}
ul li{
display: inline-block;
}
ul li a{
text-decoration:none;
color:#fff;
padding:5px 20px;
border:2px solid transparent;
transition: 0.8s ease;
}
ul li a:hover{
background-color:#fff;
color: #000;
}
ul li.active a{
background-color:#fff;
color: #000;
}
/* Dropdown Button */
.dropbtn {
background-color: #fff;
color: black;
padding: 16px;
font-size: 16px;
border: black;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
padding:10px 50px;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* Links inside the dropdown */
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.logo img{
float:left;
width: 150px;
height: auto;
}
.main{
max-width: 1200px;
margin: auto;
}
.title{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%)
}
.title h1{
color: #fff;
font-size: 70px;
}
.button{
position: absolute;
top: 62%;
left: 50%;
transform: translate(-50%, -50%);
}
.btn{
border: 1px solid #fff;
padding: 10px 30px;
color: #fff;
text-decoration: none;
transition: 0.6s ease;
}
.btn:hover{
background-color: #fff;
color: #000;
}
There is nothing in your CSS, telling the .dropdown-content to appear, when you hover. You could try something like this. I have copied your CSS and added to it, also adding in some HTML:
*{
margin: 0;
padding: 0;
font-family: century gothic;
}
header{
background-image:linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5)), url(image.jpg);
height: 100vh;
background-size: cover;
background-position: center;
}
ul {
float: right;
list-style-type: none;
margin-top: 25px;
}
ul li{
display: inline-block;
}
ul li a{
text-decoration:none;
color:#fff;
padding:5px 20px;
border:2px solid transparent;
transition: 0.8s ease;
}
ul li a:hover{
background-color:#fff;
color: #000;
}
ul li.active a{
background-color:#fff;
color: #000;
}
/* Dropdown Button */
.dropbtn {
background-color: #fff;
color: black;
padding: 16px;
font-size: 16px;
border: black;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
padding:10px 50px;
display: inline-block;
}
.dropbtn:hover ~ .dropdown .dropdown-content {
display: block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* Links inside the dropdown */
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.logo img{
float:left;
width: 150px;
height: auto;
}
.main{
max-width: 1200px;
margin: auto;
}
.title{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%)
}
.title h1{
color: #fff;
font-size: 70px;
}
.button{
position: absolute;
top: 62%;
left: 50%;
transform: translate(-50%, -50%);
}
.btn{
border: 1px solid #fff;
padding: 10px 30px;
color: #fff;
text-decoration: none;
transition: 0.6s ease;
}
.btn:hover{
background-color: #fff;
color: #000;
}
<header>
<div class="dropbtn">show dropdown</div>
<div class="dropdown">
<div class="dropdown-content">
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
</div>
</div>
</header>
I am using the general sibling selector ~, to make my :hover CSS work. I can improve this answer after seeing your actual HTML.

CSS only working on zoomed in page

I've an odd problem. my CSS only works on the zoomed page. When the page is at 100% size and I right click on the input the CSS doesn't work, I've to zoom in to 35% or lower for the contextual menu to appear. If I zoom out to 50% it disappears again.
The part of my code that causes the problem is in this JsFiddle http://jsfiddle.net/6ny94/1323/
Here is my complete CSS:
body {
font-family: Arial, Helvetica, sans-serif;
padding-bottom: 20px;
padding-left: 20px;
width: 1200px;
}
.adCounter {
background: #313131;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
color: #fff;
float: right;
font-size: 14px;
padding: 6px 9px;
position: relative;
right: 1px;
top: -33px;
min-width: 34px;
}
.adCounter2 {
background: #313131;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
color: #fff;
float: right;
font-size: 14px;
padding: 13px 9px;
position: relative;
right: 1px;
top: -33px;
min-width: 34px;
min-height: 53px;
}
#myBtn {
display: none; /* Hidden by default */
position: fixed; /* Fixed/sticky position */
bottom: 20px; /* Place the button at the bottom of the page */
right: 30px; /* Place the button 30px from the right */
z-index: 99; /* Make sure it does not overlap */
border: none; /* Remove borders */
outline: none; /* Remove outline */
background-color: #000000; /* Set a background color */
color: white; /* Text color */
cursor: pointer; /* Add a mouse pointer on hover */
padding: 8px; /* Some padding */
border-radius: 8px; /* Rounded corners */
font-size: 18px; /* Increase font size */
}
.myBtn1 {
background-color: #3cba54;
color: white;
padding: 5px;
border-radius: 4px;
font-size: 14px;
border-width: inherit;
cursor:pointer;
}
.myBtn2 {
background-color: #879383;
color: white;
padding: 5px;
border-radius: 4px;
font-size: 14px;
border-width: inherit;
cursor:pointer;
}
.myBtn3 {
background-color: #f4c20d;
color: white;
padding: 5px;
border-radius: 4px;
font-size: 14px;
border-width: inherit;
cursor:pointer;
}
.myBtn4 {
background-color: #db3236;
color: white;
padding: 5px;
border-radius: 4px;
font-size: 14px;
border-width: inherit;
cursor:pointer;
}
#description {
width: 350px;
float:left;
min-height: 32px;
}
[id^="description2"] {
width: 350px;
float:left;
min-height: 32px;
}
#previewBox{
float: right;
margin-right: 259px;
margin-top: -311px;
width: 518px;
font-size: 12px;
box-shadow: 1px 1px 2px 2px #ccc;
padding-bottom: 12px;
border-radius: 3px;
}
[id^="previewBox1"]{
float: right;
}
.previewBox1{
width: 466px;
font-size: 12px;
box-shadow: 1px 1px 2px 2px #ccc;
padding-bottom: 12px;
border-radius: 3px;
margin-bottom: 12px;
}
#descriptiontext{
width: 120px;
}
.deleteAd{
background-color: red;
color: white;
padding: 5px;
border-radius: 5px;
border: 0;
margin-left: 18px;
margin-right: 14px;
padding-bottom: -13px;
margin-top: -26px;
}
.duplicateAd{
background-color: #aaa;
color: white;
padding: 5px;
border-radius: 5px;
border: 0;
margin-right: 16px;
padding-bottom: -13px;
margin-top: -26px;
}
/* The snackbar - position it at the bottom and in the middle of the screen */
#DuplicateSuccessMessage {
visibility: hidden; /* Hidden by default. Visible on click */
opacity: 0.7;
filter: alpha(opacity=50); /* For IE8 and earlier */
min-width: 250px; /* Set a default minimum width */
margin-left: -125px; /* Divide value of min-width by 2 */
background-color: #000; /* Black background color */
color: #fff; /* White text color */
text-align: center; /* Centered text */
border-radius: 2px; /* Rounded borders */
padding: 16px; /* Padding */
position: fixed; /* Sit on top of the screen */
z-index: 1; /* Add a z-index if needed */
left: 50%; /* Center the snackbar */
bottom: 50%; /* 30px from the bottom */
}
/* Show the snackbar when clicking on a button (class added with JavaScript) */
#DuplicateSuccessMessage.show {
visibility: visible; /* Show the snackbar */
/* Add animation: Take 0.5 seconds to fade in and out the snackbar.
However, delay the fade out process for 2.5 seconds */
-webkit-animation: fadein 0.5s, fadeout 0.5s 1.5s;
animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
/* The snackbar - position it at the bottom and in the middle of the screen */
#errorMessage {
visibility: hidden; /* Hidden by default. Visible on click */
opacity: 1;
filter: alpha(opacity=50); /* For IE8 and earlier */
min-width: 250px; /* Set a default minimum width */
margin-left: -125px; /* Divide value of min-width by 2 */
background-color: #f2dede; /* Black background color */
color: #a94442; /* White text color */
text-align: center; /* Centered text */
border-radius: 2px; /* Rounded borders */
padding: 16px; /* Padding */
position: fixed; /* Sit on top of the screen */
z-index: 1; /* Add a z-index if needed */
left: 50%; /* Center the snackbar */
bottom: 50%; /* 30px from the bottom */
}
/* Show the snackbar when clicking on a button (class added with JavaScript) */
#errorMessage.show {
visibility: visible; /* Show the snackbar */
/* Add animation: Take 0.5 seconds to fade in and out the snackbar.
However, delay the fade out process for 2.5 seconds */
-webkit-animation: fadein 0.5s, fadeout 0.5s 1.5s;
animation: fadein 0.5s, fadeout 0.5s 5s;
}
/* Animations to fade the snackbar in and out */
#-webkit-keyframes fadein {
from {bottom: 50%; opacity: 0;}
to {bottom: 50%; opacity: 0.7;}
}
#keyframes fadein {
from {bottom: 50%; opacity: 0;}
to {bottom: 50%; opacity: 0.7;}
}
#-webkit-keyframes fadeout {
from {bottom: 50%; opacity: 0.7;}
to {bottom: 50%; opacity: 0;}
}
#keyframes fadeout {
from {bottom: 50%; opacity: 0.7;}
to {bottom: 50%; opacity: 0;}
}
.ajax-loader {
visibility: hidden;
background-color: rgba(0,0,0,0.2);
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
}
.ajax-loader img {
position: relative;
top:50%;
left:50%;
}
.toggle{
background-color: #4285f4;
color: white;
padding: 5px;
border-radius: 5px;
border: 0;
margin-left: 18px;
}
#items{
list-style:none;
margin:0px;
margin-top:4px;
padding-left:10px;
padding-right:10px;
padding-bottom:3px;
font-size:17px;
color: #333333;
}
hr { width: 85%;
background-color:#E4E4E4;
border-color:#E4E4E4;
color:#E4E4E4;
}
#cntnr{
display:none;
position:fixed;
border:1px solid #B2B2B2;
width:180px;
background:#F9F9F9;
box-shadow: 3px 3px 2px #E9E9E9;
border-radius:4px;
}
#items li{
padding: 3px;
padding-left:10px;
}
#items :hover{
color: white;
background:#284570;
border-radius:2px;
}
Thank you,
Your can solve the issue by setting $("#cntnr").css({"left": e.pageX-3, "top": e.pageY-3}); so then mouse cursor will appear within the contextmenu and...
function setInputSelection(input, startPos, endPos) {
input.focus();
if (typeof input.selectionStart != "undefined") {
input.selectionStart = startPos;
input.selectionEnd = endPos;
} else if (document.selection && document.selection.createRange) {
// IE branch
input.select();
var range = document.selection.createRange();
range.collapse(true);
range.moveEnd("character", endPos);
range.moveStart("character", startPos);
range.select();
}
}
$("[id*='headline']").bind("contextmenu", function(e) {
e.preventDefault();
$("#cntnr").css({"left": e.pageX-3, "top": e.pageY-3});
$("#cntnr").fadeIn(200, startFocusOut);
});
function startFocusOut() {
$(document).on("click", function() {
$("#cntnr").hide();
$(document).off("click");
});
}
$("#items > li").click(function() {
$("#headline1").val($(this).text().replace("fallback", " "));
var input = document.getElementById("headline1");
setInputSelection(input, 9, 10);
});
#items {
list-style: none;
margin: 0px;
margin-top: 4px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 3px;
font-size: 17px;
color: #333333;
}
hr {
width: 85%;
background-color: #E4E4E4;
border-color: #E4E4E4;
color: #E4E4E4;
}
#cntnr {
display: none;
position: fixed;
border: 1px solid #B2B2B2;
width: 180px;
background: #F9F9F9;
box-shadow: 3px 3px 2px #E9E9E9;
border-radius: 4px;
}
li {
padding: 3px;
padding-left: 10px;
}
#items :hover {
color: white;
background: #284570;
border-radius: 2px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Demo<input id="headline11">
<div id='cntnr'>
<ul id='items'>
<li>{Keyword:fallback}</li>
<li>{KeyWord:fallback}</li>
</ul>
</div>

CSS ribbon menu causing gap between content and header

I am not sure how to remove the large gap between my header and the beginning of the slideshow. pivotalpixels.com/colusa_fair/ I believe that the problem is something to do with the ribbon navigation but after trying tons of different things I do not know how to move the content up without the recent news moving up to right underneath the navigation bar, which needs to be under the slideshow as it currently is.
css is below
Thanks I appreciate any help!
#charset "utf-8";
/* CSS Document */
body {
margin:0px;
padding:0px;
background-color:#c4c0be;
background-image:url(../images/bluewoodbkgd.jpg);
margin:0px; padding:0px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
color:#7f7d78;
font-size:13px;
line-height:19px;
}
h1{}
h2 {
margin:0px 0px 10px 0px;
font-size:36px;
font-family:Helvetica, Arial, Sans-serif;
color:#000000;
font-weight: bold;
}
h3{font-size:16px; color: #142b4e; font-weight: bold;}
small {
color:#595856;
font-weight:bold;
font-size:11px;
display:block;
margin-bottom:15px;
}
a {
color:#007de2;
text-decoration:none;
}
a:hover { text-decoration:underline; }
p { margin: 0px 0px 15px 0px; }
#main {
min-height: 500px;
}
#footer {
color:white;
}
.container {
width:994px;
margin:0 auto;
}
#header {
padding-top:10px;
margin: 0;
}
#logo h1 {
margin:0px;
display:block;
text-indent:-9999px;
}
/* Fix up IE6 PNG Support */
img, #logo { behavior: url(scripts/iepngfix.htc); }
#logo {
position: absolute;
top:-25px;
background-image:url(../images/logo_colusa.png);
background-repeat:no-repeat;
margin: 0 0 0 25px;
width:240px;
height:147px;
}
#navigation_container {
width: 994px;
margin: 0;
}
ul#menu{
margin: 0;
top:10px;
position: absolute;
left: 300px;
}
ul#menu li {
list-style: none;
float: left;
display: inline;
}
ul#menu li a {
text-shadow: 0 2px 1px rgba(0,0,0,0.5);
text-decoration: none;
margin: 0 10px 0 0;
color:#FFF;
font: 18px/27px 'ArvoRegular', Arial, sans-serif;
line-height: 28px;
}
ul#menu li a.active, ul#menu li a:hover {
color:#5a8c35;
text-decoration: underline;
margin-top: 2px;
}
.rectangle {
background: #142b4e;
height: 52px;
position: relative;
-moz-box-shadow: 0px 0px 4px rgba(0,0,0,0.55);
-webkit-box-shadow: 0px 0px 4px rgba(0,0,0,0.55);
box-shadow: 0px 0px 4px rgba(0,0,0,0.55);
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
z-index: 500; /* the stack order: foreground */
margin: 35px 0 0 0;
}
.l-triangle-top {
border-color: #142b4e transparent transparent;
border-style:solid;
border-width:50px;
height:0px;
width:0px;
position: relative;
float: left;
top: 0px;
left: -50px;
}
.l-triangle-bottom {
border-color: transparent transparent #142b4e;
border-style:solid;
border-width:50px;
height:0px;
width:0px;
position: relative;
float: left;
top: -49px;
left: -150px;
}
.r-triangle-top {
border-color: #142b4e transparent transparent;
border-style:solid;
border-width:50px;
height:0px;
width:0px;
position: relative;
float: right;
right: -45px;
top: -50px;
}
.r-triangle-bottom {
border-color: transparent transparent #142b4e;
border-style:solid;
border-width:50px;
height:0px;
width:0px;
position: relative;
float: right;
top: -100px;
right: -145px;
}
#sec_navigation_container {
width: 600px;
margin: 0 0 0 255px;
}
ul#menu_sec{
margin: 0;
top:10px;
position: absolute;
left: 110px;
}
ul#menu_sec li {
list-style: none;
float: left;
display: inline;
}
ul#menu_sec li a {
text-shadow: 0 2px 1px rgba(0,0,0,0.5);
text-decoration: none;
margin: 0 10px 0 0;
color:#FFF;
font: 18px/27px 'ArvoRegular', Arial, sans-serif;
line-height: 28px;
}
ul#menu_sec li a.active, ul#menu_sec li a:hover {
color:#ce6536;
text-decoration: underline;
margin-top: 2px;
}
.rectangle_mainsec {
background: #ce6536;
height: 52px;
position: relative;
z-index: 500; /* the stack order: foreground */
margin: 0;
}
.l-triangle-top-sec {
border-color: #ce6536 transparent transparent;
border-style:solid;
border-width:50px;
height:0px;
width:0px;
position: relative;
float: left;
top: 0px;
left: -50px;
}
.l-triangle-bottom-sec {
border-color: transparent transparent #ce6536;
border-style:solid;
border-width:50px;
height:0px;
width:0px;
position: relative;
float: left;
top: -49px;
left: -150px;
}
.r-triangle-top-sec {
border-color: #ce6536 transparent transparent;
border-style:solid;
border-width:50px;
height:0px;
width:0px;
position: relative;
float: right;
right: -125px;
top: -53px;
}
.r-triangle-bottom-sec {
border-color: transparent transparent #ce6536;
border-style:solid;
border-width:50px;
height:0px;
width:0px;
position: relative;
float: right;
top: -100px;
right: -225px;
}
/*
Block-Styles
*/
.block {
margin-bottom:20px;
}
.block_inside {
padding:0 20px;
}
.image_block {
border:1px solid #557f9d;
background-color:#ffffff;
padding:5px;
float:left;
}
.image_block img {
border:1px solid #b5b5b5;
}
#block_slideshow{
overflow: hidden;
width: 100%;
}
.upcoming_events {
float:left;
width:315px;
height: 325px;
margin-left:30px;
padding: 10px;
border: 1px solid #557f9d;
background-color:#ffffff;
}
.upcoming_events h2, #event_items h2{
position: relative;
width: 90%;
font: 24px/27px 'DancingScriptOTRegular', Arial, sans-serif;
padding: 6px 20px 6px 30px;
margin: 4px 10px 10px -31px;
color: #fff;
background-color: #5a8c35;
text-shadow: 0px 1px 2px #7c7c7c;
-webkit-box-shadow: 0px 2px 2px 0px #295e04;
-moz-box-shadow: 0px 2px 2px 0px #295e04;
box-shadow: 0px 2px 1px 0px #295e04;
border: 1px solid #295e04;
}
.upcoming_events h2:before, #event_items h2:before
{
content: ' ';
position: absolute;
width: 0;
height: 0;
right: -2px;
top: 0px;
border-style: solid;
border-width:20px;
border-color: transparent #fff transparent transparent;
}
.upcoming_events h2:after, #event_items h2:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: 0px;
top: 100%;
border-width: 5px 10px;
border-style: solid;
border-color: #295e04 #295e04 transparent transparent;
}
.block_content{ padding: 10px;}
#block_recent{overflow:auto;
margin-bottom:20px; }
#event_items {
width:560px;
margin-right:25px;
margin-left: 20px;
float:left;
padding: 10px;
border: 1px solid #557f9d;
background-color:#ffffff;
}
#countdown {
float:right;
width:332px;
height: 175px;
margin-right: 20px;
margin-bottom:20px;
background-image: url(../images/countdown.png);
background-repeat:no-repeat;
}
#block_right {
float:right;
width:332px;
height: 175px;
margin-right: 20px;
margin-bottom: 20px;
background-image: url(../images/countdown.png);
background-repeat:no-repeat;
}
.mini_event_item {
width: 48%;
margin: 5px 0px 10px 10px;
float: left;
}
.date{color: #5a8c35; font-weight: bold;}
.mini_event_item .block_inside {
padding:25px 30px 15px 30px;
}
.mini_event_item .thumbnail { float:left; margin-right:20px; border:1px solid #979390; }
#sponsors{margin: 10px 0px; padding: 10px; height: 95px; background-color: #142b4e; }
.sponsor_item,footer_item{float: left; margin-right: 10px; padding: 10px; height: 70px; background-color: #ffffff; border: 1px solid #000;}
#footer {
font: 18px/27px 'ArvoRegular', Arial, sans-serif;
}
.footer_column {
float:left;
width:300px;
margin-right:10px;
}
#footer .long {
width:670px;
}
#footer h3 {
color:#fff;
text-shadow: 1px 1px 1px #000;
}
#footer h4{
font-size: 16px;
text-shadow: 1px 1px 1px #000;
}
#footer p{ font-size: 12px;
}
ul.industry_links{
padding: 10px;
display: inline;
}
ul.industry_links li {
float:left;
list-style:none;
text-align: center;
}
ul.industry_links li a{
display:block;
width: 135px;
height: 79px;
margin-right: 10px;
padding: 10px;
background-color: #ffffff;
border: 1px solid #039;
text-align: center;
}
.footer_column ul li, .footer_column ul {
list-style:none;
margin:0px;
padding:0px;
font-size: 12px;
}
The r-triangle-top-sec and r-triangle-bottom-sec elements that generate the "ribbon" effect are using the "CSS Triangle Trick" which requires a large border size (50px in this case).
This is causing a lot of extra height due to the invisible border rendering.
One quick fix is to position:absolute these elements.
First, make the container position:relative so the child elements will use it as a positioning reference point
#sec_navigation_container{
position:relative /* Add */
/*...*/
}
Add this to r-triange-top-sec
position: absolute;
top: 0;
right: -50px;
Add this to r-triange-bottom-sec
position: absolute;
top: -50px;
right: -50px;
That should get rid of some of that spacing. Applying this idea to the upper "ribbon" might help as well.
UPDATE
Turns out, the exact same code can be used for the blue ribbon as well. Rinse/repeate the above code but for #navigation_container, l-triangle-top and l-triangle-bottom.
That will move your "slideshow" content flush to the navigation.
You can then add some margin to your #header element such as:
margin-bottom:2em;
to push that "slideshow" back down to a desired separation. (adjust the valid as desired)
note I just eyeballed the placement of the ribbon. Please adjust top/right position as needed for your design
I hope that helps!

CSS background image not loading, being overridden?

The background images for directional & navigational buttons are not loading. Firebug shows the images being overridden and states "the files are not being loaded". If I disable the "text-indent", I can see the plain old line items, but am looking for the images, so it looks nice and pretty!
I've been staring at this for too long now, can anyone help me see the problem? Thank you!
html
<div class="flex-container">
<div class="flexslider">
<ul class="slides">
<li><img src="images/tah_home.jpg" alt="taylor art house home page" width="600" height="320"/>
<p class="flex-caption">Taylor Art House Home Page</p></li>
<li><img src="images/tah_blog.jpg" alt="taylor art house blog page" width="600" height="320" />
<p class="flex-caption">We created a blog that fits seemlessly into Taylor Art House's look</p></li>
<li><img src="images/tah_artwork_page.jpg" alt="taylor art house art page" width="600" height="320" />
<p class="flex-caption">One of Taylor Art House's gallery pages, using a Wordpress plugin</p></li>
<li><img src="images/tah_arch_portfolio.jpg" alt="jon taylor architecture portfolio page" width="600" height="320" />
<p class="flex-caption">We created links to toggle from TAH to Jon Taylor Architecture</p></li>
</ul>
</div><!--end flexsider-->
</div><!--end flex-container-->
header script
<script src="jquery.flexslider.js"></script>
<script type="text/javascript" charset="utf-8">
$(window).load(function() {
$('.flexslider').flexslider({
animation: "slide",
slideshow: false,
controlNav: true,
manualControls: ".flex-control-nav li a",
controlsContainer: ".flex-container"
});
});
</script>
flexslider css
/*
* jQuery FlexSlider v1.8
* http://www.woothemes.com/flexslider/
*
* Copyright 2012 WooThemes
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
/* Browser Resets */
.flex-container a:active,
.flexslider a:active,
.flex-container a:focus,
.flexslider a:focus {outline: none;}
.slides,
.flex-control-nav,
.flex-direction-nav {margin: 0; padding: 0; list-style: none;}
/* FlexSlider Necessary Styles
*********************************/
.flexslider {
width: 100%;
margin: 0;
padding: 0;
}
.flexslider .slides > li {
display: none;
-webkit-backface-visibility: hidden;
}
/* Hide the slides before the JS is loaded. Avoids image jumping */
.flexslider .slides img {
max-width: 100%;
display: block;
}
.flex-pauseplay span {
text-transform: capitalize;
}
/* Clearfix for the .slides element */
.slides:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
html[xmlns] .slides {
display: block;
}
* html .slides {
height: 1%;
}
/* No JavaScript Fallback */
/* If you are not using another script, such as Modernizr, make sure you
* include js that eliminates this class on page load */
.no-js .slides > li:first-child {
display: block;
}
/* FlexSlider Default Theme
*********************************/
.flexslider {
width: 600px;
background: #fff;
border: 4px solid #999;
position: relative;
margin: 30px 0;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px; zoom: 1;
}
.flexslider .slides {
zoom: 1;
}
.flexslider .slides > li {
position: relative;
}
/* Suggested container for "Slide" animation setups. Can replace this with your own, if you wish */
.flex-container {
zoom: 1;
position: relative;
margin-left:100px;
}
/* Caption style */
/* IE rgba() hack */
.flex-caption {
background:none;
-ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C000000,endColorstr=#4C000000);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C000000,endColorstr=#4C000000);
zoom: 1;
}
.flex-caption {
width: 96%;
padding: 2%;
margin: 0;
position: absolute;
left: 0;
bottom: 0;
background: rgba(0,0,0,.3);
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,.3);
font-size: 14px;
line-height: 18px;
}
/* Direction Nav */
.flex-direction-nav {
height: 0;
}
.flex-direction-nav li a {
width: 52px;
height: 52px;
margin: -13px 0 0;
display: block;
background: url(theme/bg_direction_nav.png) no-repeat;
position: absolute;
top: 50%;
cursor: pointer;
text-indent: -999em;
}
.flex-direction-nav li .next {
background-position: -52px 0; right: -21px;
}
.flex-direction-nav li .prev {
left: -20px;
}
.flex-direction-nav li .disabled {
opacity: .3;
filter:alpha(opacity=30);
cursor: default;
}
/* Control Nav */
.flex-control-nav {
width: 100%;
position: absolute;
bottom: -30px;
text-align: center;
}
.flex-control-nav li {
margin: 0 0 0 5px;
display: inline-block;
zoom: 1;
*display: inline;
}
.flex-control-nav li:first-child {
margin: 0;
}
.flex-control-nav li a {
width: 13px;
height: 13px;
display: block;
background: url(theme/bg_control_nav.png) no-repeat;
cursor: pointer;
text-indent: -999em;
}
.flex-control-nav li a:hover {
background-position: 0 -13px;
}
.flex-control-nav li a.active {
background-position: 0 -26px;
cursor: default;
}
styles.css
/* CSS Document for Kajort Designs */
/* ----- RESETS ----- */
* {
margin: 0;
padding: 0;
}
img {
border: none;
}
a {
text-decoration: none;
color: #000;
}
li {
list-style-type: none;
}
h1 {
margin-bottom: 20px;
margin-top: 20px;
font-size: 20px;
color: #999;
}
h2 {
font-size: 18px;
}
/* ----- GENERAL ----- */
body {
line-height: 19px;
font-size: 12px;
text-align: center; /* centers everything in IE */
font: 16px Arial, Helvetica, sans-serif;
color: #8A8A8A;
/* background-image:url(../images/bg_kd2.jpg);
*/}
#wrapper {
width: 960px;
margin: 30px auto; /* centers wrapper in most browsers */
text-align:left; /* resets IE center hack */
background-color:rgba(255,255,255,0.8);
padding: 20px;
}
/* ----- HEADER ----- */
/*#header {
width:250px;
height: 40px;
float: left;
font-size:24px;
}
#header a:hover {
border-bottom: 2px solid #ddd;
}*/
/* ----- NAVIGATION ----- */
#navigation {
width: 430px;
height: 40px;
float: right;
margin-top: 30px;
}
#navigation a:hover {
border-bottom: 2px solid #ddd;
}
#navigation li {
display: inline;
list-style-type: none;
padding-right: 10px;
}
#navigation-items li.main-on a {
border-bottom: 2px solid #ddd;
font-size:18px;
}
/* ----- MIDDLE ----- */
#main {
width: 104%;
background: #fff;
background: -moz-linear-gradient(top, #fff, #fff);
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#fff));
padding: 10px 20px;
margin-left: -40px;
margin-top: 80px;
position: relative;
-moz-box-shadow: 1px 1px 3px #292929;
-webkit-box-shadow: 1px 1px 3px #292929;
}
#main .arrow {
width: 0; height: 0;
line-height: 0;
border-left: 20px solid transparent;
border-top: 10px solid #999;
top: 100%;
left: 0;
position: absolute;
}
#homecontent {
margin: 25px 0 25px 200px;
}
#content {
width: 800px;
margin-left: 100px;
overflow: hidden;
}
#servicescontent {
width: 700px;
margin-left: 40px;
}
#tools {
background-color:#EDEBDE;
padding: 20px 0 10px 20px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
#seo {
background-color:#EDEBDE;
padding: 20px 0 10px 20px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
.service_list {
margin: 10px 0 15px 30px;
}
.service_list li {
padding-bottom: 10px;
list-style-type:circle;
}
#panels_nav_st {
color:#666;
font-size:16px;
border-top: 2px solid #669933;
padding-top: 10px;
margin-top: 10px;
}
#panels_nav_st a {
color:#666;
font-size:16px;
}
#panels_nav_st a:hover {
color:#669933;
font-size:16px;
}
#panels_nav_ain {
color:#666;
font-size:16px;
border-top: 2px solid #91A6C1;
padding-top: 10px;
margin-top: 10px;
}
#panels_nav_ain a {
color:#666;
font-size:16px;
}
#panels_nav_ain a:hover {
color:#91A6C1;
font-size:16px;
}
#panels_nav_bees {
color:#666;
font-size:16px;
border-top: 2px solid #FC0;
padding-top: 10px;
margin-top: 10px;
}
#panels_nav_bees a {
color:#666;
font-size:16px;
}
#panels_nav_bees a:hover {
color:#FC0;
font-size:16px;
}
#panels_nav_ptc {
color:#666;
font-size:16px;
border-top: 2px solid #a1c857;
padding-top: 10px;
margin-top: 10px;
}
#panels_nav_ptc a {
color:#666;
font-size:16px;
}
#panels_nav_ptc a:hover {
color:#a1c857;
font-size:16px;
}
#panels_nav_tah {
color:#666;
font-size:16px;
border-top: 2px solid #FF7C5F;
padding-top: 10px;
margin-top: 10px;
}
#panels_nav_tah a {
color:#666;
font-size:16px;
}
#panels_nav_tah a:hover {
color:#FF7C5F;
font-size:16px;
}
#visit {
margin: 20px 0 20px 0;
width: 600px;
float: left;
color: #666;
}
#visit a {
text-decoration:underline;
}
#visit_st a:hover {
text-decoration:none;
color: #669933;
}
#visit_ain a:hover {
text-decoration:none;
color: #91A6C1;
}
#visit_bees a:hover {
text-decoration:none;
color: #fc0;
}
#visit_ptc a:hover {
text-decoration:none;
color: #a1c857;
}
#visit_tah a:hover {
text-decoration:none;
color: #FF7C5F;
}
#thumbnails li {
display: inline;
margin: 0 40px 40px 0;
}
#thumbnails img {
border: 1px solid #666;
padding: 5px 5px 10px 5px;
}
/* ----- FOOTER ----- */
#footer {
clear: both;
height: 50px;
margin-bottom: 15px;
margin-top: 60px;
text-align: center;
font-size: small;
color: #776E6E;
/* padding-top: 15px;
border-top: 3px solid #999;
*/
}
#footer a {
text-decoration: none;
color: #776E6E;
}
#footer a:hover {
border-bottom: 2px solid #ddd;
}
/* ----- NOT USED, BUT SAVE IN CASE ----- */
/*
#sidebar {
float: left;
color: #666;
padding: 10px 0 50px 50px;
font-size: 16px;
}
#sidebar li {
/* padding-bottom: 20px;
margin: 0 5px 15px 15px;
}
#sidebar a:hover {
color: #ddd;
border-bottom: 2px solid #ddd;
}
#sidebar h3 {
margin-bottom: 30px;
color: #333;
}
*/
Thank you!
The flexslider css is referring to the directional & navigational images in the theme folder. See below...
.flex-direction-nav li a {
...
background: url(theme/bg_direction_nav.png) no-repeat;
...
}
.flex-control-nav li a {
...
background: url(theme/bg_control_nav.png) no-repeat;
...
}
Point the url's to the correct location of the images and it'll work.

Resources