2012-10-12 3 views
0

주 div의 정적 너비를 300px로 지정하고 싶습니다. 그러나 모든 사용자가 Word 프로그램에서 텍스트를 복사하여 붙여 넣을 때 div에서 테이블 너비와 오버플로 텍스트를 변경합니다. 하지만 내 사이트의 너비는 최대 300px 여야합니다. 이 문제를 어떻게 해결할 수 있습니까?div에서 텍스트 오버 플로우

<html> 
<head> 
<style> 
#main td{ 
max-width:300px; 
} 

#main table{ 
max-width:300px; 
} 

</style> 
</head> 

<body> 
<div id="main"> 
<table width="700" border="1"> 
<tr> 
<td width="800"><p width="900">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</td> 
</tr> 

<tr> 
<td width="800"><p with="900">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p></td> 
</tr> 
</table> 
</div> 
</body> 
</html> 

답변

0

변경

#main table{ 
max-width:300px; 
} 

#main *{ 
max-width:300px; 
} 

그 방법까지, TD, IMG 등은 여전히 ​​크기가됩니다. 또한 #main div에 overflow-x:hidden을 사용하면 너무 큰 콘텐츠를 숨길 수 있습니다.

+0

하지만 숨기기 오버플로 텍스트를 원하지 않습니다. div 문장의 끝이 결론에 도달합니까? –

+0

오버 플로우를 사용하지 마십시오 : 숨김. 당신의 두 번째 문장이 무슨 뜻인지 확실하지 않아 – Salketer

+0

이렇게; 1dadad 2dadadad 3daddasd 4 문장 4 단어. 2 단어가 끝나면 3 번째 단어가 최종 줄까요? –

0

원하지 않는 인라인 스타일을 제거하려면 Word 텍스트에서 위생 설비 유형을 수행하는 것이 좋습니다. 당신은 언제나 단어에서 웹으로 오는 텍스트를 어쨌든 살살합니다. 당신은 tinyIMCE 같은 것을 사용할 수 있습니다. 그렇게하면 복사하는 것에 대해 걱정할 필요가 없으며 항상 CSS를 준수하게됩니다.

+0

네가 편집장에 대해 옳다. 나는 이미 Cke를 사용한다. 그래도 문제는 계속된다. –