首页 \ 问答 \ 防止内的

垂直溢出(Prevent overflow of

inside vertically)

防止内的

垂直溢出(Prevent overflow of

inside vertically)

table {
  width: 660;
  height: 800;
}
table h2 {
  padding: 2px;
  border: 0px;
  border-collapse: collapse;
  border-spacing: 0px;
}
tr {
  max-height: 200px;
}
td {
  border-right: #5c5857 dashed 1px;
  width: 230px;
  max-height: 200px;
}
p {
  padding: 2px;
  font-size: 10px;
}
#post-thumbnail {
  margin: auto 0;
  padding: 2px;
}
<table>
  <tr>
    <td>
      <span id='post-thumbnail'>
        <img src='https://lh5.googleusercontent.com/-sI6mm8ZKBss/VPBaKwgV_jI/AAAAAAAAAC0/AIC31jCods8/h120/noimg.png' /></img>
      </span>
      <h2>Blog post title</h2>
      <p>Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy
        Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey
        Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy
        Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey
        Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy
        Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy</p>

    </td>
    <td>
      <span id='post-thumbnail'>
        <img src='https://lh5.googleusercontent.com/-sI6mm8ZKBss/VPBaKwgV_jI/AAAAAAAAAC0/AIC31jCods8/h120/noimg.png' /></img>
      </span>
      <p>Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy</p>
    </td>
    <td>
      <span id='post-thumbnail'>
        <img src='https://lh5.googleusercontent.com/-sI6mm8ZKBss/VPBaKwgV_jI/AAAAAAAAAC0/AIC31jCods8/h120/noimg.png' /></img>
      </span>
      <p>Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy</p>
    </td>
  </tr>
</table>

我试图通过各种手段垂直修复溢出。 我试着谷歌搜索和其他所有手段。 我需要帮助来修复td中垂直发生的溢出。 我正在尝试为Blogger创建博客文章显示样式。 我希望缩略图显示在顶部,然后是博客文章的片段。 我希望连续显示3个这样的帖子信息,但是当有很多文本时,td只会向下溢出。 我尝试了很多修复,但每次文本溢出任何其他方向或只显示一行。


table {
  width: 660;
  height: 800;
}
table h2 {
  padding: 2px;
  border: 0px;
  border-collapse: collapse;
  border-spacing: 0px;
}
tr {
  max-height: 200px;
}
td {
  border-right: #5c5857 dashed 1px;
  width: 230px;
  max-height: 200px;
}
p {
  padding: 2px;
  font-size: 10px;
}
#post-thumbnail {
  margin: auto 0;
  padding: 2px;
}
<table>
  <tr>
    <td>
      <span id='post-thumbnail'>
        <img src='https://lh5.googleusercontent.com/-sI6mm8ZKBss/VPBaKwgV_jI/AAAAAAAAAC0/AIC31jCods8/h120/noimg.png' /></img>
      </span>
      <h2>Blog post title</h2>
      <p>Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy
        Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey
        Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy
        Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey
        Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy
        Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy</p>

    </td>
    <td>
      <span id='post-thumbnail'>
        <img src='https://lh5.googleusercontent.com/-sI6mm8ZKBss/VPBaKwgV_jI/AAAAAAAAAC0/AIC31jCods8/h120/noimg.png' /></img>
      </span>
      <p>Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy</p>
    </td>
    <td>
      <span id='post-thumbnail'>
        <img src='https://lh5.googleusercontent.com/-sI6mm8ZKBss/VPBaKwgV_jI/AAAAAAAAAC0/AIC31jCods8/h120/noimg.png' /></img>
      </span>
      <p>Hey Hey Hey Hey Hey HEy Hey Hey Hey HEy Hey Hey Hey HEy</p>
    </td>
  </tr>
</table>

I tried to fix the overflow vertically by every means. I tried googling and every other means. I need help to fix the overflow that happens vertically in the td. I am trying to create a blog post display style for Blogger. I want the thumbnail to come on top and then a snippet of the blog post. I want 3 such post information to be displayed in a row, but when there's a lot of text, the td just overflows downwards. I tried many fixes, but each time either the text overflows in any other direction or just displays a single line.


原文:https://stackoverflow.com/questions/28764153
更新时间:2022-06-08 06:06

最满意答案

为了做你需要的,我发现的最简单和最有效的方法是使用你的实际位置作为参数,而不是GMT偏移量。

例如,如果你在墨尔本,而不是在冬天使用'+10:00'而在夏天使用'+11:00',你只需在时区参数中提及'澳大利亚/墨尔本'。 这样做可以处理夏令时偏移。

你的例子提到了+10,我假设墨尔本; 由于DST偏移量不同,这两个语句将返回不同的时间:

SELECT CONVERT_TZ('2015-01-01 02:00:00','UTC','Australia/Melbourne');
SELECT CONVERT_TZ('2015-10-01 02:00:00','UTC','Australia/Melbourne');

需要注意的是,标准的MySQL安装不附带内置的时区名称。 按照以下说明获取MySQL服务器中的内容: http//dev.mysql.com/doc/refman/5.1/en/time-zone-support.html


