• Hi,

    another day another problem. I recently installed a theme for the cyclone slider 2 plugin and I want to center the controls below the image. I don’t get it working :/

    I’ve figured out a solution but that’s not satisfying πŸ™

    here the files:
    [Unnecessary PHP removed]

    CSS file

    /*** Template Controls ***/
    .cycloneslider-template-controls{
    	z-index:2;
    }
    .cycloneslider-template-controls img{
        display:block;
    }
    .cycloneslider-template-controls .cycloneslider-controls{
        position: absolute;
    	left: 42%;
        bottom:-27px;
        z-index:102;
        padding:5px 0;
        height:16px;
    }
    .cycloneslider-template-controls .cycloneslider-controls-inner{
        padding:0 20px;
    }
    .cycloneslider-template-controls .cycloneslider-play-pause{
        display:block;
        float:right;
        margin:0 10px;
        width:14px;
        height:16px;
        background: url($tpl/images/sprite-controls.png) no-repeat -118px -3px;
        text-indent:-99999px;
        cursor:pointer;
    }
    
    .cycloneslider-template-controls .cycloneslider-play-pause:hover{
        background-position:-118px -25px;
    }
    .cycloneslider-template-controls .cycloneslider-play-pause.play{
        background-position:-61px -3px;
    }
    .cycloneslider-template-controls .cycloneslider-play-pause.play:hover{
        background-position:-61px -25px;
    }
    .cycloneslider-template-controls .cycloneslider-prev,
    .cycloneslider-template-controls .cycloneslider-next{
        display:block;
        float:right;
        width:18px;
        height:16px;
        background: url($tpl/images/sprite-controls.png) no-repeat;
        text-indent:-99999px;
    }
    .cycloneslider-template-controls .cycloneslider-prev{
        background-position:-2px -3px;
        margin-left:7px;
    }
    .cycloneslider-template-controls .cycloneslider-next{
        background-position:-173px -3px;
    }
    .cycloneslider-template-controls .cycloneslider-prev:hover{
        background-position:-2px -25px;
    }
    .cycloneslider-template-controls .cycloneslider-next:hover{
        background-position:-173px -25px;
    }
    .cycloneslider-template-controls .cycloneslider-pager{
        float:right;
        height:16px;
        overflow:hidden;
    }
    .cycloneslider-template-controls .cycloneslider-pager span {
        display: block;
        float:left;
        margin: 0 3px;
        width: 15px;
        height: 16px;
        background: url($tpl/images/sprite-controls.png) no-repeat -235px -3px;
        text-indent: -99999px;
        font-size: 0;
        line-height: 0;
        opacity:0.3;
    }
    .cycloneslider-template-controls .cycloneslider-pager span.cycle-pager-active{
        background-position:-235px -25px;
        opacity:1;
    }
    .cycloneslider-template-controls .cycloneslider-caption{
        position:absolute;
        bottom:0;
        left:10%;
        z-index:99;
        width:50%;
        height:40%;
        color:#fefefe;
    }
    .cycloneslider-template-controls .cycloneslider-caption-title{
        display:inline-block;
        margin-bottom:5px;
        padding:10px 5px;
        background: url($tpl/images/bg-caption.png);
        text-transform:uppercase;
        font-size:20px;
        line-height:1;
    }
    .cycloneslider-template-controls .cycloneslider-caption-description{
        padding: 5px;
        background: url($tpl/images/bg-caption.png);
        font-size:12px;
        line-height:1.5;
    }
    
    /* Optimized for Mobile Devices */
    @media (max-width: 480px) {
    	.cycloneslider-template-controls .cycloneslider-controls{
            width:100%;
            right:0;
        }
        .cycloneslider-template-controls .cycloneslider-next{
            margin-right:10px;
        }
        .cycloneslider-template-controls .cycloneslider-caption{
            left:0;
            bottom:0;
            height:auto;
            width:100%;
        }
        .cycloneslider-template-controls .cycloneslider-caption-title{
            display:block;
            margin-bottom:0;
        }
        .cycloneslider-template-controls .cycloneslider-pager{
            max-width:50%;
            float:left;
        }
    }

    any help would be appreciated πŸ™‚

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Moritz83

    (@moritz83)

    just to clarify:

    I am talking about the part with

    .cycloneslider-template-controls .cycloneslider-controls{
        position: absolute;
    	left: 42%;
        bottom:-27px;
        z-index:102;
        padding:5px 0;
        height:16px;
    }

    which should be the outer div container

    Thread Starter Moritz83

    (@moritz83)

    Well tried to do this by using the width of the image but it failed.
    I know I have to use % but I don’t get it …. and the author is not available. Wrote him a mail a few days ago :/

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Have you considered this article on centring things http://www.w3.org/Style/Examples/007/center.en.html ?

    Thread Starter Moritz83

    (@moritz83)

    yeah normally I don’t have a problem with this kind of stuff but I can’t get this one working so I do need help before I go crazy ^^

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Don’t use absolute positioning.

    Thread Starter Moritz83

    (@moritz83)

    Do you have a solution?

    It’s like I am sitting in front of a wall :/

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Post the code you’re using to make the element centred.
    This code;

    .cycloneslider-template-controls .cycloneslider-controls{
        position: absolute;
    	left: 42%;
        bottom:-27px;
        z-index:102;
        padding:5px 0;
        height:16px;
    }

    Doesn’t centre anything.

    Thread Starter Moritz83

    (@moritz83)

    This is the code I am using right now so the image with the controls is nearly in the middle of the slideshow.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    As your query specifically concerns CSS, you can post on a CSS-specific forum. This isn’t a WordPress issue.

    Thread Starter Moritz83

    (@moritz83)

    okay, thanks anyway πŸ™‚

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘CSS & PHP –> how to center a div container’ is closed to new replies.