Html 无法使用CSS嵌套div';s

Html 无法使用CSS嵌套div';s,html,css,Html,Css,我正在使用CSS为我的页面设置标题格式。我无法正确显示(类是标题按钮)。我试图在顶部有一个静态标题,里面有一个按钮,在右边。相反,它显示在右侧(在正确的区域中),标题区域下方除外。首先,以下是标题的样式: div.header { // Used to keep header in the same position on the page position: fixed; height: 50px; background: -webkit-linear-gradient(#191919, #4

我正在使用CSS为我的页面设置标题格式。我无法正确显示
(类是
标题按钮
)。我试图在顶部有一个静态标题,里面有一个按钮,在右边。相反,它显示在右侧(在正确的区域中),标题区域下方除外。首先,以下是标题的样式:

div.header {
// Used to keep header in the same position on the page
position: fixed;
height: 50px;
background: -webkit-linear-gradient(#191919, #474747); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(#191919, #474747); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(#191919, #474747); /* For Firefox 3.6 to 15 */
background: linear-gradient(#191919, #474747); 
background-color: black;
margin: 0px auto;
width: 100%;
// Used to keep the header at the top
top: 0px;
}
这些是div的样式,应该放在标题的内部

div.header_button {
color: #ccffcc;
border-radius: 10%;
background-color: #3333ff;
font-size: 24px;
font-weight: 200;
text-align: center;
padding: 2px;
width: 4%;
text-align: center;
// Used to keep the button almost on the right edge
margin-left: 94%;
}
这是我用来将
header\u按钮
div嵌套在
header
本身内部的HTML

<div class="header" >
    <p>
        Testing Text
    </p>
    <div class="header_button">
        Test
    </div>

</div>


测试文本

测验
我做错了什么

感谢您的反馈。

HTML:


注意
/
不会以CSS注释开头。您必须使用
/***/
。请看有趣的@Oriol。Netbeans IDE似乎将其作为一条评论加以强调。谢谢,很好用。我以前试过这个,但没用。哦,非常感谢。我选择了答案。
<div class="header" >
    <div class="header_button">
        Test
    </div>
    <p>
        Testing Text
    </p>
</div>
div.header_button {
    float: right;
}