Note that there are some explanatory texts on larger screens.

plurals
  1. POThe text in float right is displayed in the left side
    primarykey
    data
    text
    <p>I'm getting trouble in the display of the following code. I'm concerned with dividing the <code>&lt;div class="contectCode"&gt;</code> to two <code>&lt;div class="left"&gt;</code> and <code>&lt;div class="right"&gt;</code>. So, some of the cases of switch should be displayed in the left and some in the right. </p> <pre><code>&lt;?php $xml = simplexml_load_file("Profiles.xml"); foreach($xml-&gt;children() as $Developer){ echo '&lt;div class="contectCode" style="height: 260px;"&gt;'; echo '&lt;div class="left" style="width:365px;"&gt;'; echo '&lt;b&gt;' . $Developer['name'] . '&lt;/b&gt;'; echo '&lt;/div&gt;&lt;br/&gt;'; echo '&lt;div class="left" style="width:365px; float:left; text-align:left;"&gt;'; echo '&lt;p&gt;&lt;b&gt;&lt;i&gt;Communications with you&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;'; echo '&lt;/div&gt;'; echo '&lt;div class="right" style="width:365px; float:right; text-align:left;"&gt;'; echo '&lt;p&gt;&lt;b&gt;&lt;i&gt;Communications with other developers &lt;/i&gt;&lt;/b&gt;&lt;/p&gt;'; echo '&lt;/div&gt;'; foreach($Developer-&gt;children() as $factor){ switch ($factor-&gt;getName()){ case "trust": echo '&lt;div class="left" style="width:365px; float:left; text-align:left;"&gt;'; if($Developer['gender'] == "Male") echo '&lt;p&gt;You have selected (trusted) him to help you ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; else echo '&lt;p&gt;You have selected (trusted) her to help you ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; echo '&lt;/div&gt;'; break; case "response": echo '&lt;div class="left" style="width:365px; float:left; text-align:left;"&gt;'; if($Developer['gender'] == "Male") echo '&lt;p&gt;He hes responded to your help request ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; else echo '&lt;p&gt;She has responded to your help request ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; echo '&lt;/div&gt;'; break; case "indegreeOutdegree": echo '&lt;div class="left" style="width:365px; float:left; text-align:left;"&gt;'; if($Developer['gender'] == "Male") echo '&lt;p&gt;He has helped you to complete your code ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; else echo '&lt;p&gt;She has helped you to complete your code ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; echo '&lt;/div&gt;'; break; case "recommended": echo '&lt;div class="left" style="width:365px; float:left; text-align:left;"&gt;'; if($Developer['gender'] == "Male") echo '&lt;p&gt;He has been recommended to you by others ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; else echo '&lt;p&gt;She has been recommended to you by others ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; echo '&lt;/div&gt;'; break; case "trustG": echo '&lt;div class="right" style="width:365px; float:right; text-align:left;"&gt;'; if($Developer['gender'] == "Male") echo '&lt;p&gt;He has been selected (trusted) by others ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; else echo '&lt;p&gt;She has been selected (trusted) by others ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; echo '&lt;/div&gt;'; break; case "responseG": echo '&lt;div class="right" style="width:365px; float:right; text-align:left;"&gt;'; if($Developer['gender'] == "Male") echo '&lt;p&gt;He has responded to others requests ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; else echo '&lt;p&gt;She has responded to others requests ' . $factor . ' times &lt;/p&gt;&lt;br/&gt;'; echo '&lt;/div&gt;'; break; case "indegreeOutdegreeG": echo '&lt;div class="right" style="width:365px; float:right; text-align:left;"&gt;'; if($Developer['gender'] == "Male") echo '&lt;p&gt;He has helped other developers ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; else echo '&lt;p&gt;She has helped other developers ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; echo '&lt;/div&gt;'; break; case "recommendedG": echo '&lt;div class="right" style="width:365px; float:right; text-align:left;"&gt;'; if($Developer['gender'] == "Male") echo '&lt;p&gt;He has been recommended to help by others ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; else echo '&lt;p&gt;She has been recommended to help by others ' . $factor . ' times&lt;/p&gt;&lt;br/&gt;'; echo '&lt;/div&gt;'; break; } } echo '&lt;/div&gt;'; } ?&gt; </code></pre> <p>If the output shows cases from the both the left and right divs, it works well. However, if the output shows cases in the right div, it shifts them to the left. I want to display them in the right and not in the right. </p> <p>So, how can I do that?</p> <p>The CSS is </p> <pre><code>.contectCode { font-size:15px; line-height:24px; margin-left:13px; margin-right:13px; border-style:solid; border-width:2px; border-color:#000066; padding:10px; margin-top:5px; margin-bottom:10px; } .left { float:left; width:60%; } .right { float:left; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload