Why is this <p> expanding the whole page?

If you visit this page and shorten the browser window, you will see my problem. [If you want to open the page in a new window, just hold down the key while clicking the link.]

The answers to the question extend beyond the page field, and not to the packaging.

I spent the last half hour working with the Chrome Inspector and Firefox DOM - all to no avail. I just can't understand why he does it.

Update: Here is a screenshot of http://stackmobile.com/view_question.php?site=stackoverflow&id=3058417

http://files.quickmediasolutions.com/p_error.png

+3
source share
3

<pre><code> , .

:

<pre style="overflow:auto;max-width: 90%;">

, . max-width, , .

css:

pre {
  overflow: auto;
  max-width: 90%;
}

<pre>.


. , ~ 400 . 90% . Hardcoding the width :

<pre style="overflow:auto;max-width: 400px;">

pre {
  overflow: auto;
  max-width: 400px;
}
+4

. , , & ​​lt; pre > DJTripleThreat. , , .

. , .

+2

A simple example of the relative width of css. You set the width of the table to 100%, but do not set the property for tags <p>.

A simple solution could be (change in style.css: 76):

.answer_content {
  width: 80%;
}

Tested to work with Chrome 6.

0
source

Source: https://habr.com/ru/post/1750417/


All Articles