【问题标题】:How to align 3 paragraphs side by side html如何将 3 个段落并排对齐 html
【发布时间】:2016-03-18 15:51:09
【问题描述】:

好的,所以我已经尝试了所有可能的实现 div、float 和 in-lines 的示例,以使所有三个表并排放置,但没有任何效果。这是我到目前为止编写的代码,请告诉我我可能做错了什么。在花了好几个小时尝试不同的方式输入编码后,我无法弄清楚

<div align="left;"><div style="width:30%;auto;position;relative;background-color:#131313;border:2px solid #1b463d;"><div style="left;"><img src="http://wallpapershacker.com/wallpaper_3840x2160/clockwork_watches_clocks_time_desktop_1600x1200_hd-wallpaper-455121.jpg" style="max-width:100%;">

<div style="width:100%;height:100%;overflow:auto;background-color:#111111;text-align:float:left;justify;font-family:verdana;font-size:10px;color:#636362;"><br>CLOCKWORK DREAMS.</br> This is where the machines rule. Whether it be an entire being augmented with robotics, or humans with mechanical adornaments. Those who embrace Science and obey its principles are welcomed here. >$[zone_1]</div></div>

<div align="left;"><div style="width:30%;auto;position;relative;background-color:#131313;border:2px solid #1b463d;"><div style="center;"><img src="http://trucosyfondos.com/fondos-de-pantalla/data/media/10/Demon_angel.jpg" style="max-width:100%;">

<div style="width:100%;height:100%;overflow:auto;background-color:#111111;text-align:float:left;justify;font-family:georgia;font-size:10px;color:#636362;"><br>TRANSCENDED.</br>Hell and Heaven have an existence, and this is where it dwells. Those who are monsters, saints, or perhaps even a hybrid of each thrive in this part of the world. >$[zone_2]</div></div>

<div align="left;"><div style="width:30%;auto;position;relative;background-color:#131313;border:2px solid #1b463d;"><div style="right;"><img src="http://orig10.deviantart.net/8658/f/2007/202/9/b/human_reflection_by_yudha3.jpg" style="max-width:100%;">

<div style="width:100%;height:100%;overflow:auto;background-color:#111111;text-align:float:left;justify;font-family:sylfaen;font-size:10px;color:#636362;"><br>THE ENIGMATIC</br>What does it mean to be human? The idea of freedom and independance has long been sought for, and here is where those ideals exist. >$[zone_3]</div></div>

【问题讨论】:

  • 您能否更具体地谈谈您的问题?也许这个链接可能会有所帮助:learnlayout.com/inline-block.html
  • 我正在尝试显示我使用的代码,但是当我这样做时它会格式化它
  • 您必须选择您的代码并点击此图标:{}

标签: html alignment html-table paragraph


【解决方案1】:

更新 看看这个:

https://jsfiddle.net/fh2st5nm/2/

html:

 <div class="oneThird">
  <img src="http://wallpapershacker.com/wallpaper_3840x2160/clockwork_watches_clocks_time_desktop_1600x1200_hd-wallpaper-455121.jpg" />
  <p>CLOCKWORK DREAMS.<br> This is where the machines rule. Whether it be an entire being augmented with robotics, or humans with mechanical adornaments. Those who embrace Science and obey its principles are welcomed here. >$[zone_1]</p></div>
 <div class="oneThird">
   <img src="http://trucosyfondos.com/fondos-de-pantalla/data/media/10/Demon_angel.jpg" />
   <p>TRANSCENDED.<br>Hell and Heaven have an existence, and this is where it dwells. Those who are monsters, saints, or perhaps even a hybrid of each thrive in this part of the world. >$[zone_2]</p></div>
 <div class="oneThird">
   <img src="http://orig10.deviantart.net/8658/f/2007/202/9/b/human_reflection_by_yudha3.jpg" />
<p>THE ENIGMATIC<br>What does it mean to be human? The idea of freedom and independance has long been sought for, and here is where those ideals exist. >$[zone_3]</p></div>

css:

.oneThird {
  width: 33%;
  float: left;
  background-color: #111;
  text-align: justify;
  font-family: sylfaen;
  font-size: 10px;
  color: #636362;
  }
 .oneThird img {width: 100%;}
 .oneThird p {padding: 3px;}

【讨论】:

    【解决方案2】:
            here you dont need css also you should have one main div with width 100% and its children are have style float=left likebelow
    
        <div id="maindiv">
                <div class="inline">div 111111111111111111  </div>
                <div class="inline">div 2222222222222222222 </div>
                <div class="inline"> div 33333333333333333333333</div>
           </div>
    
    css..........
    .inline{
    float:left
    }
    

    【讨论】:

    • 不要养成坏习惯,不要在dom中使用“风格”,如果你在重复它,更是如此。 :)
    猜你喜欢
    • 2016-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-04
    相关资源
    最近更新 更多