我使用下面的代码在HTML5中嵌入SVG.现在我无法解决的唯一问题是在浏览器中查看HTML文件之间<svg>和之间有很大的空间<td>.谁能告诉我如何删除空间?
先感谢您!
更多细节:
对不起,我忘了说我用的是哪个浏览器.我发现当我使用IE9时,SVG与左右栏之间有很大的空间.但是,当我使用Chrome时,SVG与顶部和底部栏之间有很大的空间.这很奇怪.
我编辑下面的代码.我添加了svg {margin-top:0px; 边距:0像素; 保证金右:0像素; 保证金左:0像素;背景色:黄;}
在代码中.我想要做的是删除黄色空间.现在问题变得更具体了.
<!DOCTYPE html><html>
<head>
<title>SarShips: scs</title>
<style type="text/css">
table
{
border-collapse:collapse;
}
table, td, th
{
border:1px solid black;
}
table {margin-left:auto;margin-right:auto}
tr.odd {background-color:#E0E0F0}
tr.even {background-color:#F0F0FF}
th {font:22px sans-serif;background-color:#98AFC7;color:white;padding:6px}
td.e {font:bold 15px serif;text-align:right;padding:4px}
td.v {font:15px monospace;text-align:left;padding:4px}
td.i {padding:4px}
p {text-align:center}
svg {margin-top:0px;
margin-bottom:0px;
margin-right:0px;
margin-left:0px;background-color:yellow;}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Parameters</th><th>Imagette</th><th>Profile</th><th>Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td>
</td><td class="i"></td>
<td class="i">
<svg width="100%" height="100%" viewBox="0 0 400 …Run Code Online (Sandbox Code Playgroud) 我正在阅读制作我们自己的类型和类型类来学习你的哈克尔.
在代数数据类型介绍中我注意到:
data Point = Point Float Float deriving (Show)
data Shape = Circle Point Float | Rectangle Point Point deriving (Show)
surface :: Shape -> Float
surface (Rectangle (Point x1 y1) (Point x2 y2)) = abs (x2 - x1) * abs (y2 - y1)
Run Code Online (Sandbox Code Playgroud)
在surface (Rectangle (Point x1 y1) (Point x2 y2)),我们指出Rectangle的参数是Point类型.
但是,在递归数据结构部分中:
data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show, Read, Eq)
singleton :: …Run Code Online (Sandbox Code Playgroud)