2013-06-19 3 views
-1

중간에 많은 항목이있는 웹 페이지가 있는데이 페이지의 왼쪽 상단 모서리에 "로그인되어 있습니다"라는 작은 텍스트를 추가하고 싶습니다. 로 사용자 이름 ". 어떤 생각을 어떻게 할 것인가?화면 모서리에 텍스트를 정렬하는 방법

편집 : 내 HTML 페이지

<p style="position:fixed;top:0:right:0;color:blue" size="2">You are logged in as: {{ 
<body style="margin-left:100;margin-top:50"> 
    <table border="2"> 
     <tr> 
      <th>Name</th> 
      <th>Created By</th> 
      <th>IP Range</th> 
      <th>Date to Run</th> 
     </tr> 
     <form id="checkboxes" method="post" action="myurl"> 
      <tr> 
       <td><input type="checkbox" name="checkable" /></td> 
       <td><a href="mysecondurl">name</a></td> 
       <td>user</td> 
       <td>ip</td> 
       <td>time</td> 
      </tr> 

      <select id="dropdown"> 
       <option /> 
       <option value="Delete">Delete</option> 
       <option value="Change">Change</option> 
      </select> 
      <input type="hidden" name="isDeleting" value="True"/> 
      <input type="submit" value="Go" /> 
     </form> 
    </table><br /> 
    <form method="post" action="{% url 'Minion.views.add' %}"> 
     <input type="submit" value="Add" /> 
    </form> 
    <form method="post" action="{% url 'Minion.views.index' %}"> 
     <input type="hidden" name="loggingOut" value="True"> 
     <input type="submit" value="Logout" /> 
    </form> 
</body> 

이 아래의 제안에이다, 그냥 페이지의 제목을 통해 사용자 이름 텍스트를 중첩.

+0

원하는 것을 보여주는 간단한 jsfiddle을 준비하면 도움이 될 수 있습니다. – Lion

+0

무엇을 의미합니까? – avorum

+1

가능한 방법은 절대 위치 지정을 사용하는 것입니다. – Nelson

답변

1

달려있다 : 무엇 왼쪽 상단 구석? 브라우저 창? 어떤 경우에는 position: fixed을 사용하여 왼쪽 상단에 영구히 붙여 넣을 수 있습니다. 아니면 그냥 페이지의 첫 번째 항목으로 만드십시오.

0
#userDiv { 
position: fixed; 
top: 0; 
left: 0; 
} 

이 div에 텍스트를 넣을 수 있습니다.

관련 문제