html css 问题

来源:百度知道 编辑:UC知道 时间:2024/06/09 11:43:14
我的html是这样写的
<html>
<head>
<title>jjjjjjkjljl
</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" type="text/css" href="kk/st.css" media="all" />
</head>
<body>
<div

class="box">jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

jjjjjjjjjjjjjjjjjjjjjj

添加一行代码:
word-wrap:break-word; overflow:hidden;

实现自动换行

有些也会这样写

word-break:break-all

注:有全部一个英文字符有时真的会出现你说的情况,用中文试试,当然不是同一个字的重复。

.box{margin:50px 200px 200px 200px;
color:red;
background:white;
height: 500px;
width: 100px;
border:1px solid black;
overflow:visible;}
.box的上级容器是body,没有设置高度,所以margin只有上边距没有下边距

不同的浏览器显示的也不一样,我的IE8显示就正常