GVKun编程网logo

通过 CSS 更改 ioslides 中的项目符号类型(css项目符号怎么加颜色)

2

如果您对通过CSS更改ioslides中的项目符号类型和css项目符号怎么加颜色感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解通过CSS更改ioslides中的项目符号类型的各种细节,并对cs

如果您对通过 CSS 更改 ioslides 中的项目符号类型css项目符号怎么加颜色感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解通过 CSS 更改 ioslides 中的项目符号类型的各种细节,并对css项目符号怎么加颜色进行深入的分析,此外还有关于) 预期 css(css-rparentexpected)" 用于@media 查询中的第 4 级 css 语法、 不起作用、Angular:

    添加的 document.execCommand 只看到 style.css 中的 css 规则而不是组件的 css的实用技巧。

    本文目录一览:

    通过 CSS 更改 ioslides 中的项目符号类型(css项目符号怎么加颜色)

    通过 CSS 更改 ioslides 中的项目符号类型(css项目符号怎么加颜色)

    如何解决通过 CSS 更改 ioslides 中的项目符号类型

    我希望能够通过 CSS 文件在 ioslides 文档范围内更改 R-Markdown 生成的项目符号的样式。

    我知道我可以使用 HTML 来更改 R Markdown 中 ioslides 文件正文中无序列表的格式,正如讨论的 here 更改颜色。对每个项目符号列表都这样做似乎很笨拙。

    我尝试将其添加到 CSS 文件中:

    1. ul {list-style-type: circle;}

    除了 ioslides 放置的默认项目符号之外,还添加了一个例如圆形项目符号

    因此看来,关键可能是找到一种方法从 ioslides 中的无序列表中删除项目符号(之后可以添加样式项目符号来代替它们),但将其添加到 CSS 文件中:

    1. ul {list-style: none;}

    (在我们没有前一个属性的情况下)不会移除项目符号。

    尽管 ioslides reference manual 非常有用,但它和 other searches 都没有提供进一步的见解。

    RStudio 中 ioslides 演示文稿的可重现代码是:

    CSS

    (作为 style.html 保存到与下面的 .Rmd 片段相同的目录中。调整项目符号的代码位于第 65 - 68 行。此样式表来自给定 here 的 ioslides 默认值。 )

    1. <!DOCTYPE html>
    2. <html$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>
    3. <head>
    4. <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>
    5. <Meta charset="utf-8">
    6. <Meta http-equiv="X-UA-Compatible" content="chrome=1">
    7. <Meta name="generator" content="pandoc" />
    8. $if(date-Meta)$
    9. <Meta name="date" content="$date-Meta$" />
    10. $endif$
    11. <Meta name="viewport" content="width=device-width,initial-scale=1">
    12. <Meta name="apple-mobile-web-app-capable" content="yes">
    13. <base target="_blank">
    14. <script type="text/javascript">
    15. var SLIDE_CONfig = {
    16. // Slide settings
    17. settings: {
    18. $if(title)$
    19. title: ''$title$'',$endif$
    20. $if(subtitle)$
    21. subtitle: ''$subtitle$'',$endif$
    22. useBuilds: true,usePrettify: true,enableSlideAreas: true,enabletouch: true,$if(analytics)$
    23. analytics: ''$analytics$'',$endif$
    24. $if(logo)$
    25. favIcon: ''$logo$'',$endif$
    26. },// Author information
    27. presenters: [
    28. $for(author)$
    29. {
    30. name: $if(author.name)$ ''$author.name$'' $else$ ''$author$'' $endif$,company: ''$author.company$'',gplus: ''$author.gplus$'',twitter: ''$author.twitter$'',www: ''$author.www$'',github: ''$author.github$''
    31. },$endfor$
    32. ]
    33. };
    34. </script>
    35. $for(header-includes)$
    36. $header-includes$
    37. $endfor$
    38. <style type="text/css">
    39. ul {list-style: none;} /* Does not repress ioslides-generated bullets */
    40. li::marker {display: none;} /* Does not repress ioslides-generated bullets */
    41. li {list-style-type: circle;} /* Creates bullest *in addition to* those created by ioslides */
    42. b,strong {
    43. font-weight: bold;
    44. }
    45. em {
    46. font-style: italic;
    47. }
    48. summary {
    49. display: list-item;
    50. }
    51. slides > slide {
    52. -webkit-transition: all $transition$s ease-in-out;
    53. -moz-transition: all $transition$s ease-in-out;
    54. -o-transition: all $transition$s ease-in-out;
    55. transition: all $transition$s ease-in-out;
    56. }
    57. .auto-fadein {
    58. -webkit-transition: opacity 0.6s ease-in;
    59. -webkit-transition-delay: $transition$s;
    60. -moz-transition: opacity 0.6s ease-in $transition$s;
    61. -o-transition: opacity 0.6s ease-in $transition$s;
    62. transition: opacity 0.6s ease-in $transition$s;
    63. opacity: 0;
    64. }
    65. /* https://github.com/ropensci/plotly/pull/524#issuecomment-468142578 */
    66. slide:not(.current) .plotly.html-widget{
    67. display: block;
    68. }
    69. code{white-space: pre-wrap;}
    70. span.smallcaps{font-variant: small-caps;}
    71. span.underline{text-decoration: underline;}
    72. div.column{display: inline-block; vertical-align: top; width: 50%;}
    73. div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
    74. ul.task-list{list-style: none;}
    75. $if(quotes)$
    76. q { quotes: "“" "”" "‘" "’"; }
    77. $endif$
    78. $if(highlighting-css)$
    79. $highlighting-css$
    80. $endif$
    81. $if(displaymath-css)$
    82. .display.math{display: block; text-align: center; margin: 0.5rem auto;}
    83. $endif$
    84. $if(logo)$
    85. slides > slide:not(.nobackground):before {
    86. font-size: 12pt;
    87. content: "";
    88. position: absolute;
    89. bottom: 20px;
    90. left: 60px;
    91. background: url($logo$) no-repeat 0 50%;
    92. -webkit-background-size: 30px 30px;
    93. -moz-background-size: 30px 30px;
    94. -o-background-size: 30px 30px;
    95. background-size: 30px 30px;
    96. padding-left: 40px;
    97. height: 30px;
    98. line-height: 1.9;
    99. }
    100. $endif$
    101. </style>
    102. $for(css)$
    103. <link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>
    104. $endfor$
    105. </head>
    106. <body style="opacity: 0">
    107. $if(widescreen)$
    108. <slides class="layout-widescreen">
    109. $else$
    110. <slides>
    111. $endif$
    112. $if(include-before)$
    113. $for(include-before)$
    114. $include-before$
    115. $endfor$
    116. $else$
    117. <slide class="title-slide segue nobackground">
    118. $if(logo)$
    119. <aside class="gdbar"><img src="$logo$"></aside>
    120. $endif$
    121. <!-- The content of this hgroup is replaced programmatically through the slide_config.json. -->
    122. <hgroup class="auto-fadein">
    123. <h1 data-config-title><!-- populated from slide_config.json --></h1>
    124. $if(subtitle)$<h2 data-config-subtitle><!-- populated from slide_config.json --></h2>$endif$
    125. <p data-config-presenter><!-- populated from slide_config.json --></p>
    126. $if(date)$
    127. <p style="margin-top: 6px; margin-left: -2px;">$date$</p>
    128. $endif$
    129. </hgroup>
    130. </slide>
    131. $endif$
    132. RENDERED_SLIDES
    133. $for(include-after)$
    134. $include-after$
    135. $endfor$
    136. <slide class="backdrop"></slide>
    137. </slides>
    138. $if(mathjax-url)$
    139. <!-- dynamically load mathjax for compatibility with self-contained -->
    140. <script>
    141. (function () {
    142. var script = document.createElement("script");
    143. script.type = "text/javascript";
    144. script.src = "$mathjax-url$";
    145. document.getElementsByTagName("head")[0].appendChild(script);
    146. })();
    147. </script>
    148. $endif$
    149. <!-- map slide visiblity events into shiny -->
    150. <script>
    151. (function() {
    152. if (window.jQuery) {
    153. window.jQuery(document).on(''slideleave'',function(e) {
    154. window.jQuery(e.target).trigger(''hidden'');
    155. });
    156. window.jQuery(document).on(''slideenter'',function(e) {
    157. window.jQuery(e.target).trigger(''shown'');
    158. });
    159. }
    160. })();
    161. </script>
    162. </body>
    163. </html>

    .Rmd ioslides 代码

    (保存为,例如,test.Rmd 到与 style.html 相同的目录中,如上。此代码来自 ioslides manual。)

    1. ---
    2. title: "Habits"
    3. author: John Doe
    4. output:
    5. ioslides_presentation:
    6. template: style.html
    7. ---
    8. # In the morning
    9. ## Getting up
    10. - Turn off alarm
    11. - Get out of bed
    12. ## Breakfast
    13. - Eat eggs
    14. - Drink coffee
    15. # In the evening
    16. ## Dinner
    17. - Eat spaghetti
    18. - Drink wine

    TYIA

    解决方法

    TL;DR:

    据我所知,项目符号(和许多其他风格元素)只能在从“CSS”和 .Rmd ioslides 文件编织的幻灯片的标题中更改。

    总体说明

    (注意:为了方便起见,我将“CSS”文件称为 style.html,首先在 RStudio 中创建的 .Rmd 文件称为 draft.Rmd,最后的幻灯片由这两个文件编织而成作为 slideshow.html。并非所有这些文件的名称都可以由用户更改。)

    我的第一个线索(很早就注意到,然后或多或少地忽略了)是“CSS”文件本身不是一个级联样式表。尽管默认命名为“样式”,但扩展名正确地为“.html”---而不是“.css”:它实际上是一个 .html 文件---尽管其中包含降级为标题的元素。

    ioslides 获取 style.html 文件中的信息,并将其集成到由 style.htmldraft.Rmd 文件创建的最终幻灯片文件的不同部分。 slideshow.html 的格式元素都在该文件的标题中。即,没有单独的 .css 文件可供 slideshow.html 访问以获取样式。

    这意味着可以在 style.html 文件中修改一些(可以说是很多)样式元素,但必须在最终的 slideshow.html 中修改任何其他元素。

    当然,更改 style.html 中的元素很容易,并且允许快速重新编织以测试这些更改。这也意味着 style.html 文件可以与其他 .Rmd 文件重复使用,以保持格式一致。

    在对 slideshow.html 或 ''draft.Rmd` 文件进行任何更改后,必须在(重新)编织的 style.html 中更改任何其他样式元素。这可以是一个简单的搜索/替换操作,远非不可能——只是不太明显或自动化。

    回答我的特定问题

    搜索 slideshow.html 文件中生成的标题,我发现:

    1. ul li ul li:before {
    2. content: ''-'';
    3. font-weight: 600;
    4. }
    5. ul > li:before {
    6. content: ''\\00B7'';
    7. margin-left: -1em;
    8. position: absolute;
    9. font-weight: 600;
    10. }
    • content: ''\\00B7''; 替换 list-style-type: circle; in ul > li:before { 用圆圈替换一阶项目符号。

    第二(等等)顺序的项目符号仍然是破折号,所以:

    • content: ''-''; 替换为 list-style-type: circle;inul li ul li:before {` 将二阶破折号替换为圆圈。

    常见的正则表达式可以加快速度,即搜索 content: ''.*''; 并将其替换为某物/无物。当然,你可以为两个级别选择不同的项目符号,就像 ioslides 默认使用点和破折号一样。

    ) 预期 css(css-rparentexpected)

    ) 预期 css(css-rparentexpected)" 用于@media 查询中的第 4 级 css 语法

    Visual Studio Code does not support 4 级范围语法呢。此外,MDN 表示目前只有 Firefox 支持该语法。如果您需要跨浏览器支持,您现在需要坚持使用原始的 max-width 语法:

    @media (max-width: 768px) {
        h1 {
            font-size: 3em;
            color: mediumvioletred;
        }
        nav a {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: mediumaquamarine;
        }
    }
    

    否则,你所拥有的是正确的。

    " alt="">

    OSC 请你来轰趴啦!1028 苏州源创会,一起寻宝 AI 时代

    css 样式   引入  href="css/layout.css?id=7" 是什么意思?

    不起作用" alt=" 不起作用">

    如何解决<link rel="stylesheet" type="text/css" href="{% static ''css/style.css'' %}"> 不起作用

    我在 vs-code 上将 css 链接到 html。 center-aliend 在这里不起作用。有没有人知道哪个部分有问题? 我想设置文本“Hello Static!!”到浏览器的中心。

    1. {% load static %}
    2. <!DOCTYPE html>
    3. <html lang="en">
    4. <head>
    5. <Meta charset="UTF-8">
    6. <Meta name="viewport" content="width=device-width,initial-scale=1.0">
    7. <link rel="stylesheet" type="text/css" href="{% static ''css/style.css'' %}">
    8. <title>Static Practice</title>
    9. </head>
    10. <body>
    11. <div>Hello Static!!</div>
    12. </body>
    13. </html>

    1. body {
    2. text-align: center;
    3. }

    1. # Static files (CSS,JavaScript,Images)
    2. # https://docs.djangoproject.com/en/3.1/howto/static-files/
    3. STATIC_URL = ''/static/''
    4. STATICFILES_Dirs = [
    5. BASE_DIR / ''static''
    6. ]

    Angular: <ol> 添加的 document.execCommand 只看到 style.css 中的 css 规则而不是组件的 css

    Angular:
      添加的 document.execCommand 只看到 style.css 中的 css 规则而不是组件的 css

    如何解决Angular: <ol> 添加的 document.execCommand 只看到 style.css 中的 css 规则而不是组件的 css

    我正在 angular 中创建富文本编辑器,当我执行 document.execCommand(''insertOrderedList'') 时,我得到 <ol> 项,它不受我组件的 css 的影响,只有 styles.css 中的 css(主 css 文件在项目的根目录)影响我使用 document.execCommand 添加的项目。 是否有可能改变这种行为?

    解决方法

    当然。它的名字是view encapsulation。将其更改为 ViewEncapsulation.none 会产生所需的行为。

    1. @Component({
    2. ...
    3. encapsulation: ViewEncapsulation.none
    4. })

    今天关于通过 CSS 更改 ioslides 中的项目符号类型css项目符号怎么加颜色的讲解已经结束,谢谢您的阅读,如果想了解更多关于) 预期 css(css-rparentexpected)" 用于@media 查询中的第 4 级 css 语法、 不起作用、Angular:

      添加的 document.execCommand 只看到 style.css 中的 css 规则而不是组件的 css的相关知识,请在本站搜索。

      本文标签: