【问题标题】:Header Div Position Edit according to Content DivHeader Div Position 根据 Content Div 编辑
【发布时间】:2012-10-18 20:11:46
【问题描述】:

我想设计我的网站。我有两个主要的 div,其中一个是“标题”,另一个是“内容”。我想设置 width 属性:80% 并为它们设置中心。但我不这样做。关于标题 div 的其他问题。我上传了一张图片,我想这样设计。我怎样才能做到所有这些?

我的 CSS:

    #main
    {
        margin:0px auto;
        margin-left:50px;
        margin-right:50px;
        margin-top:25px;
        margin-bottom:25px;
        height:auto;
        text-align:center;}

 #content
    {

        width:80%;
        height:auto;
        margin:0px auto;
        }

    #header
     {

         width:80%;
         height:100px;
         top:20px;
         }

    #header_left
     {

        float:left ;
        height: 100px;
        text-align: center;
        }

    #header_right
    {
        margin:0px auto;
        height:30px;
        text-align:center;
        margin-top:35px;
        }

        #header_social
        {

            float:right;
            height:30px;
            text-align:center;
            margin-top:35px;}

我的客户代码:

<div id="main">

    <div id="content">

    <div id="header">

    <div id="header_left">
    <asp:Image ID="Image1" runat="server" />
    </div>

    <div id="header_right">

    <asp:LinkButton ID="LinkButton5" runat="server" ForeColor="Gray"></asp:LinkButton>&nbsp;|
    <asp:LinkButton ID="LinkButton4" runat="server" ForeColor="Gray" ></asp:LinkButton>&nbsp;|
    <asp:LinkButton ID="LinkButton3" runat="server" ForeColor="#FF3300" ></asp:LinkButton>&nbsp;|
    <asp:LinkButton ID="LinkButton2" runat="server" ForeColor="Gray" ></asp:LinkButton>&nbsp;|
    <asp:LinkButton ID="LinkButton1" runat="server" ForeColor="Gray" ></asp:LinkButton>
    </div>

    <div id="header_social">
        <asp:ImageButton ID="ImageButton1" runat="server"/>
        <asp:ImageButton ID="ImageButton2" runat="server"/>
    </div>

    </div>

     ******CONTENT FIELD*****

    </div>

    </div>

【问题讨论】:

    标签: asp.net css html position positioning


    【解决方案1】:

    检查这个小提琴:http://jsfiddle.net/2wqe8/28/

    我没有收到上传图片部分。请您详细说明一下吗?

    更新:
    检查另一个小提琴的内容:http://jsfiddle.net/MkP4D/8/

    当你使用浮动时,首先提供右浮动元素。 欲了解更多信息: CSS Float

    【讨论】:

    • 嘿,谢谢关注。标题效果很好。但我想在内容 div 中使用框。我怎样才能做到这一点 ?我想在一行中放置 3 个盒子。请查看:jsfiddle.net/MkP4D
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-14
    相关资源
    最近更新 更多