質問

I use Master Page in my Project.But Master Page contents are not same in all pages.In Home.aspx page it's margin is 0px and in other page isn't. Texts are Bold and Big Size in one page and Small in another Page. Why this occur?

My Master.master page Code :

<body style="margin:0px; text-align: left;">
<form id="form1" runat="server">
<div>
    <div class="auto-style1" style="background-color: #3399FF; height: 42px;">
        <h2>
            <a href ="Home.aspx"><asp:Label ID="homeLabel" runat="server" Text="Home"></asp:Label></a>
            <a href ="Members.aspx" ><asp:Label ID="memberLabel" runat="server" Text="Members"></asp:Label></a>
            <a href ="Shared_Files.aspx"><asp:Label ID="file_sharedLabel" runat="server" Text="Files Shared"></asp:Label></a>
            <a href ="Blogs.aspx"> <asp:Label ID="blogLabel" runat="server" Text="Blogs"></asp:Label></a>
        </h2>

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

    </asp:ContentPlaceHolder>

</div>
</form>

And Two picture of Home.aspx and Members.aspx are

enter image description here

enter image description here What happens I don't Catch .

役に立ちましたか?

解決

Again, it is hard to tell what is going on without the actual HTML from your child pages. However, judging from the picture, you are probably looking for a margin value on a an element between your <asp:ContentPlaceHolder> tags.

It looks like your second page is using a <table> of some sort.

Make sure your table has:

style="margin-top: 0px;"

Or

<table class="noTopMargin"> ...

<style>
.noTopMargin { margin-top: 0px; }
</style>

As for the font-size and font-weight being messed up, it is possible that your second page has a <style> declaration somewhere which is screwing it all up. Also make sure that your browser zoom is the same between both pages.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top