页面看起来不同。刷新后

时间:2014-08-29 06:26:44

标签: html twitter-bootstrap jsp

我遇到一个奇怪的问题,当页面初始加载时,标题图块中的某些图标会展开。但是当刷新页面时,标题图块图标位于它们应该的位置:

enter image description here

enter image description here

以下是我在所有页面中包含的header.jsp文件的代码:

<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@page import="Entity.User" %>
<% User user = (User) session.getAttribute("user"); %>

<!DOCTYPE html>
<html>
<head>
<title>Fakebook</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="resources/css/bootstrap.css">
<link rel="stylesheet" href="resources/css/fakebookStyle.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">

            <a class="navbar-brand" href="<% if(user!=null){ %>controller?funktion=newsfeed<% }else{ %>/index.html<% } %>">Fakebook</a>&nbsp;&nbsp;
            <a href="#" class="iconStyle glyphicon glyphicon-envelope"></a>&nbsp;&nbsp;
            <a href="#" class="glyphicon glyphicon-user"></a>&nbsp;&nbsp;
            <a href="#" class="glyphicon glyphicon-globe"></a>&nbsp;&nbsp;

        </div>
            <form role="search" class="navbar-form navbar-left">
                <div class="form-group">
                  <input type="text" placeholder="Search" class="form-control">
                </div>
            </form>
        <% if(user != null){ %>
        <div class="navbar-collapse collapse pull-right" style="margin-top: 15px;">
            <a href="controller?funktion=profile"><b><%= user.getFornamn() %> <%= user.getEfternamn() %></b></a>&nbsp;&nbsp;
            <a href="controller?funktion=logout" class="btn btn-default"><b>Logout</b></a>
        </div><!--/.navbar-collapse -->
        <% } else { %>
        <div class="navbar-collapse collapse">
            <form class="navbar-form navbar-right" role="form">
                <div class="form-group">
                    <input type="text" placeholder="Email" class="form-control">
                </div>
                <div class="form-group">
                   <input type="password" placeholder="Password" class="form-control">
                </div>
                    <button type="submit" class="btn btn-default">Sign in</button>
            </form>
        </div><!--/.navbar-collapse -->
        <% } %>
    </div>
</div>

我做错了什么?

0 个答案:

没有答案