html自动隐藏row,html – 为什么div显示:table-row忽略margin?

以下html按预期方式工作,除了边缘顶部被表格行完全忽略.我不知道为什么.

Blank_avatar_thumb
toothpicking, veryveryveryveeerrrryyyyyylooooooooong, kidnapping...
42

/* more rows */

CSS:

div.table {

display: table;

width: 100%;

}

div.row {

display: table-row;

}

div.cell {

display: table-cell;

}

div.left {

float: left;

}

div.right {

float: right;

}

div.clear {

clear: both;

}

.avatar {

vertical-align: middle;

}

.margin-top5 {

margin-top: 5px;

}

.margin-right5 {

margin-right: 5px;

}

.bold {

font-weight: bold;

}

.of_hidden {

overflow: hidden;

}

.small {

font-size: 0.8em;

}

body, p, ol, ul, td {

font-family: verdana, arial, helvetica, sans-serif;

font-size: 13px;

line-height: 18px;

}

编辑:

如果我从行div中删除.row类,它将开始拾取margin-top.

<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="w r"> <xsl:output method="xml" indent="yes"/> <!-- 根模板 --> <xsl:template match="/"> <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm" margin-top="1cm" margin-bottom="1cm" margin-left="2cm" margin-right="2cm"> <fo:region-body margin-top="1cm" margin-bottom="1cm"/> <fo:region-before extent="1cm"/> <fo:region-after extent="1cm"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4"> <fo:flow flow-name="xsl-region-body" font-family="SimSun, 宋体" language="zh-CN" line-height="1.5"> <xsl:apply-templates select="//w:body"/> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <!-- 正文处理 --> <xsl:template match="w:body"> <xsl:apply-templates select="*"/> </xsl:template> <!-- 段落处理 --> <xsl:template match="w:p"> <fo:block font-size="12pt" space-after="12pt" linefeed-treatment="preserve" wrap-option="wrap" text-align="justify"> <xsl:apply-templates select="w:r"/> </fo:block> </xsl:template> <!-- 文本运行处理 --> <xsl:template match="w:r"> <fo:inline font-family="SimSun, 宋体, Microsoft YaHei, sans-serif"> <!-- 处理粗体时使用黑体 --> <xsl:if test="w:rPr/w:b"> <xsl:attribute name="font-family">SimHei, 黑体</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> </xsl:if> <!-- 处理斜体时使用楷体 --> <xsl:if test="w:rPr/w:i"> <xsl:attribute name="font-family">KaiTi, 楷体</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> </xsl:if> <xsl:value-of select="w:t"/> </fo:inline> </xsl:template> <!-- 表格处理 --> <xsl:template match="w:tbl"> <fo:table table-layout="fixed" width="100%"> <xsl:for-each select="w:tblGrid/w:gridCol"> <fo:table-column column-width="{@w:w}dxa"/> </xsl:for-each> <fo:table-body> <xsl:apply-templates select="w:tr"/> </fo:table-body> </fo:table> </xsl:template> <!-- 表格行 --> <xsl:template match="w:tr"> <fo:table-row> <xsl:apply-templates select="w:tc"/> </fo:table-row> </xsl:template> <!-- 单元格 --> <xsl:template match="w:tc"> <fo:table-cell border="1pt solid black" padding="2pt"> <fo:block> <xsl:apply-templates select=".//w:p"/> </fo:block> </fo:table-cell> </xsl:template> <!-- 列表处理 --> <xsl:template match="w:numPr"> <fo:list-block> <xsl:apply-templates select="w:numId"/> </fo:list-block> </xsl:template> </xsl:stylesheet>使用上述样式表转出来的xsl-fo模板表格样式消失了
最新发布
03-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值