【问题标题】:Designing issue in JSP and servletsJSP 和 servlet 中的设计问题
【发布时间】:2012-06-25 06:58:05
【问题描述】:

我正在使用 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;
    }

【问题讨论】:

  • 你需要先学习 HTML/CSS。请购买一些好书(不要使用 w3schools、dreamweaver 等),使用简单的文本编辑器或 IDE,如 netbeans、eclipse 等)。
  • 你是在tomcat上运行jsp页面吗?直接在浏览器上运行jsp是不行的。

标签: java jsp tomcat servlets


【解决方案1】:

我能想到的原因有几个:

  1. 您忘记将页面链接到 css。
  2. css没有加载(可能是url错误),你可以通过右键页面并选择'view source'来检查这个,然后在顶部找到css url并点击它看看你是否得到它.

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

【讨论】:

  • AurA:我正在使用 tomcat 6 来运行 jsp 页面。我的问题是设计无法正常工作。但是有时当我再次运行它的工作正常时,如果我刷新浏览器徽标会自行消失。
  • 如何上传 css 文件?你能给你的电子邮件地址添加我可以发送整个项目的位置吗?
  • 只需编辑您的问题并复制粘贴相关文本,但请确保将其作为代码(在顶部使用大括号)
  • 对不起,我无法上传 css 文件,\
  • ftom2 这里是css文件...请问有没有错误?
猜你喜欢
  • 2010-10-12
  • 1970-01-01
  • 2011-09-01
  • 1970-01-01
  • 2014-03-14
  • 2011-11-24
  • 2014-01-26
  • 2016-05-20
  • 2019-12-30
相关资源
最近更新 更多