Html 图片上的宽度和垂直对齐

Html 图片上的宽度和垂直对齐,html,css,zurb-foundation,Html,Css,Zurb Foundation,我需要使图片的宽度为100%,这意味着图片应该填充空白,并与下面的文本垂直对齐 代码是用于电子邮件通讯的,所以我使用基金会。我无法在文档中找到我是如何做到这一点的,因此我必须尝试其他方法 如何使图片填充空白 相关HTML代码 嗯,你必须修改两件事 首先: 原始代码: <table class="row"> <tbody> <tr> <th class="small-12 large-12 columns f

我需要使图片的宽度为100%,这意味着图片应该填充空白,并与下面的文本垂直对齐

代码是用于电子邮件通讯的,所以我使用基金会。我无法在文档中找到我是如何做到这一点的,因此我必须尝试其他方法

如何使图片填充空白

相关HTML代码


嗯,你必须修改两件事

首先: 原始代码:

<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last">
<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last" style="padding:0;">
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" width="100%">
</center>
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" style="width:100%;">
</center>
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0;">
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0 !important;">
最终代码:

<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last">
<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last" style="padding:0;">
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" width="100%">
</center>
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" style="width:100%;">
</center>
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0;">
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0 !important;">
第二:原始代码:

<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last">
<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last" style="padding:0;">
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" width="100%">
</center>
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" style="width:100%;">
</center>
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0;">
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0 !important;">
最终代码:

<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last">
<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last" style="padding:0;">
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" width="100%">
</center>
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" style="width:100%;">
</center>
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0;">
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0 !important;">
向你问好

当然!,试试这个:

原始代码:

<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last">
<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last" style="padding:0;">
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" width="100%">
</center>
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" style="width:100%;">
</center>
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0;">
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0 !important;">
最终代码:

<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last">
<table class="row">
    <tbody>
        <tr>
            <th class="small-12 large-12 columns first last" style="padding:0;">
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" width="100%">
</center>
<center data-parsed="">
    <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" alt="image of clever meme that made me chuckle" align="center" class="float-center" style="width:100%;">
</center>
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0;">
<table class="row">
<tbody>
    <tr>
        <th class="small-12 large-12 columns first last" style="padding:0 !important;">
编辑**这将起作用** 最终版本 使用图像背景将更改为

<th class="small-12 large-12 columns first last" style="padding: 0 !important;">
  <table>
    <tbody>
      <tr>
        <th>
          <center>
            <div style="background:blue url('http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg') no-repeat center; background-size:cover;" alt="image of clever meme that made me chuckle">
              <img src="http://www.webdesignmo.com/blog/wp-content/uploads/2010/02/6_lion.jpg" style="display:hidden;">
            </div>
          </center>
        </th>
     </tr>
  </tbody>

?像这样?图像必须至少为600px宽。如果不是,则必须使用css使其拉伸。当你在没有添加img Responsive诅咒你@Coker类的情况下100%标记图像大小时,Bootstrap dos不会渲染超过图像大小!哈哈哈,是他给你写的。无论哪种方式,两个框架都使用最大宽度:100%;对于响应灵敏的图像,不允许图像超出图像的自然大小。基本上,添加响应类是行不通的。非常感谢。几乎每个客户都能做到这一点。唯一的问题是,当我使用手机尺寸时,图片周围会出现白色边框。这意味着文本和图片不是垂直对齐的。你猜那可能是什么?啊,不,我在那里很快。实际上,Outlook 2010和2013上的渲染效果与以前不同,这对我来说非常重要:-Outlook不会调整图像大小。好的,因此上述解决方案不起作用:-/拍摄时如何使图片和文本垂直向下对齐?我必须在文本上设置一个填充,或者?我能给你一个最小宽度吗?还是?再次感谢你的时间。我认为问题在于Outlook没有像@scoopzilla所写的那样调整图片的大小。根据我现在从你那里得到的代码,我仍然有右边的空白。我真的不知道该如何解决这个问题。它在浏览器中运行良好,但在Outlook渲染代码时却不行。在这里工作很好:。但是,是的,我不知道如何处理Outlook问题。此外,div通过imageHello的hidden属性自动适应图像大小。再次感谢你。我又得从头开始了。代码的问题是,某些邮件客户端没有正确呈现div标记。因此,下面的文本将与图片不对齐。在一般情况下,div标签是禁止进入的电子邮件。谢谢你的时间。很抱歉不能帮你。。。向你问好!!很乐意帮忙!