0

我有一个经理页面,我想在页面右侧添加一个LOG-OUT按钮。

我知道如何一一添加按钮,例如:

在此处输入图像描述

这是上面页面的代码:

<!-- Bank manager's permissions -->

<!DOCTYPE html>
<html>
<head><title>Bank Manager's Transactions Page</title>
<link rel="stylesheet" href="./css/styles.css" type="text/css"/>
</head>
<body>
    <table class="title">
      <tr><th>Manager's Transactions Page</th></tr>
    </table>

    <h1>Hello ${name.firstName} ${name.lastName} , You've logged in successfully!</h1>
    <h1>
    Please choose one of the following options
    </h1>

    <!-- The followings are Manager's permissions -->

    <fieldset>
      <legend>To get a list of all the employees at the bank</legend> 
      <form action="blablabla">     <!-- THAT ONE forwards to a servlet that's called Admin1.java -->
        <a href="adminAdds1">Press here to continue</a>  
      </form>
    </fieldset>

    <fieldset>
      <legend>To get a list of all the clients at the bank</legend> 
      <form action="blablabla">     <!-- THAT ONE forwards to a servlet that's called Admin1.java -->
        <a href="adminAdds1">Press here to continue</a>  
      </form>
    </fieldset>

    <fieldset>
      <legend>To get a list of all the overdraft clients at the bank</legend> 
      <form action="blablabla">     <!-- THAT ONE forwards to a servlet that's called Admin1.java -->
        <a href="adminAdds1">Press here to continue</a>  
      </form>
    </fieldset>

    <fieldset>
      <legend>To get the number of overdraft clients at the bank</legend> 
      <form action="blablabla">     <!-- THAT ONE forwards to a servlet that's called Admin1.java -->
        <a href="adminAdds1">Press here to continue</a>  
      </form>
    </fieldset>

    <fieldset>
      <legend>To get a full financial report for the current month</legend> 
      <form action="blablabla">     <!-- THAT ONE forwards to a servlet that's called Admin1.java -->
        <a href="adminAdds1">Press here to continue</a>  
      </form>
    </fieldset>

    <fieldset>
      <legend>To get a full financial report for a specific date</legend> 
      <form action="blablabla">     <!-- THAT ONE forwards to a servlet that's called Admin1.java -->
        <a href="adminAdds1">Press here to continue</a>  
      </form>
    </fieldset>
</body>

如何在 JSP 文件的某个角落添加按钮?

问候

4

3 回答 3

3

试试这个

样式.css

#logout
{
float:right;
margin-right:20px;
height:5px;
}

在页面中

<link href="style.css" rel="stylesheet" type="text/css" />
<div id="logout"><button>Your text</button></div>
于 2012-08-08T09:28:39.833 回答
2

就像写一个css文件一样简单。

先写一个css。像这样的东西:bar.css

@charset "utf-8";
/* CSS Document */

.bar
{
 width:40px;
}

#right
{
    float:right;
    margin-right:20px;
    background:#06F;
}


然后将这些放在您的jsp文件中:

<link href="bar.css" rel="stylesheet" type="text/css" />

对于注销的链接:

<div id ="right" class="bar">
<!-- Your Link to Log out -->
</div>


这只是一个例子。这个例子会把你放在link右边。设置您的参数任何东西,让您log out link在您喜欢的地方。您可能还想把它放在顶部或底部。

于 2012-08-08T09:25:14.123 回答
1

检查这个:

        <!DOCTYPE html>
        <html>
        <head><title>Bank Manager's Transactions Page</title>
        <style type="text/css">
                body,html
                {
                    margin:0;
                }
               #logout
                {
                    float:right;
                }​
            </style>

        </head>
        <body>

<!-- Logout link, instead of using anchor tag you can replace it with button tag ...... -->

            <div id="logout">
                   <a href="logoutPage">LogOut</a>  
            </div> 

<!-- if you chose button tag, you remove the div and you can directly put stylesheet using button id -->

            <table class="title">
              <tr><th>Manager's Transactions Page</th></tr>
            </table>
            <h1>Hello ${name.firstName} ${name.lastName} , You've logged in successfully!</h1>
            <h1>
            Please choose one of the following options
            </h1>

            <!-- The followings are Manager's permissions -->

            <fieldset>
              <legend>To get a list of all the employees at the bank</legend> 
              <form action="blablabla">     <!-- THAT ONE forwards to a servlet that's called Admin1.java -->
                <a href="adminAdds1">Press here to continue</a>  
              </form>
            </fieldset>        

        <!-- code continues...... -->

        </body>​
    </html>
于 2012-08-08T09:35:06.133 回答