- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我希望表格内的两个跨度对齐并同时开始
这是图像以了解更多我的意思
.btContentHolder table td, .btContentHolder table th {
/* padding: 10px; */
counter-increment: step-counter;
margin-bottom: 10px;
position: relative;
padding-left: 2.5714em;
padding-top: 2em;
padding-right: .2em;
}
.pli{
position: absolute;
left: .3em;
top: 1.5em;
z-index: 100;
content: counter(step-counter);
background-color: #fff;
color: #2b6a83;
font-size: 1.4285em;
border: solid 1px #2b6a83;
border-radius: 50%;
width: 25px;
height: 25px;
line-height: 1.2em;
text-align: center;
}
.pli:hover{
background-color: #2b6a83;
color: #fff;
border: solid 1px #fff;
}
.cli{
position: absolute;
left: .3em;
top: 1.5em;
z-index: 100;
content: counter(step-counter);
background-color: #fff;
color: #e9736a;
font-size: 1.4285em;
border: solid 1px #e9736a;
border-radius: 50%;
width: 25px;
height: 25px;
line-height: 1.2em;
text-align: center;
}
.cli:hover{
background-color: #e9736a;
color: #fff;
border: solid 1px #fff;
}
.protd{
background-color: #2b6a831c;
}
.contd{
background-color: #ff000024;
}
<h2 style="text-align: center;"><span style="color: #2b6a83; font-family: Krub;">In-Home Care</span></h2>
<table>
<tbody style="padding-bottom: 20px;">
<tr>
<th style="text-align: center; font-weight: 500; color: #ffffff; font-size: 24pt; font-family: Krub; background-color: #2b6a83; padding: 0px;">Pros</th>
<th style="font-weight: 500; font-size: 24pt; font-family: Krub; color: #ffffff; background-color: #e9736a; padding: 0px; text-align: center;">Cons</th>
</tr>
<tr>
<td class="protd"><span class="pli">1</span><span style="font-size: 14pt; font-family: Krub;">One-on-one care tailored to meet unique preferences and needs.</span></td>
<td class="contd"><span class="cli">1</span><span style="font-size: 14pt; font-family: Krub;">When 24/7 care is required, the costs can be very high.</span></td>
</tr>
<tr>
<td class="protd"><span class="pli">2</span><span style="font-size: 14pt; font-family: Krub;">Remain in the comfort of their own home with a safe, familiar setting.</span></td>
<td class="contd"><span class="cli">2</span><span style="font-size: 14pt; font-family: Krub;">Managing caregivers and backup care planning requires continued family involvement.</span></td>
</tr>
<tr>
<td class="protd"><span class="pli">3</span><span style="font-size: 14pt; font-family: Krub;">The opportunity to choose the person who will be providing care.</span></td>
<td class="contd"><span class="cli">3</span><span style="font-size: 14pt; font-family: Krub;">Living in the home can lead to social isolation if there is little presence of family or friends.</span></td>
</tr>
<tr>
<td class="protd"><span class="pli">4</span><span style="font-size: 14pt; font-family: Krub;">The individual can get service from the same consistent caregiver.</span></td>
<td class="contd"><span class="cli">4</span><span style="font-size: 14pt; font-family: Krub;">The home may need to be modified for wheelchair accessibility or safety precautions.</span></td>
</tr>
<tr>
<td class="protd"><span class="pli">5</span><span style="font-size: 14pt; font-family: Krub;">Home care can cheaper depending on the skill level required and services can be combined to lower costs.</span></td>
<td class="contd"><span class="cli">5</span><span style="font-size: 14pt; font-family: Krub;">Fewer social activities may take place as opposed to care homes and facilities.</span></td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6" style="width: 2%;"></div>
<div class="col-md-6" style="width: 49%;">
<h2 style="text-align: center;"><span style="color: #2b6a83; font-family: Krub;">Assisted Living</span></h2>
<table>
<tbody>
<tr>
<th style="text-align: center; font-weight: 500; color: #ffffff; font-size: 24pt; font-family: Krub; background-color: #2b6a83; padding: 0px;">Pros</th>
<th style="font-weight: 500; font-size: 24pt; font-family: Krub; color: #ffffff; background-color: #e9736a; padding: 0px; text-align: center;">Cons</th>
</tr>
<tr>
<td class="protd"><span class="pli">1</span><span style="font-size: 14pt; font-family: Krub;">More affordable when 24/7 care is required.</span></td>
<td class="contd"><span class="cli">1</span><span style="font-size: 14pt; font-family: Krub;">Longer wait times to get admitted into an assisted living facility.</span></td>
</tr>
<tr>
<td class="protd"><span class="pli">2</span><span style="font-size: 14pt; font-family: Krub;">Allows the family to focus more on their relationship with their loved one.</span></td>
<td class="contd"><span class="cli">2</span><span style="font-size: 14pt; font-family: Krub;">Frequent changes to the staff mean one-on-care won’t be as consistent.</span></td>
</tr>
<tr>
<td class="protd"><span class="pli">3</span><span style="font-size: 14pt; font-family: Krub;">Residents have ample opportunities to socialize with others.</span></td>
<td class="contd"><span class="cli">3</span><span style="font-size: 14pt; font-family: Krub;">The quality of care can differ depending on the various care workers.</span></td>
</tr>
<tr>
<td class="protd"><span class="pli">4</span><span style="font-size: 14pt; font-family: Krub;">Family will not have to manage, schedule or hire care providers.</span></td>
<td class="contd"><span class="cli">4</span><span style="font-size: 14pt; font-family: Krub;">Residents may get kicked out of their assisted living home with little to no advanced notice.</span></td>
</tr>
<tr>
<td class="protd"><span class="pli">5</span><span style="font-size: 14pt; font-family: Krub;">The level of care can easily be increased as necessary.</span></td>
<td class="contd"><span class="cli">5</span><span style="font-size: 14pt; font-family: Krub;">Your loved one may simply not enjoy living in a group environment.</span></td>
</tr>
</tbody>
</table>
最佳答案
您可以使用以下代码。我为每个放置的 td 进行水平对齐 vertical-align: top;
.你可以改变它。
.btContentHolder table td,
.btContentHolder table th {
/* padding: 10px; */
counter-increment: step-counter;
margin-bottom: 10px;
position: relative;
padding-left: 2.5714em;
padding-top: 2em;
padding-right: .2em;
}
.pli {
position: relative;
margin-right: 10px;
z-index: 100;
content: counter(step-counter);
background-color: #fff;
color: #2b6a83;
font-size: 1.2285em;
border: solid 1px #2b6a83;
border-radius: 50%;
text-align: center;
padding: 3px 7px;
display: inline-block;
}
.pli:hover {
background-color: #2b6a83;
color: #fff;
border: solid 1px #fff;
}
.cli {
position: relative;
margin-right: 10px;
z-index: 100;
content: counter(step-counter);
background-color: #fff;
color: #e9736a;
font-size: 1.4285em;
border: solid 1px #e9736a;
border-radius: 50%;
padding: 3px 7px;
}
.cli:hover {
background-color: #e9736a;
color: #fff;
border: solid 1px #fff;
}
.protd {
background-color: #2b6a831c;
padding: 10px;
}
.contd {
background-color: #ff000024;
padding: 10px;
}
#table1 .col1 {
float: left;
width: 8%;
}
#table1 .col2 {
float: left;
width: 92%;
}
#table2 .col1 {
float: left;
width: 12%;
}
#table2 .col2 {
float: left;
width: 88%;
}
td{
vertical-align: top;
}
<h2 style="text-align: center;"><span style="color: #2b6a83; font-family: Krub;">In-Home Care</span></h2>
<table id="table1">
<tbody style="padding-bottom: 20px;">
<tr>
<th style="text-align: center; font-weight: 500; color: #ffffff; font-size: 24pt; font-family: Krub; background-color: #2b6a83; padding: 0px;">Pros</th>
<th style="font-weight: 500; font-size: 24pt; font-family: Krub; color: #ffffff; background-color: #e9736a; padding: 0px; text-align: center;">Cons</th>
</tr>
<tr>
<td class="protd">
<div class="col1"><span class="pli">1</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">One-on-one care tailored to meet unique preferences and needs.</span></div>
</td>
<td class="contd">
<div class="col1"><span class="cli">1</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">When 24/7 care is required, the costs can be very high.</span></div>
</td>
</tr>
<tr>
<td class="protd">
<div class="col1"><span class="pli">2</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Remain in the comfort of their own home with a safe, familiar setting.</span></div>
</td>
<td class="contd">
<div class="col1"><span class="cli">2</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Managing caregivers and backup care planning requires continued family involvement.</span></div>
</td>
</tr>
<tr>
<td class="protd">
<div class="col1"><span class="pli">3</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">The opportunity to choose the person who will be providing care.</span></div>
</td>
<td class="contd">
<div class="col1"><span class="cli">3</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Living in the home can lead to social isolation if there is little presence of family or friends.</span></div>
</td>
</tr>
<tr>
<td class="protd">
<div class="col1"><span class="pli">4</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">The individual can get service from the same consistent caregiver.</span></div>
</td>
<td class="contd">
<div class="col1"><span class="cli">4</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">The home may need to be modified for wheelchair accessibility or safety precautions.</span></div>
</td>
</tr>
<tr>
<td class="protd">
<div class="col1"><span class="pli">5</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Home care can cheaper depending on the skill level required and services can be combined to lower costs.</span></div>
</td>
<td class="contd">
<div class="col1"><span class="cli">5</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Fewer social activities may take place as opposed to care homes and facilities.</span></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6" style="width: 2%;"></div>
<div class="col-md-6" style="width: 70%;">
<h2 style="text-align: center;"><span style="color: #2b6a83; font-family: Krub;">Assisted Living</span></h2>
<table id="table2">
<tbody>
<tr>
<th style="text-align: center; font-weight: 500; color: #ffffff; font-size: 24pt; font-family: Krub; background-color: #2b6a83; padding: 0px;">Pros</th>
<th style="font-weight: 500; font-size: 24pt; font-family: Krub; color: #ffffff; background-color: #e9736a; padding: 0px; text-align: center;">Cons</th>
</tr>
<tr>
<td class="protd">
<div class="col1"><span class="pli">1</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">More affordable when 24/7 care is required.</span></div>
</td>
<td class="contd">
<div class="col1"><span class="cli">1</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Longer wait times to get admitted into an assisted living facility.</span></div>
</td>
</tr>
<tr>
<td class="protd">
<div class="col1"><span class="pli">2</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Allows the family to focus more on their relationship with their loved one.</span></div>
</td>
<td class="contd">
<div class="col1"><span class="cli">2</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Frequent changes to the staff mean one-on-care won’t be as consistent.</span></div>
</td>
</tr>
<tr>
<td class="protd">
<div class="col1"><span class="pli">3</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Residents have ample opportunities to socialize with others.</span></div>
</td>
<td class="contd">
<div class="col1"><span class="cli">3</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">The quality of care can differ depending on the various care workers.</span></div>
</td>
</tr>
<tr>
<td class="protd">
<div class="col1"><span class="pli">4</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Family will not have to manage, schedule or hire care providers.</span></div>
</td>
<td class="contd">
<div class="col1"><span class="cli">4</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Residents may get kicked out of their assisted living home with little to no advanced notice.</span></div>
</td>
</tr>
<tr>
<td class="protd">
<div class="col1"><span class="pli">5</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">The level of care can easily be increased as necessary.</span></div>
</td>
<td class="contd">
<div class="col1"><span class="cli">5</span></div>
<div class="col2"><span style="font-size: 14pt; font-family: Krub;">Your loved one may simply not enjoy living in a group environment.</span></div>
</td>
</tr>
</tbody>
</table>
关于html - 如何使两个跨度从 td 表内的同一行开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66700293/
这就是我现在正在做的事情。我在设计中使用 LESS CSS。我需要在指定输入之间放置 2 个跨度。所有元素的宽度都应为 100%。跨度应始终为 20px 宽度输入宽度可以根据屏幕宽度进行更改。谁能帮帮
我有一个包含文本和输入字段的跨度。我想知道是否可以让文本左对齐,输入字段右对齐。 NAME: .textBox{ display:inline-block; width:450px
我有这个按钮,我想让它在我点击“选择”时调用方法,在我点击“更改”时调用另一个方法: Select Change 我尝试输入 (click)="method()",但没有成功。我很
我正在开发聊天应用程序 (cordova),当我要在无法输入的表情符号后输入文本时,我在这段代码中遇到了问题 https://output.jsbin.com/radaref This i
很抱歉,如果这是一个非常愚蠢的问题,但我是一名开发人员,目前我的设计技能很少,我在个人网站上工作并且遇到了一个小问题。 我有一个带 ul 的顶部导航和 li元素。这些元素包含链接 . 跨度仅在链接悬
fiddle :https://jsfiddle.net/burz4g8s/4/ 我的 HTML 包含多行双按钮对。服务器端应用程序在 JSP 循环中输出按钮,所以我无法控制各个按钮——我不能使用 d
TextView.setLetterSpacing允许设置字母间距/字符间距。 有没有对应的CharacterStyle / span class允许在 TextView? 中的文本子集上设置字母间距
如何使洋红色矩形比红色矩形短 6 倍? GridLayout { id: gridLayout anchors.fill: parent flo
我最近开始使用 Twitter Bootstrap,但我似乎无法理解 span 的作用以及为什么会有不同的编号 span,例如 span4、span12?什么是偏移量以及它们何时使用? (有时与跨度一
我正在尝试构建一个 jQuery 函数来计算跨度中的总数 var sumnormaltotal = 0; $('span[id^="normaloffertotalspan"]').each(func
我想知道haskell如何评估以下表达式。 span (`elem` ['A'..'Z']) "BOBsidneyMORGANeddy" 结果是 ("BOB","sidneyMORGANeddy")
我有三个词,我想在第一个空格之后的内容周围添加一个跨度,所以 hello world 变成: hello world 和: hello world again 变成: hello world agai
我正在寻找纯 CSS 解决以下问题的方法。 考虑以下 HTML: Some text Some text 两者都是 正在显示元素 inline-block .如何在第二个 的左侧
如何将 Span 放置在其容器的底部? 我目前拥有的:http://jsfiddle.net/wRbax/2/ 我希望 .box 始终位于 .td 的底部 CSS .td { vertical
我试图在 li 中 float 两个 span。左跨度将有我的标签,在右跨度内我将构建一个具有嵌套跨度的图形。我有基本结构,但 chrome 将数字放在左侧跨度的末尾。我该如何解决这个问题? HTML
我有一个像这样的 JavaScript 变量: var text = "A businessman should be able to manage his business matters"; 我想
一些内容可编辑的框与其他框重叠,因此并非所有框都是可编辑的。我想保留与跨度位置中心对齐的文本,如下所示。我如何实现这一点? span { margin: auto; text-alig
我正在使用 WYSIWYG (InnovaEditor) 来编辑我网站上的内容,它适用于 Chrome、IE,主要适用于 Firefox,但 FF 有一个稍微令人讨厌的问题。我将 span 标签插入到
这是我的 html: Settings Export Import 和CSS: span.button { float:right; margin-righ
这里是问题所在:http://jsfiddle.net/STG22/3/ 我希望 span 不会分成两个不同的行(就像上面示例中的第三行一样)。我该怎么做? CSS: span { backg
我是一名优秀的程序员,十分优秀!