Why is there no line break even after adding word-break: break-all;? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:12:39
Original
1699 people have browsed it




Reply to the discussion (solution)

There should be no line breaks here. Wrong thinking
white-space:nowrap;

<div class="tagwraper"><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a></div><style>.tagwraper{width:940px;/*990-48*/border:1px solid #E6E6E6;padding:24px; background:#fff; margin:0 auto;word-break : break-all; }.tagwraper:after{	content:".";	display:block;	clear:both;	height:0;	visiblity:hidden;}.tagwraper{	zoom:1;  /* for IE */}.tagwraper a{float:left;margin-right:26px;color:#3178C6;}.tagwraper a:hover{background:#217BD1;color:#fff;}</style>
Copy after login

If What you are talking about is the closing of floating elements. The above will do.

I’m confused. I just submitted it. The A tag inside is floating. It’s useless to set these on the outer layer.
There should be no line breaks here. Wrong thinking
white-space:nowrap;

<div class="tagwraper"><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a><a href="#">商人学院</a></div><style>.tagwraper{/*990-48*/border:1px solid #E6E6E6;padding:24px; background:#fff; margin:0 auto;white-space:nowrap; }.tagwraper a{display:inline-block;margin-right:26px;color:#3178C6;}.tagwraper a:hover{background:#217BD1;color:#fff;}</style>
Copy after login

I’m confused. I just submitted it. The A tag inside is floating. It’s useless to set these on the outer layer.

Quote from the 1st floor’s reply:

You should add a line break here, which is wrong.
white-space:nowrap;



JScript code

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!