2013-03-26 4 views
0

어떻게 설명해야할지 모르겠지만 최선을 다할 것입니다. 나는 이것에 아주 새롭다 :/포함 텍스트 배치

이것은 내가 사용하고있는 나의 기본 템플릿이다. 나는 그것을 포함하고 모든 페이지에 그것을 포함한다. 모든 것은 작동하지만, 나는 넣을 수 있기를 원한다. 각 페이지의 템플릿 본문 영역에 다른 텍스트/물건. 지금은 페이지에 물건을 추가 할 때마다 템플리트 본문 영역이 공백으로 유지되고 추가 한 모든 내용이 전체 템플리트 아래로 이동합니다.

<html> 
<head> 
<title>Title</title> 
<style> 
/* Start CSS */ 

/* This changes your link colors */ 
A:link 
{ text-decoration: none; color: #003399; } 
A:visited 
{ text-decoration: none; color: #003399; } 
A:active 
{ text-decoration: none; color: #003399; } 
A:hover 
{ text-decoration: none; color: #6666FF; } 


/* This changes the basic properties of your layout */ 
body 
{ font-family: Verdana; sans serif; helvetica; 
color: #333333; 
font-size: 10px; 
background-color: #778899; 
background-image: url('../ '); 
text-align: justify; 
margin-bottom: 5px; 
margin-right: 0px; 
margin-top: 5px; 
} 

/* This code centers the layout */ 
#container { 
margin:0px auto 0px auto; 
width:100%; 
text-align:center; 
} 


/* Leave this be */ 
#container2 { 
width: 1100px; 
text-align: left; 
margin: 0px auto; 
position: relative; 
min-height: 300px; 
} 


/* This code controls the properties of your left menu */ 
#leftmenu 
{ font-family: Verdana; sans serif; helvetica; 
color: #333333; 
font-size: 10px; 
background-color: #E8E8E8; 
background-image: url('../ '); 
text-align: left; 
border: 0px solid #000000; 
width:160px; 
padding:10px; 
} 
/* This code controls the link boxes on the sidebars */ 
a:link,a:visited 
{ 
display:block; 
font-weight:bold; 
color:#FFFFFF; 
background-color:#98bf21; 
width:160px; 
text-align:center; 
padding:4px; 
text-decoration:none; 
} 
a:hover,a:active 
{ 
background-color:#7A991A; 
} 


/* This code controls the properties of your right menu */ 
#rightmenu 
{ font-family: Verdana; sans serif; helvetica; 
color: #333333; 
font-size: 10px; 
background-color: #E8E8E8; 
background-image: url('../ '); 
text-align: right; 
border: 0px solid #000000; 
width:160px; 
padding:10px; 
} 


/* This code is not mandatory, but sets a background for the menu headers */ 
#menuheader 
{ font-family: verdana; helvetica; sans serif; 
color: #333333; 
font size: 10px; 
background-color: #CCCCCC; 
background-image: url('../ '); 
text-align: center; 
margin-top: 5px; 
padding:3px; 
} 

/* This code controls the properties of your content */ 
#content 
{ font-family: Verdana; sans serif; helvetica; 
color: #333333; 
font-size: 10px; 
background-color: #FFFFFF; 
background-image: url('../ '); 
border: 0px solid #000000; 
padding:10px; 
} 


/* This code controls the properties of your disclaimer */ 
#disclaimer 
{ font-family: Verdana; sans serif; helvetica; 
color: #333333; 
font-size: 10px; 
background: #CCCCCC; 
background-image: url('../ '); 
border: 0px solid #000000; 
text-align:center; 
width:1100px; 
height:90px; 
padding:10px; 
} 


/* This code controls the properties of your banner */ 
#banner 
{ background: #CCCCCC; 
background-image: url('../Images/Banner.png'); 
border: 0px solid #000000; 
text-align:center; 
width:1100px; 
height:200px; 
} 


/* This sets the properties for content headers */ 
h1 
{ font-family: verdana; sans serif; 
font-size: 15px; 
font-weight: bold; 
font-variant: small-caps; 
align:center; 
} 


/* End CSS */ 

</style> 
</head> 
<body leftmargin="0" rightmargin="0" topmargin="10" bottommargin="10"> 
<div id="container"> 
<div id="container2"> 

<table cellspacing="0" cellpadding="0" border="0"> 
<tr><td valign="top" id="banner" colspan="3"></td></tr> 
    <tr> 
     <td valign="top" id="leftmenu"> 

<!-- Start Left Menu --> 

     <div id="menuheader">Home</div> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a> 

     <div id="menuheader">Shops</div> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a> 


<!-- End Left Menu--> 

     </td> 
     <td valign="top" id="content"> 
     <div align="justify"> 

<!-- Start Content --> 



<!-- End Content --> 
</div> 
     </td> 
     <td valign="top" id="rightmenu"> 

<!-- Start Right Menu --> 

     <div id="menuheader">Ranks</div> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a> 

     <div id="menuheader">Maps</div> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a><br /> 
     <a href="#">Link Here</a> 

<!-- End Right Menu --> 

     </td> 
    </tr> 
    <tr> 
     <td valign="top" id="disclaimer" colspan="3"> 

<!-- Start Disclaimer --> 

Add disclaimer. 

<p> 

<!-- End Disclaimer --> 

     </td> 
    </tr> 
</table> 
</div> 
</div> 
</body> 
</html> 

나는 아주 단순한 어리석은 일을 알고 있지만 잘 모른다.

+0

만약 내가 할 수 있다면, 어디에서 템플릿을 얻었습니까 ?? – egig

+0

나는 오랫동안 파일에 담아서 기억해 냈다. – Sakai

답변

0

PHP include()는 파일 내용을 포함하는 것을 의미합니다. 그것은 실제 주문에 따라 파싱됩니다. 내가 추측 할 수있는 프레임 워크가 필요합니다. 당신은 그 파일을 포함하고 그 직후에 물건을 넣는 것만으로 그 몸체 템플릿에 물건을 넣을 수 없습니다.

0

아마도 가장 좋은 방법은 아니지만 제대로 작동합니다.

는 각 페이지에 나는이 길을 계속하지 않을이

function body_content(){ 
    echo 'simple content'; 
} 
0

처럼 내용을 메인 템플릿의 body 태그에 echo body_content();를 추가합니다. Includes는 footer, sidebar, navigation, header 등 모든 페이지에서 반복해야하는 내용에 유용합니다. 모든 내용을 일부 포함하여 복사 할 수 있지만 별도의 .html 또는 .html을 사용하는 것이 훨씬 더 합리적입니다. 각 페이지에 대한 PHP 워드 프로세서. 또는 jQuery 모바일과 같은 프레임 워크를 사용하십시오.하지만 아직 준비되지 않은 것 같습니다. 행운을 빕니다!