获取在同一行2的div [英] Getting 2 divs on the same line

查看:139
本文介绍了获取在同一行2的div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让在同一行2的div,我有

 < D​​IV CLASS =头>
  < D​​IV CLASS =明确hideSkiplink>
     < D​​IV CLASS =menuDiv>
             < ASP:菜单ID =NavigationMenu=服务器的CssClass =菜单
                的EnableViewState =假方向=横向
                StaticSubMenuInde​​nt =10px的背景色=#E3EAEBDynamicHorizo​​ntalOffset =2
                字体名称=宋体FONT-SIZE =0.8em前景色=#666666>
            < / ASP:菜单>< / DIV>            < D​​IV CLASS =搜索盒>            < / DIV>
        < / DIV>
    < / DIV>

我想获得的菜单和与菜单的左侧和搜索到右侧hideSkiplink内搜索。因为它是搜索是菜单下。我试图改变增加职位上的CSS的一切,我发现周围的这个网站,但如果我得到的菜单,并在同一条直线上hideSkiplink消失搜索,如果我将搜索设置为浮动权,它超出了hideSkiplink的。

所有我在我的CSS现在是

  div.hideSkiplink
{
背景颜色:#555555;
宽度:100%;
 }div.menu
{
填充:8像素0像素加上了8px 10px的;
}

任何想法,我能做些什么?


解决方案

  #NavigationMenu {
    浮动:左;
}.SearchBox {
    浮动:权利;
}.MenuDiv {
    溢出:隐藏; / *调整.MenuDiv的高度来包装其子* /
}

I'm trying to get 2 divs on the same line, I've got

<div class="header">
  <div class="clear hideSkiplink">
     <div class="menuDiv">
             <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" 
                EnableViewState="False" Orientation="Horizontal" 
                StaticSubMenuIndent="10px" BackColor="#E3EAEB"   DynamicHorizontalOffset="2" 
                Font-Names="Verdana" Font-Size="0.8em" ForeColor="#666666">
            </asp:Menu></div>

            <div class="SearchBox">

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

I wanna get the menu and the search inside the hideSkiplink with the menu to the left and the search to the right. As it is the search is under the menu. I tried changing adding positions for everything on css as I found around this site, but if I get the menu and search in the same line the hideSkiplink disappears, if I set the search to float right, it goes out of the hideSkiplink.

All I have in my css right now is

div.hideSkiplink
{
background-color:#555555;
width:100%;
 }

div.menu
{
padding: 8px 0px 8px 10px;   
}

any ideas what I can do?

解决方案

#NavigationMenu {
    float: left;
}

.SearchBox {
    float: right;
}

.MenuDiv {
    overflow: hidden; /* adjusts the height of .MenuDiv to wrap its children */
}

这篇关于获取在同一行2的div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