Html 如何在中间制作旋转木马并适合页面的3/4

Html 如何在中间制作旋转木马并适合页面的3/4,html,css,wordpress,Html,Css,Wordpress,我用HTML工作,现在我只是在我的HTML项目中添加了一个旋转木马项目,我的问题是,你怎么能在页面中间显示旋转木马,因为它出现在左边。 www.littlebossworld.com在这种情况下,您必须使用!重要属性,因为您的旋转木马插件正在添加内联样式(可能有一个可以更改此设置的设置?) “硬”css: 这段代码对您有帮助 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></

我用HTML工作,现在我只是在我的HTML项目中添加了一个旋转木马项目,我的问题是,你怎么能在页面中间显示旋转木马,因为它出现在左边。


www.littlebossworld.com

在这种情况下,您必须使用
!重要
属性,因为您的旋转木马插件正在添加内联样式(可能有一个可以更改此设置的设置?)

“硬”css:

这段代码对您有帮助

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="Content/bootstrap.css" rel="stylesheet" />
    <style>
        .corosolstylelog {
            margin: 0 auto;
        }

        .carousel-inner > .item > img,
        .carousel-inner > .item > a > img {
            margin: 0 auto;
        }
    </style>
    <script src="Scripts/jquery-1.10.2.js"></script>
    <script src="Scripts/bootstrap.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var hight = $(window).height();
            var hightforcourosol = ($(window).height() / 4) * 3;
            var width = ($(window).width() / 2);

            $('.carousel-inner img').css("height", hightforcourosol);
            $('.carousel-inner a img').css("height", hightforcourosol);
            $('.carousel-inner img').css("width", width);
            $('.carousel-inner a img').css("width", width);
        })

    </script>
</head>
<body>
    <div class="col-lg-2">
        Left Side 
    </div>
    <div class="col-lg-8 corosolstylelog">

        <div id="myCarousel" class="carousel slide" data-ride="carousel">
            <!-- Indicators -->
            <ol class="carousel-indicators">
                <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                <li data-target="#myCarousel" data-slide-to="1"></li>
                <li data-target="#myCarousel" data-slide-to="2"></li>
                <li data-target="#myCarousel" data-slide-to="3"></li>
            </ol>
            <!-- Wrapper for slides -->
            <div class="carousel-inner" role="listbox">

                <div class="item active">
                    <img src="Image/Carousel/a.jpg" alt="Chania">

                    <div class="carousel-caption">
                        <h3>Chania</h3>
                        <p>The atmosphere in Chania has a touch of Florence and Venice.</p>
                    </div>
                </div>
                <div class="item">
                    <img src="Image/Carousel/b.jpg" alt="Chania">
                    <div class="carousel-caption">
                        <h3>Chania</h3>
                        <p>The atmosphere in Chania has a touch of Florence and Venice.</p>
                    </div>
                </div>
                <div class="item">
                    <img src="Image/Carousel/c.jpg" alt="Flower">
                    <div class="carousel-caption">
                        <h3>Flowers</h3>
                        <p>Beatiful flowers in Kolymbari, Crete.</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-2">
       Right Side
    </div>
</body>
</html>

科罗索斯泰洛格{
保证金:0自动;
}
.carousel-inner>.item>img,
.carousel-inner>.item>a>img{
保证金:0自动;
}
$(文档).ready(函数(){
var hight=$(窗口).height();
var hightforcourosol=($(窗口).height()/4)*3;
变量宽度=($(窗口).width()/2);
$('.carousel-inner-img').css(“高度”,高forcourosol);
$('.carousel inner a img').css(“高度”,hight forcourosol);
$('.carousel-inner-img').css(“宽度”,宽度);
$('.carousel inner a img').css(“宽度”,width);
})
左侧
  • 夏尼亚 查尼亚的气氛有点像佛罗伦萨和威尼斯

    夏尼亚 查尼亚的气氛有点像佛罗伦萨和威尼斯

    花 克里特岛科林巴里美丽的花朵

    右侧
    我需要一个css代码来输入我的旋转木马元素(这是avada主题),到目前为止,您尝试了什么?你的HTML代码是什么?我在这里添加你的代码CSS类向包装HTML元素添加一个类。但它不起作用
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <link href="Content/bootstrap.css" rel="stylesheet" />
        <style>
            .corosolstylelog {
                margin: 0 auto;
            }
    
            .carousel-inner > .item > img,
            .carousel-inner > .item > a > img {
                margin: 0 auto;
            }
        </style>
        <script src="Scripts/jquery-1.10.2.js"></script>
        <script src="Scripts/bootstrap.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                var hight = $(window).height();
                var hightforcourosol = ($(window).height() / 4) * 3;
                var width = ($(window).width() / 2);
    
                $('.carousel-inner img').css("height", hightforcourosol);
                $('.carousel-inner a img').css("height", hightforcourosol);
                $('.carousel-inner img').css("width", width);
                $('.carousel-inner a img').css("width", width);
            })
    
        </script>
    </head>
    <body>
        <div class="col-lg-2">
            Left Side 
        </div>
        <div class="col-lg-8 corosolstylelog">
    
            <div id="myCarousel" class="carousel slide" data-ride="carousel">
                <!-- Indicators -->
                <ol class="carousel-indicators">
                    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                    <li data-target="#myCarousel" data-slide-to="1"></li>
                    <li data-target="#myCarousel" data-slide-to="2"></li>
                    <li data-target="#myCarousel" data-slide-to="3"></li>
                </ol>
                <!-- Wrapper for slides -->
                <div class="carousel-inner" role="listbox">
    
                    <div class="item active">
                        <img src="Image/Carousel/a.jpg" alt="Chania">
    
                        <div class="carousel-caption">
                            <h3>Chania</h3>
                            <p>The atmosphere in Chania has a touch of Florence and Venice.</p>
                        </div>
                    </div>
                    <div class="item">
                        <img src="Image/Carousel/b.jpg" alt="Chania">
                        <div class="carousel-caption">
                            <h3>Chania</h3>
                            <p>The atmosphere in Chania has a touch of Florence and Venice.</p>
                        </div>
                    </div>
                    <div class="item">
                        <img src="Image/Carousel/c.jpg" alt="Flower">
                        <div class="carousel-caption">
                            <h3>Flowers</h3>
                            <p>Beatiful flowers in Kolymbari, Crete.</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-2">
           Right Side
        </div>
    </body>
    </html>