Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用显示:表格单元格降低h1上的高度_Html_Css_Cellspacing - Fatal编程技术网

Html 使用显示:表格单元格降低h1上的高度

Html 使用显示:表格单元格降低h1上的高度,html,css,cellspacing,Html,Css,Cellspacing,我使用“显示:表格单元格”、“垂直对齐:中间”和“文本对齐:中心”将表格单元格中的文本居中。但是,现在文本上下都有令人讨厌的间距。我如何才能完全移除它?我希望文本周围都是零边距/空白 PS-我尝试了边框折叠:折叠,但似乎无法使其工作 (另请参见下面的小提琴……) HTML: <body> <div> <h1><a href=#>H</a></h1> <h1><a href=#&g

我使用“显示:表格单元格”、“垂直对齐:中间”和“文本对齐:中心”将表格单元格中的文本居中。但是,现在文本上下都有令人讨厌的间距。我如何才能完全移除它?我希望文本周围都是零边距/空白

PS-我尝试了
边框折叠:折叠
,但似乎无法使其工作

(另请参见下面的小提琴……)

HTML:

  <body>
    <div>
    <h1><a href=#>H</a></h1>
    <h1><a href=#>E</a></h1>
    <h1><a href=#>L</a></h1>
    <h1><a href=#>L</a></h1>
    <h1><a href=#>O</a></h1>
    </div>
  </body>
    body {
        font-family: 'Sigmar One', cursive;
        font-size: 100px;
        color: white;
        text-shadow: 4px 4px 4px #000;

        background-color:blue;

        width: 100%;
        height: 100%;
        margin: 0;
    }


    div {
        position:absolute; 
        height:100%; 
        width:100%;
        display: table;
    }

    h1 {
        display: table-cell;
        vertical-align: middle;
        text-align:center;
    }

    a:visited, a:active {
        text-decoration: none;
        color: white;
    }

    a:link {
        text-decoration: none;
            color: white;
        text-shadow: 0px 2px 3px rgba(255,255,255,.25);
        -webkit-background-clip: text;
           -moz-background-clip: text;
                background-clip: text;
    }

    a:hover {
        text-shadow: 4px 4px 4px #000;
        color: white;
    }

使用内联显示属性,如下所示:

h1 {
        display: table-cell;
        vertical-align: middle;
        text-align:center;
        display: inline;
    }

不。这打破了我的另一个显示:Table Cyle。哦,对不起,我没有注意到表格单元格,为什么你需要它?我需要表格单元格将页面中间的文本放在中间。为什么不使用表的宽度属性并将其设置为100%?或者设置一个固定宽度到表中,并给它一个边距:0自动;在cssIs中,文本“hello”是否显示为一行或一个字符宽的垂直列?你把“你好”列成了一列。@MarcAudet我打算把每一列都变成一个链接。我将其设置为可读性。我希望这一切都在一排。只是更新了它以反映这些更改。可以将链接包装到包装器元素中吗?当然可以。实际上,我对它进行了调整,使每个链接都位于单独的h1中。但是它可以在span/div中。任何使它工作的东西。PS-我刚刚更新了问题以反映调整。