- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用计数器来设置一种特殊类型的列表计数,这是一种合法形式。
li{
list-style: none;
}
>ol {
counter-reset: mainlist;
}
>ol>li{
counter-reset: sublist;
}
>ol>li:before{
counter-increment: mainlist;
content: counter(mainlist) ". ";
}
>ol>li>ol>li:before{
counter-increment: sublist;
content: counter(mainlist) "." counter(sublist) " ";
}
这很好用,但我希望编号位于文本列的左侧,而不是现在的样子。
1.1
this is how it looks now
1.1 this is how it looks if I add inline
next row will start here.
1.1 I want it to look this.
the next row starts here
and it's a lot easier to find the numbers
我也试过使用文本缩进,但没用,因为不同字母的宽度不同。
最佳答案
一个简单的解决方案是将 display:flex
添加到 li
中,您将获得以下布局:
body {
width: 200px;
}
li {
list-style: none;
}
ol {
counter-reset: mainlist;
}
ol>li {
counter-reset: sublist;
}
ol>li:before {
counter-increment: mainlist;
content: counter(mainlist) ". ";
}
ol>li>ol>li {
display: flex;
}
ol>li>ol>li:before {
counter-increment: sublist;
content: counter(mainlist) "." counter(sublist) " ";
margin-right:5px;
}
<ol>
<li>aaaaaa</li>
<li>bbbbbbb
<ol>
<li>aaaaaa aaaaaa aaaaaa </li>
<li>bbbbbbb bbbbbbb bbbbbbb</li>
</ol>
</li>
</ol>
如果你希望这种行为发生在父 li 上,你还需要在父 li 上使用 flex 并进行一些 HTML/CSS 调整:
body {
width: 200px;
counter-reset: mainlist;
counter-reset: sublist;
}
li {
list-style: none;
}
ol>li {
display: flex;
flex-wrap: wrap;
}
ol>li>span {
flex: 1;
}
ol>li>ol {
flex: 100%;
}
ol > li:before {
counter-increment: mainlist;
content: counter(mainlist) ". ";
margin-right: 5px;
}
ol>li>ol>li {
display: flex;
flex-wrap: nowrap;
}
ol > li > ol > li:before {
counter-increment: sublist;
content: counter(mainlist) "." counter(sublist) " ";
margin-right: 5px;
}
<ol>
<li><span>aaaaaa</span></li>
<li><span>bbbbbbb bbbbbbb bbbbbbb</span>
<ol>
<li>aaaaaa aaaaaa aaaaaa </li>
<li>bbbbbbb bbbbbbb bbbbbbb</li>
</ol>
</li>
<li><span>bbbbbbb bbbbbbb bbbbbbb</span>
</ol>
关于css - 放置 :before-value in the same way as a list-item is placed?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48120600/
在通过自动完成输入框查找地址时,我试图从城市或地区获取 Place-id。问题是,当我查找任何地址时,我可以获得城市名称和其他一些详细信息(JSON 格式),但是...... 有没有办法直接从第一个查
我将 Place Picker 添加到我的 android 应用程序中。当您知道要选择的地点的地址并填写研究栏时,它就会起作用。但是我希望用户可以在使用红色选择器时选择他选择的位置,而这部分不起作用。
我已将 Jetpack Compose 从 1.1.0-beta03 升级到 1.1.0-beta04,除了需要做一些更改外什么也没发生,但现在我在“DetailScreen”上启动应用程序时出现此错
$(function () { var input = do
我正在使用Google的Place API自动填充用户键入的城市名称(网页)。加载了API,并使用语言(pt-BR)作为参数,并且使用葡萄牙语正确填充了文本框,但是执行方法getPlace()时,它将
如何将Google Place API评论从5增加到所有评论?目前,我只获得google plus商业页面的5条评论,我想获取所有评论! 有人可以帮忙吗? 最佳答案 您可以联系Google:https
https://google-developers.appspot.com/maps/documentation/javascript/examples/places-autocomplete 我有一
你们中的许多人都曾在 android 中开发过 LBS 应用程序,并且还使用了 Google Places API Web 服务来获取各个地方的信息。而且您可能还注意到,印度的数据并不准确,这意味着您
我有一个应用程序,它使用地点 API 来帮助查找目的地附近的地点(如伦敦)。我更喜欢在附近使用,因为它可以让我专注于一个区域,而且与文本搜索相比,它也更便宜。 不幸的是,我得到的答案没有多大意义。例如
关闭。这个问题是not about programming or software development .它目前不接受答案。 这个问题似乎不是关于 a specific programming
我正在尝试使用 Google Places api 来搜索位置。但不幸的是,我只收到一条响应请求被拒绝的消息。我创建了新的 API key ,但 API 访问菜单显示了一些警告图标,如下图所示,它是否
Google Place API 未获取特定地址的单位编号。 Example: 3/12 Selwyn Avenue Elwood, 3184, Mel, VIC 但有些地址它正在正确获取单元号。 E
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想要改善这个问题吗?更新问题,以便将其作为on-topi
我正在为运输行业的客户构建一个网站,我正在使用 Google Places API 获取上车地点和目的地。如果接机地点是机场,则一项要求是显示“航类号”字段。 为了确定机场是否从 Google Map
我正在研究以下内容是否可行,如果可以的话,我将如何实现这一目标。 我们会从客户那里收集企业的评论,并希望将这些评论发布到他们的评论中,并将其发布到Google商家信息中。 我想知道如何使我们的网站将这
我们开发了一个用于构建旅行路线的平台。 行程计划(行程)是由用户定义的流程排序的地点组合而成的。 我们想使用Google Places API搜索地点。我们想存储一个place_id,并用它来获取行程
截至今天(2016年5月25日),Google Places API中似乎不再有user_ratings_total的数据。我用它来获得一家企业的评论总数。是否有另一种方法来获取此数据? 最佳答案 我
有没有办法让 Google Places Autocomplete 仅限于一个国家(如法国)? 我有这个:components=country:fr https://maps.googleapis.c
我正在设置一个自定义自动填充字段,在其中显示Google地方信息中的位置以及数据库中与搜索查询匹配的事件。因此,我使用Google地方信息自动填充服务来获取查询预测,而不是将地方信息自动填充功能直接插
自2014年6月24日起,Google已将reference和id字段标记为已弃用,并将其替换为一个place_id。 到目前为止,我只看到place_id的长度恰好是27个字符,但是想知道是否有任何
我是一名优秀的程序员,十分优秀!