html - 2 行响应图像

标签 html image css css-float

我想在页面中央连续制作 2 个图像。 我的图像有不同的尺寸,但我希望它们位于中心并在同一条线上。 首先我尝试在框架 7 中使用 row 和 col-50

<div class="row">
    <div class="col-50"><img src="1.jpg"></div>
    <div class="col-50"><img src="2.jpg"></div>
</div>   

但是它不能正常工作,然后我用这种方式手动使用 css 样式

<div style="width:100%;display:inline-block;">
    <div style="width:50%;float:left">
        <img src="1.jpg" style="margin:auto;display:block" />
    </div>
    <div style="width:50%;float:left">
        <img src="2.jpg" style="margin:0 auto;display:block;"/>
        <span style="font-size: 40px; color: #4c4c4c; font-family: Calibri;">Logo company</span>
        <br />
        <span style="font-size: 12px; color: #4c4c4c; font-family: 'Helvetica Neue',sans-serif;">write here your brand</span>
    </div>
</div>

最佳答案

你也可以使用flexbox,像这样

.row {
  display: flex;
  align-items: center;
  justify-content: center;
  
}
<body style="background-color: #f6f6f6">

<div dir="ltr" class="page-content center" style="min-width: 400px; min-height: 400px; margin: auto; width: 58%; padding: 20px;">

    <!-- Logo -->
    <!--<p style="text-align: center;">-->
        <div class="row">
            <div class="col-50">
             <img src="http://i64.tinypic.com/2ni7hjk.jpg" />
            </div>
            <div class="col-50">
                <img src="http://i68.tinypic.com/dunp0.png"/>
                <span style="font-size: 40px; color: #4c4c4c; font-family: Calibri;">logoeri</span>
                <br />
                <span style="font-size: 12px; color: #4c4c4c; font-family: 'Helvetica Neue',sans-serif;">logo company is here</span>
            </div>
         </div>

    <!-- Header -->

    <div id="Header" style="font-family: 'Helvetica Neue',sans-serif; text-align: center; font-size: 30px; padding: 20px; color: white; background-color: #3eb780">
    the header is here
    </div>


    <!-- Center Container -->

    <div style="font-family: 'Helvetica Neue',sans-serif; background: white;padding: 20px; font-size: 14px; font-family: Arial; direction: ltr; text-align: left;">           <p>
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).


    </p>





        <!-- Footer -->
        <div style="text-align: center; color: #a2a2a2">
            <div style="width: 90%; margin: auto; padding: 20px;">
                Do not reply<br />


            </div>
        </div>
        </div>
    </div>

关于html - 2 行响应图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43868732/

相关文章:

image - 如何从 -captureStillImageAsynchronouslyFromConnection :completionHandler:? 获得的 CMSampleBuffer 获取 NSImage

javascript - 我如何阻止使用 Jquery 加载图像

当图像未在 IE8 中显示时,Html img 标签 alt 消息与特定的 div 宽度重叠?

html - 浏览器不读取从 SASS 编译到 css 文件

javascript - 计算旋转度数的问题

javascript - js表单填写检查

html - 如何删除输入按钮右侧的多余内容?

html - 我如何使我的链接的背景颜色与我的边框相匹配

html - 悬停时链接变大字体

python - 你如何在python中显示图片?