Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
环绕图像的Html文本_Html_Css_Image_Word Wrap - Fatal编程技术网

环绕图像的Html文本

环绕图像的Html文本,html,css,image,word-wrap,Html,Css,Image,Word Wrap,我正在做一个网站使用灵活的盒子模型。我试图让文本对齐到图像的右侧,然后在图像的下方。我尝试了Float:right/left和align=left/right,它们只是让图像消失。这是因为灵活的盒子模型吗?这是源代码。这篇文章是我在坦克世界网站上使用的一个例子 <div id="content"> <section id="section"> <div id="title"> <h1>This is

我正在做一个网站使用灵活的盒子模型。我试图让文本对齐到图像的右侧,然后在图像的下方。我尝试了Float:right/left和align=left/right,它们只是让图像消失。这是因为灵活的盒子模型吗?这是源代码。这篇文章是我在坦克世界网站上使用的一个例子

<div id="content">
    <section id="section">
        <div id="title">
            <h1>This is the Title</h1>
        </div>
        <div id="info-p">
            <div id="photo">
                <img id="img" src="400x300.png">
            </div>
        <article id="info">
            <p>
                US Army tankers, by late March 1945, when the final surge into Germany began, were among the most savvy graduates of the school of war. They knew how to storm cities and deal with small groups of defenders in villages or at crossroads. They could slog through fortifications and run like the cavalry of old. By and large, they had worked out effective teamwork strategies with the infantry, tank destroyers, and artillery, even if still a bit ambivalent about their friends in the fighter-bombers above them. They had learned to beat better tanks and worked out a series of pragmatic technical solutions to problems ranging from communication to moving on ice.

The German Army fought on like a body without a brain—OKW records show it was often a couple days behind developments on the battlefield, and headquarters at all levels had difficulty delivering orders to units that often existed only on paper. Lt. Gen. George Patton’s G-2 shop estimated that as of March 17, total German tank strength on the western front amounted to the equivalent of a single full-strength panzer division.1 As of March 31, the entire force of panzers and assault guns in Third Army’s sector was estimated at only 55 vehicles, all opposite XX Corps in the Fulda area.2

Cornelius Ryan captured the essence of the final push: “The race was on. Never in the history of warfare had so many men moved so fast. The speed of the Anglo-American offensive was contagious, and all along the front, the drive was taking on the proportions of a giant contest.”3 So fast, indeed; between April 24 and 30, the 737th Tank Battalion moved 520 miles.4

The Ninth Army pounded in the direction of Berlin all the way to the Elbe River. Just to the    south, First Army advanced to the Mulde River. Patton’s Third Army drove toward Czechoslovakia, and Seventh Army pushed through Bavaria toward the rumored Nazi National Redoubt in the Bavarian Alps and Austria.5

The tankers rolled past columns of German POWs heading for the rear, often with no supervision.     Increasingly, displaced persons and released Allied POWs also appeared.
            </p>
        </article>

    </section>


</div>

谢谢你的帮助。很抱歉格式不好,这是我在这里的第一篇文章

webkit框就是把它扔掉的东西……但是从语义上讲,把它放在文章中是正确的方式

这很好:


我想你忘了关闭你的info-p div,然后你只需添加float:left,它就可以工作了


请参阅。

这与flexbox规格无关。如果希望文本环绕浮动元素(例如图像),则文本和元素必须是同级。换句话说,您必须将图像移动到元素中,以使文本环绕它。感谢您的帮助@Fusive-看起来您正在使用过时的旧flexbox规范。最新的浏览器和许多版本支持新的flexbox规范。我知道。。。我正在学习Newboston的HTML5教程,我想它们是2011年的。我需要学习更新的模型。有没有什么地方可以展示过时的版本被转换成了什么,或者我必须从头开始学习。编辑:谢谢你的链接。
#section{
font: 14px Trebuchet MS;
}
#title{
text-align:left;
display:-webkit-box;
-webkit-box-pack:left;
padding:5px;
margin:10px;
}
#info-p{
display:-webkit-box;
-webkit-box-pack:left;
padding:5px;
margin:10px;
}
#photo{


}
#info{
display:-webkit-box;
-webkit-box-pack:left;
-webkit-box-flex:1;
padding:5px;
margin:10px;
max-width:800px;

}
#section{
font: 14px Trebuchet MS;
}
#title{
text-align:left;
display:-webkit-box;
-webkit-box-pack:left;
padding:5px;
margin:10px;
}
#info-p{
padding:5px;
margin:10px;
}
#photo{
float:right;
    margin-left:5px;
    margin-bottom:5px;

}
#info{
padding:5px;
margin:10px;
max-width:800px;

}