To do what you need, the simplest and most effective way I have found was to use your actual location as a parameter, and not the GMT offset.

For instance, if you are in Melbourne, instead of using '+10:00' in Winter and '+11:00' in Summer, you would simply mention 'Australia/Melbourne' in the timezone parameter. Doing this will take care of the daylight savings time offset.

Your example mentioned +10, I'm assuming Melbourne; these 2 statements will return different times as the DST offset is different:

SELECT CONVERT_TZ('2015-01-01 02:00:00','UTC','Australia/Melbourne');
SELECT CONVERT_TZ('2015-10-01 02:00:00','UTC','Australia/Melbourne');

The caveat is that standard MySQL installations do not come with the timezone names built-in. Follow these instructions to get those in your MySQL server: http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html

相关问答

更多
  • 我怀疑你想要“太平洋/奥克兰”作为时区名称。 查塔姆群岛也有“太平洋/查塔姆”。 我承认,确定哪个zoneinfo名称是最合适的一个并不容易...... I suspect you want "Pacific/Auckland" as the time zone name. There's also "Pacific/Chatham" for the Chatham Islands. I'll admit it's not always easy to work out which zoneinfo nam ...
  • 你们自己撑开,冬天来了...... 这是由夏令时到冬令时所引起的,这取决于您的时区( 请参阅此链接 )。 2013年10月27日是我们来到冬季的那一天(至少对欧洲国家来说)。 凌晨3点,小时变成了02点,这就解释了为什么你在这两个不同的时间戳上有相同的小时。 从MySQL文档中提取: [FROM_UNIXTIME]返回unix_timestamp参数[...]的表示形式。 该值以当前时区表示。 如果我计算得很好,你在格林威治标准时间工作。 几个小时后再试一次,你会看到一切都好: SELECT FROM_UN ...
  • 为了做你需要的,我发现的最简单和最有效的方法是使用你的实际位置作为参数,而不是GMT偏移量。 例如,如果你在墨尔本,而不是在冬天使用'+10:00'而在夏天使用'+11:00',你只需在时区参数中提及'澳大利亚/墨尔本'。 这样做可以处理夏令时偏移。 你的例子提到了+10,我假设墨尔本; 由于DST偏移量不同,这两个语句将返回不同的时间: SELECT CONVERT_TZ('2015-01-01 02:00:00','UTC','Australia/Melbourne'); SELECT CONVERT_ ...
  • 使用TIME_FORMAT : SELECT TIME_FORMAT('14:30:00', '%h:%i %p'); /* 02:30 PM */ 将PHP更改为以下内容: $finalresult = mysql_query("SELECT Field1, Field2, TIME_FORMAT(DateField, '%h:%i %p') AS TheTime FROM events WHERE clubID IN (" . implode(',', $clubIDs) . ") ORDER BY ...
  • 你的问题含糊不清。 我将离开时区模糊。 如何将unix时间戳中的时间转换为正常时间? 我怀疑你以某种方式从数据库而不是Date获得了long或可能的String值。 在JDBC中,您通常会喜欢使用适当的方法来获取特定于数据库的数据类型。 MySQL TIMESTAMP数据类型可以通过ResultSet#getTimestamp()获得,它给你一个java.sql.Timestamp ,它又是java.util.Date一个子类。 在坚果中,应该做以下事情: Date date = resultSet.get ...
  • 您可能需要考虑存储时间,而不是作为VARCHAR ,而是作为DATETIME 。 这样你就可以用DATE_FORMAT()格式化它。 你可以在这里做的是使用STR_TO_DATE() 将字符串转换为DATETIME ,然后使用DATE_FORMAT()来格式化它。 -- Let's say `time` is the value "6:00 PM" -- This should return "18:00" SELECT DATE_FORMAT(STR_TO_DATE(`time`, '%l:%i %p') ...
  • 你的time_milis都是秒,但是hour需要像'10:05:03'这样的time ,你可以使用sec_to_time 。 喜欢这个: SELECT concat(hour(sec_to_time(time_milis)), ' ', sec_to_time(time_milis)) FROM ( SELECT SUM(TIMEDIFF(logout_timestamp,login_timestamp)) AS time_milis FROM t_access_log WHERE logout_tim ...
  • 您可以使用此处引用的时间模块的strptime 。 我对输入数据做了一些假设,但这里的格式可能会起作用: import time import datetime def translate_timestamp(timestamp): t = time.strptime(x, "%Y-%m-%dT%H:%M:%S.%fZ") s = datetime.datetime.fromtimestamp(time.mktime(t)) return s.strftime("%Y-%m-%d % ...
  • 答案非常简单。 上面的方法很好,MySql只是不知道任何时区。 您可以使用命令SET time_zone = 'UTC'; 如果您遇到与提问者相同的问题,则应收到以下错误: #1298 - Unknown or incorrect time zone: 'UTC' 可以使用以下命令轻松修复此问题: mysql_tzinfo_to_sql /usr/share/zoneinfo/|mysql -u root mysql -p The answer was quite trivial. The approa ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)