-1

我正在使用 JSP、servlet 和 Tomcat 做我的大学小项目,我发现我的设计存在一些问题。

问题:当我在浏览器中重新加载页面时,我的设计总是会发生变化,尽管我没有对 CSS 或任何 JSP 代码进行任何更改,但如果我从 Dreamweaver 打开相同的文件而不是显示所需的设计。你能帮我解决这个问题吗?

login.css
    body {
        font-family: "Trebuchet MS", Tahoma, Arial, Geneva, sans-serif, Helvetica, sans-serif;
        font-size: 13px;
        background: url(../images/bg.png) 0 64px repeat-x;
        margin: 0;
    }

    .wrapper {
        xmargin: 0 auto;
    }

    #border-top.h_green {
        background: url(../images/j_header_middle.png) repeat-x;
        height: 84px;
        xmargin: 0 auto;
    }

    #contentbox,#header-top {
        width: 755px;
        margin: 0 auto;
        xbackground: #efefef;
        padding: 0px;
        position: relative;
    }

    #menuheader {
        position: relative;
    }

    #contentbox p {
        padding: 0 0 10px 0;
    }

    #menubox {
        background: #fff;
        padding: 3px 10px;
        border-left: 1px solid #cccecc;
        border-right: 1px solid #cccecc;
        height: 15px;
    }

    #user_name {
        position: absolute;
        right: 0px;
        top: 0px;
        xbackground: url(../../../images/icons/user.png) no-repeat scroll 0 2px
            transparent;
        padding-left: 20px;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: bold;
        color: #666;
    }

    .loginwrapper {
        width: 755px;
        margin: 0 auto;
    }

    .btn{ 
        background:url(../images/btn.jpg) repeat-x;
        height:28px;
        border:none;
        color:#fff;
        margin-top:20px;
    }

    .loginbox {
        background: url(../images/login_shadow.png) no-repeat;
        height: 310px;
        padding: 40px;
    }

    .rightsection {
        width: 85%;
        float: right;
        border-bottom: 1px solid #cccc;
    }

    .rightboxwrapper {
        float: left;
        width: 325px;
        padding-right: 30px;
        background: url(../images/loginleft.png) no-repeat center bottom;
        height: 262px;
    }

    .rightboxwrapper .loginheader h2 {
        color: #0588ab;
        font-size: 16px;
        font-family: trebuchet MS;
        margin: 0;
        text-align: left;
    }

    .loginform input {
        width: 170px;
    }

    .loginform input#btnsubmit {
        width: 80px !important;
        border: none;
    }

    .loginform {
        padding: 10px 0 0 45px;
        line-height: 35px;
        background: url(../images/lock.png) no-repeat right center;
        width: 335px;
    }

    .loginform td {
        color: #333333;
        font-family: trebuchet MS;
        font-size: 12px;
        padding: 0;
        margin: 0;
    }

    .copyright {
        width: 100%;
        text-align: right;
        padding: 5px 0px;
        font-size: 11px;;
        color: #0588ab;
        font-family: trebuchet MS;
    }

    .copyright p {
        padding-right: 15px !important;
    }
4

1 回答 1

1

我能想到的原因有几个:

  1. 您忘记将页面链接到 CSS。
  2. css 没有加载(可能是 url 错误),您可以通过右键单击页面并选择“查看源代码”来检查这一点,然后在顶部找到 css url 并单击它以查看是否得到它。

如果您发布 jsp/css 将会很有帮助。

于 2012-06-25T08:22:02.127 回答