2014-06-11 4 views
0

PHP 페이지를 작성하고 있지만 브라우저의 크기를 조정하면 div 요소가 이동하지 않습니다. 예.자동 정렬이 작동하지 않습니다.

 <html> 
      <head> 
       <style> 
        body{background-color: #CDD3FA} 

        #paragraph { 
         margin-right: 300px; 
         margin-left: 300px; 
         width: 720px; 
         border: 1px solid #a1a1a1; 
         padding: 10px 40px; 
         background: #E0E2EE; 
         border-radius: 25px; 
         text-align: justify; 

        } 
     </style> 

      </head> 
      <body> 
       <div id="paragraph"> 
         <p><strong> Note: Application for TAC approval is similar, but not identical, to Section II of the Institutional Ethics Committee Application Form. As far as possible, the total length of the TAC application, with the responses, should not exceed six pages or 2500 words. Use of simple language is preferred. Ensure that full forms or definitions of all abbreviations and acronyms are given. The investigator should ensure that sufficient information is provided to show that the study is scientifically sound and technically feasible, and that the expected outcome of the study is clearly defined. If the sub-sections A to H are not sufficient to provide these aspects of the research, additional details of the study should be provided in sub-section I.</strong></p> 
     </div> 

    </body> 
</html> 

페이지의 크기를 조정할 때 어떻게 센터링을 수정합니까?

답변

3

시도, 당신의 CSS를이 (업데이트 코드와 바이올린)

#paragraph { 
        margin: 0 auto; 
        width: 300px; 
        border: 1px solid #a1a1a1; 
        padding: 10px 40px; 
        background: #E0E2EE; 
        border-radius: 25px; 
        text-align: justify; 

       } 

Working Fiddle

+1

* 너의 margin-right와 margin-left를 이것으로 대체한다 –

+0

k 잘 작동한다 .... 그러나 왼쪽과 오른쪽 마진을 설정하는 방법 – Shahanas

+0

너비를 설정할 때 작동한다. – Shahanas

0

작업을 시도 CSS :

margin: 0 auto; 
0

이이 일을해야 시도 나이 알고하자 잘못되었습니다 [여기를 클릭하십시오] [1]

관련 문제