簡體   English   中英

如何我如何正確對齊里面的文字<p>同時保持正確的段落模式?</p>

[英]how How do I align right the text inside <p> while maintaining the correct paragraph mode?

文本在兩者中逐字顯示

指定邊距后的部分。我想要第一個和

標簽在左邊和第二個的內容和

標簽要在右邊。我想根據左邊距,右邊距和內聯樣式等屬性來解決這個操作。我目前正在這個級別進行培訓,我必須使用這個工具進行練習

<!doctype html>

<html lang="en";>

  <head>


     <title>solarise_mk</title>

    


  </head>

  <body style="background-color:rgb(233, 150, 122);">
                    <br>
                    <br>
                    <br>



           <!--Several nested tags to create a key to link to another site-->

                         <!--start coding for  the key -->


                    <a href="https://www.herzing.edu/description/computer-programmer ">
                               <h1 style="text-align:center;">
                                      <mark  style="background-color:rgb(64,224,208);
                                                    color:rgb(233, 150, 122);
                                                    padding:30px;
                                                    border-radius:35px;
                                                    font-family:Times New Roman";> 
                                                          
                                                          solarise-mk
                                        </mark>
                                </h1>
                    </a>


                        <!--end coding for yhe key-->
      

                    <br>
                    <br>  
                    <br>
                    <br>   
                    <br>  




       <!--The following code is for inserting a photo from another site-->

                   <center>     
   
                   <img src="https://www.herzing.edu/sites/default/files/styles/fp_960_640/public/2020-09/it_computer_programming.jpg.webp?itok=8aEwtSxk" alt="What Does a Computer Programmer Do?" style="width:1000px;height:700px;">
 
                  
                   </center>

 
                            <!--ending coding for photo-->


     
                   <br>
                   <br>  
                   <br>
                   <br>
                   <br> 



              <!--start first Start the first header and paragraph-->

  
                  <h3 style="color:rgb(139,0,139);font-family:Times New Roman;margin-left: 10%;margin-right: 90%;">Site goals:</h3>
                  <p style="color:rgb(255,240,245);font-family:Times New Roman;;margin-left: 10%;margin-right: 90%;">

                           we want to introduce you 
                           exciting art of computer programming
                           And what programming is,what capabilities
                           are needed...
                           If you find you are interested in this 
                           technique And you have traces of the ability 
                           to accurately observe and then analyze
                           them correctly,Join us to enter the field of
                           programming professionally
                   </p>

   <!--end first the firstparagraph-->


                    <br>
                    <br>  
                    <br>
                    <br>
                    <br> 


                    <!--Start the second header and paragraph-->



                     <h3 style="color:rgb(119,136,153);font-family:Times New Roman;margin-left: 90%;margin-right: 10%;">As the site owner:</h3>
                     <p style="color:rgb(230,230,250);font-family:Times New Roman;;margin-left: 90%;margin-right: 10%;">
                        
                        Ever since I got to know myself, I have noticed
                        I prefer to have a private and safe environment
                        to think about analyzing problems and to
                        discovering creative solutions to solve them.
                        Usually I look around in detail, Unless I'm
                        focused on fatigue.I am interested in mathematics,
                        painting and artwork.Of course, mathematics,
                        except for arithmetic and mental counting,because
                        sometimes it is difficult for me to concentrate
                        and I basically know this as long as there 
                        is a calculator.
                        People around me tell me that you are smart but 
                        distracted and I believe in this judgment.
                        Distraction has become a problem for me in 
                        many places,if I did not have the other 
                        capabilities next to it might have been a 
                        problem .
                        Finally, I love programming and one of
                        my goals is to specialize in this field e.        
                                                                                                                                                                                                        


                                                                                                                                 
                                                                                                                                                                                                
                  </p>

                  <!--end the second header and paragraph-->



  </body>
  </html>

在一個單獨的段落標簽中完成所有這些是不必要的,而且不經常這樣做。 相反,您應該將內容分成 3 個部分。 一個用於左側內容,一個用於中心內容,最后一個用於右側內容。 使用<div>標簽(或其他元素,例如<aside><main> )執行此操作:

<div class="left_div">Left content</div>
<div class="center_div">Center content</div>
<div class="right_div">Right content</div>

/* css */

.left_div { width: 20%; text-align: left; }
.center_div { width: 60%; text-align: center; }
.right_div { width: 20%; text-align: right; }

這會產生 3 個部分或分區,其中 text-align 負責對齊 div 的內容。

你也可以使用float: left; (或right; )在圖像元素或按鈕元素上,以使這些元素移動到一側,同時使其周圍的文本圍繞浮動的 object 流動。 這通常是通過文本內的圖像來完成的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM