简体   繁体   English

使用嵌套Div容器的圆角

[英]Rounded Corners Using Nested Div Containers

First of all, yes I know there are other threads on here that deal with various versions of this issue. 首先,是的,我知道这里还有其他线程可以处理此问题的各种版本。 I've reviewed them without much success at solving my problem. 我对它们进行了审查,但未能成功解决我的问题。 If I've missed one somewhere, please point me in that direction; 如果我在某处错过任何地方,请指出我的方向。 otherwise I'm stuck on this at the moment. 否则,我此刻会停留在此位置。

Here's the deal. 这是交易。

I'm attempting to apply three graphics, a left border (left.jpg) and two top rounded corners (topleft.jpg and topright.jpg) to a container with a list of links in it. 我试图将三个图形,一个左边框(left.jpg)和两个顶部圆角(topleft.jpg和topright.jpg)应用到其中包含链接列表的容器。

The desired result should be a shadowed left border with the top two corners rounded. 期望的结果应该是阴影的左边框,顶部的两个角是圆的。

My instructions call for this to be done using three nested div containers. 我的指令要求使用三个嵌套的div容器完成此操作。 From my research and books, everything appears to be correct in the code; 从我的研究和书籍来看,代码中的所有内容似乎都是正确的。 however the two rounded corner graphics are not displaying and I can't find the reason for it. 但是,两个圆角图形都没有显示,我找不到原因。

I'm pretty certain I'm overlooking something simple, but after a couple of days working on it, I'm starting to go a little cross-eyed. 我可以肯定我忽略了一些简单的事情,但是经过几天的努力,我开始有点cross目了。 I'm hoping a fresh set will spot what I'm missing. 我希望能找到一个新的发现我所缺少的东西。 HTML and CSS code are below. HTML和CSS代码如下。

Thanks guys. 多谢你们。

<div id="leftColumn">
    <div id="links">
        <div class="left">
            <div class="topLeft">
                <div class="topRight">
                    <ul>
                        <li><a href="#">Akari</a></li>
                        <li><a href="#">Divide by Box</a></li>
                        <li><a href="#">Fillomino</a></li>
                        <li><a href="#">Hashiwokakero</a></li>
                        <li><a href="#">Heyawake</a></li>
                        <li><a href="#">Hitori</a></li>
                        <li><a href="#">Kakuro</a></li>
                        <li><a href="#">Katagaku</a></li>
                        <li><a href="#">Masugo</a></li>
                        <li><a href="#">Masyu</a></li>
                        <li><a href="#">Nonogram</a></li>
                        <li><a href="#">Oekaki Logic</a></li>
                        <li><a href="#">Shikaku</a></li>
                        <li><a href="#">Sudoku</a></li>
                        <li><a href="#">Suhai</a></li>
                        <li><a href="#">Super Sudoku</a></li>
                        <li><a href="#">Tenketsu</a></li>
                        <li><a href="#">Tentai Show</a></li>
                        <li><a href="#">Wordoku</a></li>
                        <li><a href="#">Yajilin</a></li>
                    </ul>

                </div>
            </div>
        </div>
    </div>
</div>

CSS CSS

div.left {background-image: url(left.jpg);
         background-repeat: repeat-y;
         background-position: left;
         box-shadow: 10px 10px 5px #888888}
div.top-left {background-image: url(topleft.jpg);
             background-repeat: no-repeat;
             background-position: top-left;
             border-radius: 25px}
div.top-right {background-image: url(topright.jpg);
              background-repeat: no-repeat;
              background-position: top-right;
              border-radius: 25px}

There is typo mistakes in your css that's the reason your css was not applying 您的css中有错别字错误,这就是您的css不适用的原因

div.top-left {...}
div.top-right {...}

should be 应该

div.topLeft {...}
div.topRight {...}

Html HTML

<div class="topLeft">
<div class="topRight">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM