如何在图像上粘贴图像

时间:2018-10-18 17:04:38

标签: javascript html css html5 css3

请帮助?!如何在按钮和单词下方粘贴图像而不损坏它们。我想在CSS中删除背景图片并粘贴HTML滑动代码,但是HTML认为我粘贴的是一个块,并在其上推动其他项目。

<html>
<body>
    <div class="page">
        <section id="banner">
            <section id="semiopacity">
                <h1 id="title">KAZAKHSTAN</h1>
                <nav>
                    <ul>
                        <li><a href="#" id="main">MAIN</a></li>
                        <li><a href="gallery.html">Gallery</a></li>
                        <li><a href="contact.html" id="contact">CONTACT</a></li>
                        <li><a href="lang.html" class="lang">Lang</a></li>
                    </ul>
                </nav>
            </section>
            <h1 class="header">INFORMATION</h1>
            <p class="pheader">This site will demonstrate for you travel in Kazakhstan.</p>
            <ul class="actions">
                <li><a href="#description" class="button" id="cn" onclick="smoothScroll(document.getElementById('description'))">Continue</a></li>
            </ul>
            <ul class="ddm">
                <li><a href="ru.html" id="lang"><img src="images/ru.svg" width="150" height="100"></a></li>
                <li><a href="us.html" id="lang"><img src="images/us.svg" width="150" height="100"></a></li>
                <li><a href="kz.html" id="lang"><img src="images/kz.svg" width="150" height="100"></a></li>
            </ul>
        </section>
    </div>
</body>
</html>

我想在此处粘贴滑动图像,我自己无法粘贴!

<div id="slider">
        <div class="slide"><a href="#"><img src="images/01.jpg" alt="Название картинки" border="0"></a></div>
        <div class="slide"><a href="#"><img src="images/02.jpg" alt="Название картинки" border="0"></a></div>
        <div class="slide"><a href="#"><img src="images/03.jpg" alt="Название картинки " border="0"></a></div>
    </div>

还有CSS:

/* TYPE */
    a {
        text-decoration: none;
        color: black;
    }
    h2 {
        text-align: center;
        font-size: 1.5em;
        margin: 0 0 2em 0;
    }
    p.pheader {
        margin: 1em 0 0.5em 0;
        color: #fff;
        font-size: 1.3em;
        text-align: center;
        letter-spacing: 4px;
    }
    nav {
        font-family: lato, sans-serif;
        font-weight: 700;
        font-size: 1.3em;
        display: inline-block;
        float: left;
    }
    nav li {
        display: inline;
        text-align: center;
        margin: 1.5em 0.7em 0 0;
    }
    nav ul {
        text-align: right;
        padding: 1em 0;
        position: fixed;
        display: inline-block;
        width: 100%;
        background: rgba(255,255,4,0.8);
        margin: 0 0 0 0;
        z-index: 1;
    }
    #semiopacity {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(10,10,10,0.7);
        padding: 0 0 14em 0;
        margin-top: -8em;
    }
    #title {
        position: fixed;
        font-family: lato, sans-serif, bold;
        font-weight: 700;
        font-size: 1.5em;
        margin: 1em 0 0 1em;
        display: block;
        float: left;
        z-index: 10;
    }
    .header {
        padding: 0;
        margin-top: -15em;
        color: #fff;
        font-size: 2em;
        text-align: center;
        letter-spacing: 5px;
    }
    .lang {
        padding: 5px;
        margin: 0 1em 0 0;
        display: inline-block;
        cursor: pointer;
        border-radius: 10px;
        background-color: red;
        color: white;
    }
    .lang:hover {
        background-color: #282828;
        animation: bgcolor 0.5s ease-in-out;
    }
    .lang:hover > .ddm {
        display: inline-block;
    }
    @-webkit-keyframes bgcolor {
        0% {
            background-color: red;
        }
        100% {
            background-color: #282828;
        }
    }
    .ddm {
        display: none;
        margin: -20% 0 0 0;
        vertical-align: top;
        z-index: 20;
        padding: 6em 10em 6em 10em;
        background-color: rgba(50, 0, 100, 1);
        border-radius: 20px;
        box-shadow: 3px 3px 10px,
        -3px -3px 10px;
    }
    .ddm a:hover img {
        -webkit-transition: -webkit-transform 0.5s ease-in-out;
        max-width: 100%;
        -webkit-transform: scale(1.2);
    }
/* Button */
    .button {
        background: #ffff00;
        color: #000;
        border-radius: 4px;
        border: 0;
        display: inline-block;
        font-weight: 900;
        height: 2.95em;
        line-height: 3em;
        padding: 0 1.5em;
        text-decoration: none;
        text-align: center;
        margin-top: 1em;
    }
/* Banner */
    #banner {
        padding: 8em 0 6em 0;
        height: 80vh;
        background-image: url(images/banner1.jpg);
        background-size: cover;
        background-attachment: fixed;
        background-repeat: no-repeat;
        text-align: center;
    }

我想在此处粘贴滑动图像,我自己无法粘贴!请帮助?如何在按钮和单词下方粘贴图像而不损坏它们。我想在CSS中删除背景图片并粘贴HTML滑动代码,但是HTML认为我粘贴的是一个块,并在其上推动其他项目。

1 个答案:

答案 0 :(得分:0)

您的意思是这样吗? https://www.w3schools.com/w3css/w3css_slideshow.asp

您可以将图片的z-index设置为低于按钮/标题,以使其显示在下方。