为什么日历不显得正确? [英] Why the Calendar does not dispaly right ?

查看:116
本文介绍了为什么日历不显得正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Calendar控件用于基于母版页的页面。在任何网络浏览器中,在为日历定义css之后,日历不显示右侧的标题和下一个/上个月 - 它们从日历延伸到浏览窗口的右边缘,而不是在顶部的日历。但如果我没有在css中定义它的位置,那么日历工作正常。



页面代码为

A Calendar control is used in a page based on a master page. In any web brower, the Calendar does not show the Title and the Next/Previous Month in right poistion after I define a css for the Calendar - they are extended from the Calendar to the right edge of the browing window, and not on the top of Calendar. But if I don''t define it''s position in the css, the Calendar works fine.

The code of the page is

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .newStyle1
        {
            position: absolute;
            top: 100px;
            left: 100px;
        }       
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Calendar ID="Calendar1" runat="server" CssClass="newStyle1">
        <NextPrevStyle HorizontalAlign="Center" />
        <TitleStyle HorizontalAlign="Center" 

            VerticalAlign="Top" />
    </asp:Calendar>
    <p>
    </p>
</asp:Content>





主页的代码是:



The code of the mater page is:

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <title></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1"  runat="server">
    <div>
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>





我不知道是什么贴在日历上。任何人都可以给我一些帮助吗?



I don''t know what happended to the Calendar. Could any one give me some help?

推荐答案

css和控制网页内容的乐趣(ASP或HTML等......)



检查页面上日历的大小是否足以显示缺少的内容,即它可能会被切断页面/ div。



还要确保你没有任何与css中的日历一起工作的东西不仅仅是控制而不是控制的全部部分。



有些css属性会覆盖一些像这样的控件。



所以在页面上将它移到更大的区域看看它是否显示在不同的位置或检查你是否有任何尺寸应用于该控件。



你的css中的某些东西覆盖了这些部分这个控件,但棘手的是如何纠正它或找出原因。


css文件内容可能有助于解决问题eshoot。



希望有所帮助。
The fun with css and controling content within web pages (either ASP or HTML etc...)

Check the size of where your calendar is on the page is big enough to show the missing content, ie, it could be getting cut off of the page/div.

also make sure you don''t have anything that is working with the calendar in the css is not taking just the control and not the full parts of the control with it.

Some css properties will override some controls like that.

So move it on the page to a larger area to see if it shows when it is in a different spot or check to see if you have any sizing being applied to that control.

something in your css is overriding those parts of that control, but the tricky thing is how to correct it or find out why.

css file content might help to troubleshoot.

Hope that helps.


这篇关于为什么日历不显得正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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