My post carousel has two arrows on the side. I have a background in the shape of a circle for these arrows. I can't figure out how to center the arrows inside the circles. Does anyone know how I could do this. Here is the link to a screenshot of what it currently looks like -
Here is my css
/*
* Owl Carousel Owl Demo Theme
* v1.3.3
*/
.owl-theme .owl-controls{
margin-top: 50px;
text-align: center;
}
/* Styling Next and Prev buttons */
.owl-theme .owl-controls .owl-buttons div{
color: #FFF;
display: inline-block;
zoom: 1;
*display: inline;/*IE7 life-saver */
margin: 5px;
padding: 3px 10px;
font-size: 12px;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
background: #869791;
filter: Alpha(Opacity=50);/*IE7 fix*/
opacity: 0.5;
}
/* Clickable class fix problem with hover on touch devices */
/* Use it for non-touch hover action */
.owl-theme .owl-controls.clickable .owl-buttons div:hover{
filter: Alpha(Opacity=100);/*IE7 fix*/
opacity: 1;
text-decoration: none;
}
/* Styling Pagination*/
.owl-theme .owl-controls .owl-page{
display: inline-block;
zoom: 1;
*display: inline;/*IE7 life-saver */
}
.owl-theme .owl-controls .owl-page span{
display: block;
width: 12px;
height: 12px;
margin: 5px 7px;
filter: Alpha(Opacity=50);/*IE7 fix*/
opacity: 0.5;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
background: #869791;
}
.owl-theme .owl-controls .owl-page.active span,
.owl-theme .owl-controls.clickable .owl-page:hover span{
filter: Alpha(Opacity=100);/*IE7 fix*/
opacity: 1;
}
/* If PaginationNumbers is true */
.owl-theme .owl-controls .owl-page span.owl-numbers{
height: auto;
width: auto;
color: #FFF;
padding: 2px 10px;
font-size: 12px;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
}
/* preloading images */
.owl-item.loading{
min-height: 150px;
background: url(AjaxLoader.gif) no-repeat center center
}
/* Navigation */
.owl-prev, .owl-next {
position:absolute;
top:45%;
padding: 5px;
margin:0;
z-index:100;
font-size:3rem;
cursor:pointer;
color:#000000;
}
.owl-prev {
left:20px;
opacity: 1 !important;
}
.owl-next {
right:20px;
opacity: 1 !important;
display: block;
}
.owl-theme .owl-controls .owl-buttons div{
color: #555;
display: inline-block;
zoom: 1;
*display: inline;/*IE7 life-saver */
font-size: 3rem;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
background: #ffffff;
filter: Alpha(Opacity=100);/*IE7 fix*/
opacity: 1;
margin-top:-32px;
width:40px;
height:40px;
}
.owl-theme .owl-controls .owl-buttons div:hover {
color:#000000;
opacity: 1 !important;
}
Without your markup, it's a bit of an educated guess, but after looking at the owl carousel demo, I believe I can help.
The elements are addressed in this CSS (from your question):
.owl-theme .owl-controls .owl-buttons div {
color: #555;
display: inline-block;
/* remove this! */
zoom: 1;
/* and this! */
*display: inline;/*IE7 life-saver */
font-size: 3rem;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
background: #ffffff;
/* and remove this! */
filter: Alpha(Opacity=100);/*IE7 fix*/
opacity: 1;
margin-top:-32px;
width:40px;
height:40px;
}
Assuming that your arrows are text and not images, then all you need to do is add line-height to your css:
line-height: 40px; /* adjust as needed */
NOTE, if you're supporting IE7, I would recommend you stop. IE7 has been dead for some time, and is not worth the effort.
Modified CSS to vertically center the arrows:
.owl-theme .owl-controls .owl-buttons div {
color: #555;
display: inline-block;
font-size: 3rem;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
background: #ffffff;
opacity: 1;
margin-top:-32px;
width:40px;
height:40px;
line-height: 40px; /* adjust as needed */
/* may or may not need this */
text-align: center;
}
Also note that your CSS could be simplified - your owl-prev and owl-next CSS is the same / conflicting with the .owl-theme .owl-controls .owl-buttons div css.
Related
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.
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>
My website Direction(attribute in body) is RTL.
When i'm trying to implement the FlexSlider it's causing the div to be blank.
Like this -
Blanck div
But if im just removing the RTL attribute from the body it's arrange perfectly like this:
arrange fine
The question is how can i bypass it? I just cant figure it out.. i tried change the Flex css but still no good..
this is the css :
/*
* jQuery FlexSlider v2.2.0
* http://www.woothemes.com/flexslider/
*
* Copyright 2012 WooThemes
* Free to use under the GPLv2 license.
* http://www.gnu.org/licenses/gpl-2.0.html
*
* Contributing author: Tyler Smith (#mbmufffin)
*/
/* 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;}
/* Icon Fonts
*********************************/
/* Font-face Icons */
#font-face {
font-family: 'flexslider-icon';
src:url('fonts/flexslider-icon.eot');
src:url('fonts/flexslider-icon.eot?#iefix') format('embedded-opentype'),
url('fonts/flexslider-icon.woff') format('woff'),
url('fonts/flexslider-icon.ttf') format('truetype'),
url('fonts/flexslider-icon.svg#flexslider-icon') format('svg');
font-weight: normal;
font-style: normal;
}
/* FlexSlider Necessary Styles
*********************************/
.flexslider {margin: 0; padding: 0;}
.flexslider .slides > li {display: none; -webkit-backface-visibility: hidden; text-align:right;direction:rtl;} /* Hide the slides before the JS is loaded. Avoids image jumping */
.flexslider .slides img {max-width: 232px;
height: 118px;
margin: 0 auto;
display: block;
border-radius: 5px;
margin-bottom: 5px;}
.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 { margin: 0 0 60px; background: #fff; border: 4px solid #fff; position: relative; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.2); -moz-box-shadow: 0 1px 4px rgba(0,0,0,.2); -o-box-shadow: 0 1px 4px rgba(0,0,0,.2); box-shadow: 0 1px 4px rgba(0,0,0,.2); zoom: 1; }
.flex-viewport { max-height: 2000px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -o-transition: all 1s ease; transition: all 1s ease; }
.loading .flex-viewport { max-height: 300px; }
.flexslider .slides { zoom: 1; }
/* Direction Nav */
.flex-direction-nav {*height: 0;}
.flex-direction-nav a { text-decoration:none; display: block; width: 40px; height: 40px; margin: -20px 0 0; position: absolute; top: 50%; z-index: 10; overflow: hidden; opacity: 0; cursor: pointer; color: #a5d4ff; text-shadow: 1px 1px 0 rgba(255,255,255,0.3); -webkit-transition: all .3s ease; -moz-transition: all .3s ease; transition: all .3s ease; }
.flex-direction-nav .flex-prev { left: -50px; }
.flex-direction-nav .flex-next { right: -50px; text-align: right; }
.flexslider:hover .flex-prev { opacity: 0.7; left: 10px; }
.flexslider:hover .flex-next { opacity: 0.7; right: 10px; }
.flexslider:hover .flex-next:hover, .flexslider:hover .flex-prev:hover { opacity: 1; }
.flex-direction-nav .flex-disabled { opacity: 0!important; filter:alpha(opacity=0); cursor: default; }
.flex-direction-nav a:before { font-family: "flexslider-icon"; font-size: 40px; line-height:1; display: inline-block; content: '\f001'; }
.flex-direction-nav a.flex-next:before { content: '\f002'; }
/* Pause/Play */
.flex-pauseplay a { display: block; width: 20px; height: 20px; position: absolute; bottom: 5px; left: 10px; opacity: 0.8; z-index: 10; overflow: hidden; cursor: pointer; color: #000; }
.flex-pauseplay a:before { font-family: "flexslider-icon"; font-size: 20px; display: inline-block; content: '\f004'; }
.flex-pauseplay a:hover { opacity: 1; }
.flex-pauseplay a.flex-play:before { content: '\f003'; }
/* Control Nav */
.flex-control-nav {width: 100%; position: absolute; bottom: -40px; text-align: center;}
.flex-control-nav li {margin: 0 6px; display: inline-block; zoom: 1; *display: inline;}
.flex-control-paging li a {width: 11px; height: 11px; display: block; background: #666; background: rgba(0,0,0,0.5); cursor: pointer; text-indent: -9999px; -webkit-border-radius: 20px; -moz-border-radius: 20px; -o-border-radius: 20px; border-radius: 20px; -webkit-box-shadow: inset 0 0 3px rgba(0,0,0,0.3); -moz-box-shadow: inset 0 0 3px rgba(0,0,0,0.3); -o-box-shadow: inset 0 0 3px rgba(0,0,0,0.3); box-shadow: inset 0 0 3px rgba(0,0,0,0.3); }
.flex-control-paging li a:hover { background: #333; background: rgba(0,0,0,0.7); }
.flex-control-paging li a.flex-active { background: #000; background: rgba(0,0,0,0.9); cursor: default; }
.flex-control-thumbs {margin: 5px 0 0; position: static; overflow: hidden;}
.flex-control-thumbs li {width: 25%; float: left; margin: 0;}
.flex-control-thumbs img {width: 100%; display: block; opacity: .7; cursor: pointer;}
.flex-control-thumbs img:hover {opacity: 1;}
.flex-control-thumbs .flex-active {opacity: 1; cursor: default;}
#media screen and (max-width: 860px) {
.flex-direction-nav .flex-prev { opacity: 1; left: 10px;}
.flex-direction-nav .flex-next { opacity: 1; right: 10px;}
}
You can use this updated version of FlexSlider that has RTL support: https://github.com/layalk/FlexSlider
$('#flexslider').flexslider({rtl:true});
You also need to include the flexslider-rtl.css file after the flexslider.css file.
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>
I recently added some css to my website, it works perfectly fine in all browsers except IE 7 and lower, I'm not really sure why and I am not css guru (yet ;)) and my css might be wrong, but could you please explain what makes IE7 and lower mess up the appearance of the website? If you compare it in IE8 or any other browser and IE7 you'll see what I'm talking about. Can you point where the issues are?
webpage: http://inelmo.com/inelmo
CSS of the sidebar: (I only included this, because problems started once I added this part of the code)
#sidebar {
width: 440px;
float: right;
}
/* Navigation Menu */
#navigationMenu {
width: 50px;
position: absolute;
z-index: 99;
}
#navigationMenu li {
list-style: none;
height: 39px;
padding: 2px;
width: 40px;
}
#navigationMenu span {
width: 0;
left: 38px;
padding: 0;
position: absolute;
overflow: hidden;
font-size: 18px;
font-weight: bold;
letter-spacing: 0.6px;
white-space: nowrap;
line-height: 39px;
-webkit-transition: 0.25s;
-moz-transition: 0.25s;
-o-transition: 0.25s;
-ms-transition: 0.25s;
transition: 0.25s;
}
#navigationMenu a {
background: url("../images/nav_bg.png") no-repeat;
height: 39px;
width: 38px;
display: block;
position: relative;
text-decoration: none;
}
#navigationMenu a:hover span {
width: auto;
padding: 0 20px;
overflow: visible;
}
#navigationMenu a:hover {
text-decoration: none;
}
/* Home Button */
#navigationMenu .home {
background-position: 0 0;
}
#navigationMenu .home:hover {
background-position: 0 -39px;
}
#navigationMenu .home span {
background-color: #7da315;
color: #3d4f0c;
text-shadow: 1px 1px 0 #99bf31;
}
/* Categories Button */
#navigationMenu .categories {
background-position: -38px 0;
}
#navigationMenu .categories:hover {
background-position: -38px -39px;
}
#navigationMenu .categories span {
background-color: #1e8bb4;
color: #223a44;
text-shadow: 1px 1px 0 #44a8d0;
}
/* Top Button */
#navigationMenu .top {
background-position: -76px 0;
}
#navigationMenu .top:hover {
background-position: -76px -39px;
}
#navigationMenu .top span {
background-color: #c86c1f;
color: #5a3517;
text-shadow: 1px 1px 0 #d28344;
}
/* AntiTop Button */
#navigationMenu .antiTop {
background-position: -114px 0;
}
#navigationMenu .antiTop:hover {
background-position: -114px -39px;
}
#navigationMenu .antiTop span {
background-color: #af1e83;
color: #460f35;
text-shadow: 1px 1px 0 #d244a6;
}
/* Logo styling */
#logo {
width: 390px;
margin: 0 0 0 50px;
position: absolute;
z-index: -1;
}
/******/
#sideWrapper {
width: 437px;
background: url("../images/sidebar_strip.png") repeat-x;
padding: 15px 0 0 3px;
margin: 190px 0 0 0;
}
When using float:xxx you should also append display: inline to fix older IE behavior.
In IE6 :hover works only with <a>, fix: http://peterned.home.xs4all.nl/csshover.html
You seem to use position: absolute; without actually setting top/left/etc.
Use some kind of 'pngfix' like http://www.twinhelix.com/css/iepngfix/ to use transparent pngs.
Use google and sites like http://haslayout.net/ to find fun ie bugs.
Use a CSS reset
Add this code to the top of your CSS
Without an example of your code the best thing I could suggest to someone starting out is to comment out the above CSS line by line until you locate the exact CSS that breaks your layout. Another trick I use is to add background colors to everything so you can visually see where things are breaking.