Home >Web Front-end >HTML Tutorial >怎么能让div标签里面的p自动换行_html/css_WEB-ITnose

怎么能让div标签里面的p自动换行_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-21 09:33:011641browse

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head>    <title></title>  </head><body><div style="width: 100px;height:100px;background-color:green;"><p>1231111111111111111</p></div></body></html>



我想让p里面超出div宽度的部分自动切换到下一行, 这个要怎么实现 ??


回复讨论(解决方案)

word-break:break-word;

能再问个问题吗
两个p之间的间距怎么减少阿?

<html><body><p>1</p><p>2</p></body></html>

p{ line-height:来控制}

padding:0px;margin:0px;

margin padding line-height
都能控制p的间距

margin padding line-height
都能控制p的间距
+1

1231111111111111111

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn