Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在页面的角落或中间添加html元素(按钮、链接等)?_Html_Css_Jsp - Fatal编程技术网

如何在页面的角落或中间添加html元素(按钮、链接等)?

如何在页面的角落或中间添加html元素(按钮、链接等)?,html,css,jsp,Html,Css,Jsp,我有一个经理页面,我想在页面的右侧添加一个注销按钮 我知道如何逐个添加按钮,例如: 以下是上述页面的代码: <!-- Bank manager's permissions --> <!DOCTYPE html> <html> <head><title>Bank Manager's Transactions Page</title> <link rel="stylesheet" href="./css/styles.

我有一个经理页面,我想在页面的右侧添加一个注销按钮

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

以下是上述页面的代码:

<!-- 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>

银行经理的交易页面
经理的交易页面
你好${name.firstName}${name.lastName},您已成功登录!
请选择以下选项之一
获取银行所有员工的名单
获取银行所有客户的名单
获取银行所有透支客户的名单
获取银行透支客户的数量
获取当月的完整财务报告
获取特定日期的完整财务报告
如何在JSP文件的某个角落添加按钮


而言,它就像编写一个
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>



这只是一个例子。此示例将把您的
链接置于右侧。设置参数,使
注销链接位于您喜欢的位置。您可能还希望将其放在顶部或底部。

这就像编写
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>


这只是一个例子。此示例将把您的
链接置于右侧。设置参数,使
注销链接位于您喜欢的位置。您可能还想把它放在顶部或底部。

试试这个

style.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>

你的文字
试试这个

style.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>

你的文字
检查以下内容:

        <!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>

银行经理的交易页面
正文,html
{
保证金:0;
}
#注销
{
浮动:对;
}​
经理的交易页面
你好${name.firstName}${name.lastName},您已成功登录!
请选择以下选项之一
获取银行所有员工的名单
​
检查以下内容:

        <!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>

银行经理的交易页面
正文,html
{
保证金:0;
}
#注销
{
浮动:对;
}​
经理的交易页面
你好${name.firstName}${name.lastName},您已成功登录!
请选择以下选项之一
获取银行所有员工的名单
​

这更多的是一个html/css问题,而不是一个与JSP相关的问题。您可以在按钮周围使用
标记,然后在
上使用CSS的位置属性。您需要在页面右角的注销按钮?这更多是一个html/CSS问题,而不是与JSP相关的问题。您可以在按钮周围使用
标记,然后在
上使用CSS的位置属性。您需要在页面右角的注销按钮?请不要使用内嵌CSS给出答案。这可能比使用外部样式表更容易,但它会造成混乱的HTML。请不要使用内联CSS给出答案。这可能比使用外部样式表更容易,但会造成混乱的HTML。