Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.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_Position_Article - Fatal编程技术网

Html 按布局在页面上定位元素

Html 按布局在页面上定位元素,html,css,image,position,article,Html,Css,Image,Position,Article,我有个问题。我在下面的图片上做了站点布局图。几乎每件事都很好,但有一个问题:这是一篇整篇文章: 当文本较多时,按钮很好,但当文本较少时,按钮向上移动。。。 如何正常定位,并确保它不会影响水平线上的其他内容? 我的代码:HTML: <article id = 'article'> <section><!--first section--> <h1>This is header of theme1</h1> <p&

我有个问题。我在下面的图片上做了站点布局图。几乎每件事都很好,但有一个问题:这是一篇整篇文章: 当文本较多时,按钮很好,但当文本较少时,按钮向上移动。。。 如何正常定位,并确保它不会影响水平线上的其他内容? 我的代码:HTML:

<article id = 'article'>
<section><!--first section-->
     <h1>This is header of theme1</h1>
     <p>
         <img src = "" class = '> Lorem ipsum dolor sit amet..
     </p>
 <a href="#">
     <input type = 'submit' value = '' class = 'button'/>
 </a>
 </section>
 <hr>
<section><!-- [n-1] section-->
     <h1>This is header of theme2</h1>
     <p>
         <img src = "" class = '> Lorem ipsum dolor sit amet..
     </p>
 <a href="#">
     <input type = 'submit' value = '' class = 'button'/>
 </a>
 </section>
 <hr>
布局:

这是一个问题:

我认为这将解决您的问题:

hr {
    clear: both;
    float: none;
}

从帮助用户,左附加按钮下的图像这也工作,你能知道,如何移动按钮下的图像?
hr {
    clear: both;
    float: none;
}