второй div включается в первый div, даже если они разные и flex box не работает - PullRequest
0 голосов
/ 12 апреля 2020
<section class="third-part">
<div class="first">
<h2>PHILOSOPHY</h2>
<p>Following the ideas of the Old Academy, Zeno divided philosophy into three parts: logic (a wide subject including rhetoric, grammar, and the theories of perception and thought); physics (not just science, but the divine nature of the universe as well); and ethics, the end goal of which was to achieve eudaimonia through the right way of living according to Nature. 
    <br> <br>In his treatment of Logic, Zeno was influenced by Stilpo and the other Megarians. Zeno urged the need to lay down a basis for Logic because the wise person must know how to avoid deception, Cicero accused Zeno of being inferior to his into the comprehensible and the incomprehensible, permitting for free-will the power of assent (sinkatathesis/συνκατάθεσις) in distinguishing between sense impressions.
</p>
<div>
<div class="statue">
    <img src="https://i.postimg.cc/sx21rnDB/Image-2-2x.png
        "class="statue" alt="statue of him">
</div>


Я хочу раздел, в котором есть заголовок и текст на одной стороне и изображение на другой стороне. Итак, для этого я создал раздел, в котором есть два элемента div, первый из которых имеет заголовок и абзац, а второй - изображение, а затем в css я поставил display как flex. Но это не сработало. Когда я его проверил, это показывает, что второй div включен только в первый div.

Итак, у меня два вопроса

  1. Почему второй div включен в первый div?
  2. Как заставить работать flex box?

1 Ответ

0 голосов
/ 12 апреля 2020

Единственное, что вы делаете неправильно, вы не закрываете первый div, и по этой причине вы получаете второй div внутри первого.

Просто закройте ваш, он будет работать нормально.

<div class="first">
<h2>PHILOSOPHY</h2>
<p>Following the ideas of the Old Academy, Zeno divided philosophy into three parts: logic (a wide subject including rhetoric, grammar, and the theories of perception and thought); physics (not just science, but the divine nature of the universe as well); and ethics, the end goal of which was to achieve eudaimonia through the right way of living according to Nature. 
    <br> <br>In his treatment of Logic, Zeno was influenced by Stilpo and the other Megarians. Zeno urged the need to lay down a basis for Logic because the wise person must know how to avoid deception, Cicero accused Zeno of being inferior to his into the comprehensible and the incomprehensible, permitting for free-will the power of assent (sinkatathesis/συνκατάθεσις) in distinguishing between sense impressions.
</p>
<div>

до

<div class="first">
<h2>PHILOSOPHY</h2>
<p>Following the ideas of the Old Academy, Zeno divided philosophy into three parts: logic (a wide subject including rhetoric, grammar, and the theories of perception and thought); physics (not just science, but the divine nature of the universe as well); and ethics, the end goal of which was to achieve eudaimonia through the right way of living according to Nature. 
    <br> <br>In his treatment of Logic, Zeno was influenced by Stilpo and the other Megarians. Zeno urged the need to lay down a basis for Logic because the wise person must know how to avoid deception, Cicero accused Zeno of being inferior to his into the comprehensible and the incomprehensible, permitting for free-will the power of assent (sinkatathesis/συνκατάθεσις) in distinguishing between sense impressions.
</p>
</div>

Надеюсь, это поможет!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...