Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 继承-子导航栏不向左浮动,因为其父导航栏向右浮动_Html_Css - Fatal编程技术网

Html 继承-子导航栏不向左浮动,因为其父导航栏向右浮动

Html 继承-子导航栏不向左浮动,因为其父导航栏向右浮动,html,css,Html,Css,我当前的代码有几个问题: 副导航栏不是从我想要的地方开始的。我希望它向左浮动,但它向右浮动,因此没有足够的空间。我希望子导航栏更像 我想将过滤器向上移动到图像的第一行,而不是像其当前位置那样移动到最后一行 HTML: 我认为您需要在代码中进行这些更改来解决第一个问题。但我不明白你的第二个问题。 我解决了您的第一个问题。请检查此链接。 不,我的意思是我希望第一级导航栏保持在右侧,第二级导航栏从左侧开始。谢谢 <html> <head> <l

我当前的代码有几个问题:

副导航栏不是从我想要的地方开始的。我希望它向左浮动,但它向右浮动,因此没有足够的空间。我希望子导航栏更像

我想将过滤器向上移动到图像的第一行,而不是像其当前位置那样移动到最后一行

HTML:

我认为您需要在代码中进行这些更改来解决第一个问题。但我不明白你的第二个问题。 我解决了您的第一个问题。请检查此链接。


不,我的意思是我希望第一级导航栏保持在右侧,第二级导航栏从左侧开始。谢谢
<html>

    <head>
        <link rel="stylesheet" type="text/css" href="Princess.css"> 
        <title> PPRINCESS </title> 
    </head>

    <body>

        <div id="wrap">
            <div id="title">
                <h1> PPRINCESS </h1>
            </div>
                <ul id="bar">
                    <li> <a href="home.html" > Home </a> </li>
                    <li> <a href="collection.html" > Collection </a> 
                            <ul>
                                <li>  <a href="angels.html"> Angel on Meadows </a> </li>
                                <li>  <a href="beach.html"> Beachy Ladies </a> </li>
                                <li>  <a href="streets.html"> Pavements and Streets </a> </li>
                                <li>  <a href="symbol.html"> Become a Symbol </a> </li>
                            </ul>
                    </li>
                    <li> <a href="shoes.html" > Shoes </a> </li>
                </ul>
            <div id="headshot">
                <img src="headshotimg.jpg" alt="Head Shot">
            </div>    

            <ul id="sidebar"> 
                    <li> FILTERS </li> 
                    <li> <a href="Cotton Shirts.html" > Cotton Shirts </a> </li>
                    <li> <a href="Sleeveless.html"> Sleeveless </a> </li>
                    <li> <a href="Long Sleeve.html"> Long Sleeve </a> </li>
            </ul>

            <div id="three">
                <div id="row1">
                    <div>
                        <img src = "img1.jpeg" alt="Image 1">
                        <text> DOT CHIFFON TIE NECK BLOUSE </text>
                        <br> 
                        <text> SGD 166.90 </text>
                    </div>
                    <div>
                        <img src = "img2.jpeg" alt="Image 2">
                        <text> CREPE FLORAL APPLIQUE TOP </text>
                        <br> 
                        <text> SGD 180 </text>
                    </div>
                    <div>
                        <img src = "img3.jpeg" alt="Image 3">
                        <text> CREPE FLORAL APPLIQUE TOP </text>
                        <br> 
                        <text> SGD 180 </text>
                    </div>
                </div>
                <div id="row2"> 
                    <div>
                        <img src = "img4.jpeg" alt="Image 4">
                        <text> CREPE FLORAL APPLIQUE TOP </text>
                        <br> 
                        <text> SGD 180 </text>
                    </div>
                    <div>
                        <img src = "img5.jpeg" alt="Image 5">
                        <text> CREPE FLORAL APPLIQUE TOP </text>
                        <br> 
                        <text> SGD 180 </text>
                    </div>
                    <div>
                        <img src = "img6.jpeg" alt="Image 6">
                        <text> CHIFFON YOKE BLOUSE </text>
                        <br> 
                        <text> SGD 180 </text>
                    </div>
                    </div>
                <div id="row3">
                    <div>
                        <img src = "img7.jpeg" alt="Image 7">
                        <text> COLORBLOCK CHIFFON BLOUSE </text>
                        <br> 
                        <text> SGD 160 </text>
                    </div>
                    <div>
                        <img src = "img8.jpeg" alt="Image 8">
                        <text> BRUSHED SQUARE TIE NECK BLOUSE </text>
                        <br> 
                        <text> SGD 200 </text>
                    </div>
                    <div>
                        <img src = "img9.jpeg" alt="Image 9">
                        <text> PIPED SILK BLOUSE </text>
                        <br> 
                        <text> SGD 170 </text>
                    </div>
                </div>
            </div>

            </div>

    </body> 

</html>
body {
    background-color: #fefbf7;
}
#wrap {
    width: 100&; 
    background-color: #fefbf7;
    margin: auto;
}

#title {
    width:20%;
    margin: 1em 0em 0em 10%; 
    padding:20px;
    float:left;
    display:inline-block;

}
#bar { 
    background-color: #fefbf7;
    float: right;
    list-style:none; 
    padding: 20px;  
    display:inline-block; 
}

#bar li {
    float:right;
    background-color: #fefbf7;
    border-left: #4c4c4c;
} 

#bar li a {
    display: block;
    padding: 20px;  
    font-weight: bold; 
} 
#bar li:hover {
    background-color:beige;
}
#bar li a,visited {
    color: #525252;
    text-decoration: none; 
}
#bar ul {
    display: none;
    position: absolute; 
}

#bar li:hover > ul{
    display:block;
    float: left;
}

/*Content: sidebar and main image frame*/

#headshot img{
    width: 80%; 
    margin: 2em 10% 10% 10%; 
}

#sidebar {
    width: 20%;
    align: top;
    display: inline-block; 
    margin: 2em 2em 0em 5%; 

}
#three {
    width: 60%;
    display: inline-block;
}

#three div div{
    width: 33%;
    display: inline-block;
}
#three div div img {
    width: 100%;
}

#three div div img {
    width: 100%;
}
#bar { 
    background-color: #fefbf7;
    float: right;
    list-style:none; 
    padding: 20px;  

}

#bar li {
    display:inline-block;
    background-color: #fefbf7;
    border-left: #4c4c4c;

} 

#bar li a {
    display: block;
    padding: 20px;  
    font-weight: bold; 
} 
#bar li:hover {
    background-color:beige;
}
#bar li a,visited {
    color: #525252;
    text-decoration: none; 
}
#bar ul {
    display: none;
   position:absolute;


   left:50px;
}
#bar ul li a {
    display:inline-block;

}



#bar li:hover > ul{
    display:block;

}
Hye I am modified some css code, so Please check once, I think it's useful for you. 

#bar li a{}
#bar li ul{width: 100%;
    left: 0;
    list-style: none; padding-left: 0;}
#bar li ul li{float: left;}