简体   繁体   English

基本样式。 母版页右侧的导航栏

[英]Basic Styling. Navigation bar on right on Master Page

Call me a noob, but I am terrible at styling. 称我为菜鸟,但造型太糟糕了。 Not my forte. 不是我的强项。 But anyways, on my CSS page I need to have my MasterPage Navigation bar be on the left side. 但是无论如何,在我的CSS页面上,我需要让MasterPage Navigation栏位于左侧。 But when I click on the link to bring me to different page, it has to show up in the middle with the navigation on the left still. 但是,当我单击链接以将我带到其他页面时,它必须显示在中间,而导航仍在左侧。

Is this more then just styling? 这不仅仅是样式吗? If it is, please help. 如果是,请帮助。

Here is my asp code: 这是我的asp代码:

    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="~/MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Travis's Master Page = Resume Information</title>
        <asp:ContentPlaceHolder ID="head" runat="server">
            <link href="Stylesheet" rel="stylesheet" type="text/css" />
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
            <div id="page">

                <div id="header" >
                    <asp:Image ID="Image1" runat="server" Height="99px"
                        ImageUrl="./Pictures/city2.jpg" Width="70px" />
                </div>

                <div id="sidebar" >

                    <asp:HyperLink ID="Home" runat="server"
                        NavigationUrl="./Default.aspx" CssClass="link">Home</asp:HyperLink>
                    <br /><br />

                    <a href="Default2.aspx">Education</a>

                    <asp:HyperLink ID="Proficiencies" runat="server"
                        NavigationUrl="./Default3.aspx" CssClass="link">IT Proficiencies</asp:HyperLink>
                    <br /><br />

                    <asp:HyperLink ID="Involvement" runat="server"
                        NavigationUrl="./Default4.aspx" CssClass="link">Community Involvement</asp:HyperLink>
                    <br /><br />

                    <asp:HyperLink ID="References" runat="server"
                        NavigationUrl="./Default5.aspx" CssClass="link">References</asp:HyperLink>
                    <br /><br />
                </div>

                <div id="main">
                    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

                    </asp:ContentPlaceHolder>
                </div>
                <div id="message">
                    <asp:Label ID="lblMessage" runat="server" Text="This is a Label" CssClass="label"></asp:Label>
                    <br />
                </div>

            </div>
        </form>
    </body>

</html>

And laugh if you want, but this is about as far as i can get with styling. 如果需要,请笑,但这是我所能做到的。

    Body
{

}
Aside
{

}
Footer
{

}

Any help with this will be greatly appreciated. 任何帮助,将不胜感激。 I know this is probably just very basic stuff, but I would like a helping hand. 我知道这可能只是非常基本的内容,但我想伸出援手。

Thanks! 谢谢!

EDIT: Right now, as it currently stands, it is all on the left side. 编辑:现在,按照目前的状态,它都在左侧。 The information that is entered in on other pages still shows up on the navigation bar. 在其他页面上输入的信息仍显示在导航栏上。 I can't get it to show up in the middle. 我无法让它显示在中间。

the fix would be to use floats: 解决方法是使用浮点数:

  1. set your sidebar to float:left . 将侧边栏设置为float:left
  2. set your main to float:right : 将主线设置为float:right
  3. after your main div add: <div style="clear: both;"></div> 在您的主要div之后添加: <div style="clear: both;"></div>

this should do the trick. 这应该可以解决问题。 here is a very very simple jsfiddle that demostrates it: 这是一个非常简单的jsfiddle演示它:

http://jsfiddle.net/LM3xp/ http://jsfiddle.net/LM3xp/

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

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