Html 使用css将背景图像样式化为表格标题
我在网页上生成了一个网格,并附加了一些样式。标题应用了一个背景图像。当收割台有一行深时,看起来不错。第二个标题跨越两行(带有换行符),它看起来像附件。我试过摆弄高度,但就是拿不定Html 使用css将背景图像样式化为表格标题,html,css,Html,Css,我在网页上生成了一个网格,并附加了一些样式。标题应用了一个背景图像。当收割台有一行深时,看起来不错。第二个标题跨越两行(带有换行符),它看起来像附件。我试过摆弄高度,但就是拿不定 <style> .Grid {background-color: #fff; margin: 5px 0 10px 0; border: solid 1px #525252; border-collapse:collapse; font-family:Calibri; color: #474747;
<style>
.Grid {background-color: #fff; margin: 5px 0 10px 0; border: solid 1px #525252; border-collapse:collapse; font-family:Calibri; color: #474747;}
.Grid td {
padding: 2px;
border: solid 1px #c1c1c1; }
.Grid th {
padding : 4px 2px;
color: #000000;
background: #363670 url(images/grid-header.png) repeat-x top;
border-left: solid 1px #525252;
font-size: 0.9em;
}
.Grid .alt {
background: #fcfcfc url(images/grid-alt.png) repeat-x top; }
.Grid .pgr {background: #363670 url(images/grid-pgr.png) repeat-x top; }
.Grid .pgr table { margin: 3px 0; }
.Grid .pgr td { border-width: 0; padding: 0 6px; border-left: solid 1px #666; font-weight: bold; color: #fff; line-height: 12px; }
.Grid .pgr a { color: Gray; text-decoration: none; }
.Grid .pgr a:hover { color: #000; text-decoration: none; }
</style>
.Grid{背景色:#fff;边距:5px 0 10px 0;边框:实心1px#525252;边框折叠:折叠;字体系列:Calibri;颜色:#47474747;}
.电网运输署{
填充:2px;
边框:实心1px#c1c1;}
.th网格{
填充物:4px2px;
颜色:#000000;
背景:#363670 url(images/grid header.png)repeat-x top;
左边框:实心1px#525252;
字号:0.9em;
}
.Grid.alt{
背景:#fcfc url(images/grid-alt.png)repeat-x top;}
.Grid.pgr{背景:#363670 url(images/Grid pgr.png)repeat-x top;}
.Grid.pgr表{margin:3px 0;}
.Grid.pgr td{边框宽度:0;填充:0 6px;左边框:实心1px#666;字体大小:粗体;颜色:fff;线宽:12px;}
.Grid.pgr a{颜色:灰色;文本装饰:无;}
.Grid.pgra:hover{color:#000;文本装饰:无;}
到
网格th
尝试添加
background-size: auto 100%;
第一个变量是宽度,我们想要的是任何正常行为,因为它已经在工作,第二个变量是高度,表示使用100%的可用高度。到
网格中。尝试添加
background-size: auto 100%;
第一个变量是宽度,无论正常行为是什么,我们都需要它,因为它已经在工作,第二个变量是高度,表示使用100%的可用高度。期望的结果是什么?为了使图像伸展到高度?是的,如果你看屏幕截图,中间的那条线就是它的自然高度(上图)结束的地方,Th细胞的背景颜色开始。我只想让上半部伸展到100%的高度。我认为重复x会考虑宽度,不是吗?期望的结果是什么?为了使图像伸展到高度?是的,如果你看屏幕截图,中间的那条线就是它的自然高度(上图)结束的地方,Th细胞的背景颜色开始。我只想让上半部伸展到100%的高度。我想repeat-x可以控制宽度,不是吗?正是我需要的。谢谢正是我需要的。谢谢