RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题 / 628908
Accepted
Alexey Giryayev
Alexey Giryayev
Asked:2020-02-17 05:22:48 +0000 UTC2020-02-17 05:22:48 +0000 UTC 2020-02-17 05:22:48 +0000 UTC

伪类 :root 并使用它

  • 772

今天我偶然发现了使用伪类的例子:root。适用范围相当广泛。想听听用过或用过的人的意见。真实操作体验,非文章素材。是否适合对项目进行个性化、选择主色、背景等?您在验证、速度和其他方面做得如何?是否可以减少样式数量?

这只是一个例子:

:root {
  --main-color: #9BC53D;
  --secondary-color: #EBFFFA;
}
body {
  margin: 0;
  padding: 0;
}
div {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  right: 20%;
  top: 20%;
  left: 20%;
  bottom: 20%;
  text-align: center;
  background: var(--main-color);
  color: var(--secondary-color);
}
<div>I am an example!</div>

可以在此处找到更多示例。

css
  • 6 6 个回答
  • 10 Views

6 个回答

  • Voted
  1. Best Answer
    Qwertiy
    2020-03-04T05:08:08Z2020-03-04T05:08:08Z

    :root没有做任何有趣的事情。它的特点是可以引用任何根元素。在 HTML 文件中,这将是html,在 SVG 文件svg中,在 XML 文件中,它的任何根元素。

    但毕竟,我们通常为 HTML(好吧,或者为 SVG)编写样式,并且我们确切地知道我们将哪个标签作为根标签。老实说,我很难想象我们同时将同一个 CSS 文件连接到 HTML 和 SVG,甚至想对它们的根元素应用相同的样式(但如果是这样,那么这个伪类就是为你准备的) !)。

    所以我认为用标签选择器代替它是很有可能的。

    那么,如果对不同的 XML 进行样式化,那么它可能很有用。
    尽管就个人而言,在实践中,我还没有看到需要设置 XML 样式。

    • 19
  2. Yuri
    2020-03-04T03:24:17Z2020-03-04T03:24:17Z

    这个方法很好。有了它,您可以方便地批量更改样式。例如,如果您在多种款式中使用相同的颜色,那么为了改变它,您不需要打破一切。

    :root {
      --color: red;
    }
    body {
      margin: 0;
      padding: 0;
    }
    div {
      color: var(--color);
    }
    p {
      color: var(--color);
    }
    span {
      color: var(--color);
    }
    <div>Один</div>
    <p>Два</p>
    <span>Три</span>

    我不能说什么关于速度。CSS 变量的运行速度与其他函数一样快。至少在浏览器的时间轴上。但还是有评论慢了几毫秒。

    但最大的问题是 CSS 变量最近才开始使用。大多数“落后”的浏览器和几乎所有旧版本的浏览器都不支持它们。它们不受IE、Edge、Yandex(尽管在Chromium上创建)和其他几个不支持。

    我的结论是:
    CSS变量目前应该只在小的开发中使用,用于测试,以便以后编辑方便,在大型项目中最好不要使用。希望将来所有的浏览器都支持它。但无论如何,我不建议将来使用它们,因为大多数人仍然使用旧版本的浏览器并且谁知道它们将如何显示(记住vw 和 vh,这意味着不同浏览器中的大小不同)。

    • 9
  3. Alexander Goroshev
    2020-03-10T16:18:36Z2020-03-10T16:18:36Z

    因此,让我们尝试了解一些可能性和缺点。

    值得从支持现在处于非常低的水平这一事实开始。当某些浏览器根本不支持这个伪类时,情况就是这样,这意味着完全使用会受到质疑。或许正是因为如此,他现在并没有太大的人气。

    用例:

    当然,最简单的例子就是问题本身:

    :root {
      --main-color: #06c;
      --accent-color: #006;
    }
    #foo h1 {
      color: var(--main-color);
    }
    

    通过设置标准颜色,您可以在整个文档中使用它们。同时,此方法非常适合个性化项目,因为通过更改一个值,您可以更改整个页面的外观。

    同样,您可以通过指定文档中经常重复的长样式来节省字符数。例如,渐变:

    :root {
      --main-color: #c06;
      --accent-background: linear-gradient(to top, var(--main-color), white);
    }
    html, body {
      padding: 0;
      margin: 0;
      height: 100%;
      background: var(--accent-background) no-repeat;
    }

    在这种情况下,渐变本身中的值会随着主色而变化。

    这个伪类也适用于不同的语言:

    :root,
    :root:lang(en) {--external-link: "Английский"}
    :root:lang(de) {--external-link: "Немецкий"}
    
    a[href^="http"]::after {content: var(--external-link) }
    <a href="http://"></a>

    也可以在 JS 中使用来自 CSS 的值。

    //CSS
    :root { --color: blue; --new-color: green; }
    
    //JS
    function changeDocColor() {
        elem.style.setProperty('--color', 'var(--new-color)');
    }
    

    换句话说,范围可以相当广泛。

    下面是来自该来源的示例,清楚地显示了元素与不同样式之间的关系。

    'use strict';
    
    // Auxiliary method. Retrieves and sanitises the value of a custom property.
    var getVariable = function(styles, propertyName) {
      return String(styles.getPropertyValue(propertyName)).trim();
    };
    
    // Auxiliary method. Sets the value of a custom property at the document level.
    var setDocumentVariable = function(propertyName, value) {
      document.documentElement.style.setProperty(propertyName, value);
    };
    
    // Sets the document color scheme to the color scheme of the clicked element.
    // This illustrates how it's easy to make a change affecting a large number of
    // elements by simply changing a few custom properties.
    var chooseDefaultColor = function(event) {
      // Get the styles for the event target (the clicked button), so we can see
      // what its custom properties are set to.
      var styles = getComputedStyle(event.target);
    
      // Get the values for the button's colours...
      var primary = getVariable(styles, '--primary-color');
      var text = getVariable(styles, '--primary-color-text');
      // ... and apply them to the document.
      setDocumentVariable('--primary-color', primary);
      setDocumentVariable('--primary-color-text', text);
    };
    
    // Initialise page controls.
    window.addEventListener('load', function() {
      // Get the styles for the document.
      // This is where we've chosen to store all the global variables we use.
      var styles = getComputedStyle(document.documentElement);
    
      var quantum = document.getElementById('quantum');
      var gutter = document.getElementById('gutter');
      var columns = document.getElementById('columns');
    
      // Set up event handlers for buttons.
      var buttons = document.querySelectorAll('.picker-button');
      for (var i = 0; i < buttons.length; i++) {
        buttons[i].addEventListener('click', chooseDefaultColor);
      }
    
      // Retrieve initial custom property values and update controls.
      quantum.value = getVariable(styles, '--spacing-unit').replace('px', '');
      gutter.value = getVariable(styles, '--margins');
      columns.value = getVariable(styles, '--grid-columns');
    
      // Set up event handlers for having the sliders update the custom properties
      // at the document level.
      quantum.addEventListener('input', function() {
        setDocumentVariable('--spacing-unit', quantum.value + 'px');
      });
    
      gutter.addEventListener('input', function() {
        setDocumentVariable('--margins', gutter.value);
      });
    
      columns.addEventListener('input', function() {
        setDocumentVariable('--grid-columns', columns.value);
      });
    });
    :root {
      /*************************** Page-wide variables ****************************/
    
      /* Base spacing unit. */
      --spacing-unit: 6px;
    
      /* Margin size. No unit, because it's a multiple of the spacing unit. */
      --margins: 2;
    
      /* Colors. */
      --primary-color: #5E35B1;
      --primary-color-text: #FFF;
    
      /* Number of columns to show. */
      --grid-columns: 3;
    
      /***************************** Calculated values ****************************/
      /* We don't use calc here because we don't want to resolve the values yet.
         You can think of these as simple textual replacements. */
    
      /* The size of the margin around the card grid. */
      --margin-size: (var(--margins) * 2);
      /* How much internal padding each cell should have */
      --cell-padding: (4 * var(--spacing-unit));
      /* How big the space between cells should be */
      --grid-gutter: (var(--margins) * var(--spacing-unit));
      /* How big the space should be around the grid */
      --grid-margin: (var(--margin-size) * var(--spacing-unit));
      /* Calculated cell margin */
      --cell-margin: (var(--grid-gutter) / 2);
    }
    
    .header {
      display: block;
      position: relative;
      height: calc(28 * var(--spacing-unit));
      /* Use a default value for the background color, by passing it in as the 2nd
         parameter to var(). We don't strictly need it in this case, since we've
         defined it at the document level, but this illustrates common usage. */
      background-color: var(--primary-color, #5E35B1);
      padding-left: calc(4 * var(--spacing-unit));
    
      transition: background-color 1s;
    }
    
    .title {
      position: relative;
      top: calc(8 * var(--spacing-unit));
      font-family: 'Roboto', 'Helvetica', sans-serif;
      font-size: calc(4 * var(--spacing-unit));
      font-weight: 400;
      color: var(--primary-color-text);
    
      transition: color 1s;
    }
    
    .shade {
      display: block;
      box-sizing: border-box;
      position: absolute;
      padding-left: calc(1 * var(--spacing-unit));
      bottom: 0;
      left: 0;
      width: 100%;
      height: calc(8 * var(--spacing-unit));
      background-color: rgba(0, 0, 0, 0.2);
    }
    
    .grid {
      /* Resets */
      margin: 0;
      border: 0;
      padding: 0;
    
      display: flex;
      flex-flow: row wrap;
      align-items: stretch;
    
      padding: calc(var(--grid-margin) - var(--cell-margin));
    
      background-color: var(--grid-color);
    }
    
    .cell {
      font-family: 'Roboto', 'Helvetica', sans-serif;
      color: rgb(97, 97, 97);
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      margin: calc(var(--cell-margin));
      background-color: var(--cell-color);
      width: calc(100% / var(--grid-columns) - var(--grid-gutter));
      box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),
          0 3px 1px -2px rgba(0,0,0,.2),
          0 1px 5px 0 rgba(0,0,0,.12);
    }
    
    .cell-title {
      font-size: calc(3 * var(--spacing-unit));
    }
    
    .cell-header {
      display: flex;
      align-items: center;
      color: var(--primary-color-text);
      box-sizing: border-box;
      background-color: var(--primary-color);
      padding-left: calc(var(--cell-padding));
      height: calc(12 * var(--spacing-unit));
    }
    
    .cell-content {
      font-size: calc(2.5 * var(--spacing-unit));
      padding: calc(var(--cell-padding));
      flex-grow: 1;
    }
    
    .cell-actions {
      padding: calc(2 * var(--spacing-unit));
      border-top: 1px solid rgba(0, 0, 0, 0.12);
    }
    
    .picker-button {
      position: relative;
      font-family: 'Roboto', 'Helvetica', sans-serif;
      font-size: calc(2 * var(--spacing-unit));
      display: inline-block;
      box-sizing: border-box;
      border: none;
      border-radius: 2px;
      color: var(--primary-color);
      text-decoration: none;
      padding: calc(2 * var(--spacing-unit));
      text-decoration: none;
      background: transparent;
      cursor: pointer;
      overflow: hidden;
      text-transform: uppercase;
    
      transition: background-color 0.2s;
    }
    
    .picker-button:focus {
      outline: none;
    }
    
    .picker-button:active {
      background-color: #DDD;
    }
    
    .controls {
      display: flex;
      flex-direction: column;
      position: absolute;
      top: 4px;
      right: 4px;
      font-family: sans-serif;
      font-size: 12px;
      padding: 8px;
      background-color: rgba(200, 200, 200, 0.8);
    }
    
    .control {
      display: flex;
      align-items: center;
      margin: 0 0 8px 0;
    }
    
    .control-key {
      flex-grow: 1;
      margin-right: 16px;
    }
    
    .control-value {
      width: 152px;
    }
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <div class="header">
      <div class="title">CSS Variable Demo</div>
      <div class="shade"></div>
    
      <div class="controls">
        <p class="control">
          <span class="control-key">Spacing unit:</span>
          <input class="control-value" type="range" id="quantum" min="4" max="8" step="1">
        </p>
        <p class="control">
          <span class="control-key">Columns:</span>
          <input class="control-value" type="range" id="columns" min="1" max="4" step="1">
        </p>
        <p class="control">
          <span class="control-key">Margins:</span>
          <input class="control-value" type="range" id="gutter" min="1" max="5" step="1">
        </p>
      </div>
    </div>
    <div class="grid">
      <div class="cell" style="--primary-color: #F44336; --primary-color-text: #FFF;">
        <header class="cell-header">
          <div class="cell-title">
            Red
          </div>
        </header>
        <main class="cell-content">
          Click the buttons on the cards to set the default color scheme for the
          whole sample.
        </main>
        <div class="cell-actions">
          <button class="picker-button">
            Use this color
            <div class="ripple"></div>
          </button>
        </div>
      </div>
      <div class="cell" style="--primary-color: #E91E63; --primary-color-text: #FFF;">
        <header class="cell-header">
          <div class="cell-title">
            Pink
          </div>
        </header>
        <main class="cell-content">
          The colors on the cards are not affected because they're individually
          defined at the card level, and thus prioritised according to standard CSS
          rules.
        </main>
        <div class="cell-actions">
          <button class="picker-button">
            Use this color
            <div class="ripple"></div>
          </button>
        </div>
      </div>
      <div class="cell" style="--primary-color: #9C27B0; --primary-color-text: #FFF;">
        <header class="cell-header">
          <div class="cell-title">
            Purple
          </div>
        </header>
        <main class="cell-content">
          Use the controls above to adjust some properties that affect the entire
          page.
        </main>
        <div class="cell-actions">
          <button class="picker-button">
            Use this color
            <div class="ripple"></div>
          </button>
        </div>
      </div>
      <div class="cell" style="--primary-color: #00BCD4; --primary-color-text: #424242;">
        <header class="cell-header">
          <div class="cell-title">
            Cyan
          </div>
        </header>
        <main class="cell-content">
          Every size on the page is calculated as a multiple of the spacing unit,
          so setting the property to a different value resizes all elements.
        </main>
        <div class="cell-actions">
          <button class="picker-button">
            Use this color
            <div class="ripple"></div>
          </button>
        </div>
      </div>
      <div class="cell" style="--primary-color: #009688; --primary-color-text: #FFF;">
        <header class="cell-header">
          <div class="cell-title">
            Teal
          </div>
        </header>
        <main class="cell-content">
          Changing the number of columns is done by recalculating the relative size
          of cells on the grid.
        </main>
        <div class="cell-actions">
          <button class="picker-button">
            Use this color
            <div class="ripple"></div>
          </button>
        </div>
      </div>
      <div class="cell" style="--primary-color: #4CAF50; --primary-color-text: #424242;">
        <header class="cell-header">
          <div class="cell-title">
            Green
          </div>
        </header>
        <main class="cell-content">
          Margins adjusts both the spacing around the grid and the gutters inside of
          it.
        </main>
        <div class="cell-actions">
          <button class="picker-button">
            Use this color
            <div class="ripple"></div>
          </button>
        </div>
      </div>
    </div>

    我想总结一下我开始时的情况。支持还不开心。但是,时间流逝,很快一切都会改变。

    • 6
  4. Sasha Omelchenko
    2020-03-12T02:26:40Z2020-03-12T02:26:40Z

    由于问题实际上是关于自定义属性的,而不是关于伪类的:root,所以这里有一些让我喜欢的例子。

    Хотя препроцессоры умеют использовать свои внутренние переменные, они всё равно не умеют делать такую вещь, которая, кажется, всеми ожидалась: после изменения переменной автоматически менять имеющиеся свойства, которые её используют. Пример, унылые препроцессорные переменные, синтаксис SCSS:

    $main-index: 20px;
    
    .block {
      padding: $main-index;
    }
    
    .block-number-2 {
      font-size: $main-index;
    }
    
    @media (max-width: 900px) {
      $main-index: 20px;
    
      /* хотелось бы не задавать заново все свойства, но придётся :( */
    
      .block {
        padding: $main-index;
      }
    
      .block-number-2 {
        font-size: $main-index;
      }
    }
    

    Пример с модными CSS-переменными (разницу можно увидеть даже тут, если нажать на На всю страницу):

    :root {
      --main-index: 20px;
    }
    
    div {
      width: calc(var(--main-index) * 10);
      height: calc(var(--main-index) * 8);
      border: 1px solid;
    }
    
    .block {
      padding: var(--main-index);
    }
    
    .block-number-2 {
      font-size: var(--main-index);
    }
    
    @media (max-width: 900px) {
      :root {
        --main-index: 10px;
      }
    }
    <div class=block>Text inside block 1</div>
    
    <div class=block-number-2>Text inside block 1</div>

    Обратите внимание, что изменилась всего одна переменная и кучу свойств переписывать не надо, профит!


    Наконец-то можно разделить свойство transform, если используешь больше одной трансформации (хотя нам уже давно обещают сделать индивидуальные свойства scale, translate и прочие). Раньше анимировать несколько свойств или перезаписать их при помощи JS было тем ещё упражнением, но теперь всё изменилось! Пример:

    var block = document.querySelector('.transformator'),
        bodyStyles = window.getComputedStyle(document.body),
        scale = bodyStyles.getPropertyValue('--scale'),
        trX = bodyStyles.getPropertyValue('--trX'),
        trY = bodyStyles.getPropertyValue('--trY'),
        rotation = bodyStyles.getPropertyValue('--rotation');
    
    document.querySelector('.controller').onclick = function(e) {
      if ( e.target.classList.contains('scale') ) {
        scale *= 1.1;
        
        block.style.setProperty('--scale', scale);
      } else if ( e.target.classList.contains('rotate') ){
        rotation = parseInt(rotation) + 15 + 'deg';
        
        block.style.setProperty('--rotation', rotation);
      } else if ( e.target.classList.contains('movex') ){
        trX = parseInt(trX) + 10 + 'px';
        
        block.style.setProperty('--trX', trX);
      } else if ( e.target.classList.contains('movey') ){
        trY = parseInt(trY) + 10 + 'px';
        
        block.style.setProperty('--trY', trY);
      }
    }
    :root {
      --trX: 0;
      --trY: 0;
      --rotation: 0deg;
      --scale: 1;
      --base: 50px;
    }
    
    .transformator {
      width: var(--base);
      height: var(--base);
      background-image: linear-gradient(#2196f3 0%, #2196f3 50%, #ff0 50%);
      /* Slava Ukraini! */
      transform: scale(var(--scale)) translate3d(var(--trX), var(--trY), 0) rotate(var(--rotation));
      transition: transform .5s;
    }
    
    .controller {
      margin-bottom: var(--base);
    }
    <div class=controller>
      <button class=scale>scale +10%</button>
      <button class=rotate>rotate 15 deg</button>
      <button class=movex>move X +10px</button>
      <button class=movey>move Y +10px</button>
    </div>
    
    <div class=transformator></div>


    Отдельного упоминания заслуживает использование CSS-переменных с функцией calc(). Хотя в примерах выше она уже использовалась, но, думаю, её стоит упомянуть отдельно. Особенно интересно это смотрится при создании фигур, пример (также смотреть и на весь экран):

    :root {
      --start-index: 3;
    
      --a: calc( var(--start-index) * 20px);
      --b: calc( (var(--start-index) + var(--start-index) / 3) * 20px);
      --c: calc( (var(--start-index) + (var(--start-index) / 3) * 2) * 20px);
    }
    
    .pythagorean-triangle {
      position: relative;
      width: var(--b);
      height: var(--a);
    }
    
    .pythagorean-triangle div {
      height: 1px;
      background-color: #000;
      position: absolute;
      top: 0;
      left: 0;
    }
    
    .pythagorean-triangle__a {
      width: var(--a);
      transform: rotate(90deg);
      transform-origin: 0 0;
    }
    
    .pythagorean-triangle__b {
      width: var(--b);
    }
    
    .pythagorean-triangle__c {
      width: var(--c);
      left: auto !important;
      right: 0;
      transform: rotate(-36.8deg);
      transform-origin: 100% 0;
    }
    
    @media (min-width: 900px) {
      :root {
        --start-index: 30;
      }
    }
    <div class=pythagorean-triangle>
      <div class=pythagorean-triangle__a></div>
      <div class=pythagorean-triangle__b></div>
      <div class=pythagorean-triangle__c></div>
    </div>

    Коэффициенты подогнаны исходя из простейшего 3² + 4² = 5².

    Генерировать и менять размеры равносторонних фигур и фигур, с зависимыми друг от друга свойствами (квадраты, круги, овалы, параллелепипеды), стало просто, как никогда! )


    Ну и бонус-трек, стилизация SVG-спрайта типа <use> при помощи CSS-переменных. В автоматических генераторах спрайтов в будущем, надеюсь, будет возможность вставлять CSS-переменные каждой фигуре.

    .sprite {
      display: none;
    }
    
    .cross {
      display: inline-block;
      vertical-align: top;
      width: 100px;
      height: 200px;
    }
    
    .cross--red {
      --one-color: red;
      --two-color: #9a1616;
    }
    
    .cross--green {
      --one-color: green;
      --two-color: #5ef636;
    }
    
    .cross--blue {
      --one-color: blue;
      --two-color: #4666d5;
    }
    <svg xmlns="http://www.w3.org/2000/svg" class=sprite>
      <g id="icon">
        <rect width="100" height="10" x="0" y="40" style="fill: var(--one-color, #000)"/>
        <rect width="10" height="200" x="45" y="0" style="fill: var(--two-color, #000)" />
      </g>
    </svg>
    
    <svg xmlns="http://www.w3.org/2000/svg" class="cross">
      <use xlink:href="#icon"/>
    </svg>
    
    <svg xmlns="http://www.w3.org/2000/svg" class="cross cross--red">
      <use xlink:href="#icon"/>
    </svg>
    
    <svg xmlns="http://www.w3.org/2000/svg" class="cross cross--green">
      <use xlink:href="#icon"/>
    </svg>
    
    <svg xmlns="http://www.w3.org/2000/svg" class="cross cross--blue">
      <use xlink:href="#icon"/>
    </svg>

    PS就这些了,可惜我把比赛解释成了伪类的最佳定义:root。我希望这些用户案例集会让您感兴趣。

    PPS 请将@Qwertyi 的回答标记为已接受)

    • 5
  5. MobiDevices
    2020-03-07T21:29:11Z2020-03-07T21:29:11Z

    伪类:root,我们先搞清楚它适合用在什么地方,有什么用。

    理论

    使用它的主要目的是访问文档的根元素。

    HTML 页面的根元素是什么?这是一个元素<html>。事实证明,在 :root 伪类的帮助下,我们可以访问它。

    你可能想知道为什么我什至应该使用 :root 伪类,而我可以这样写:

    html { background-color: #fcfcfc; }
    

    并成功访问元素?

    但是,请不要忘记,CSS 是一项不仅仅用于 html 文档的技术,它还可以应用于 XML 页面和 SVG 文件等。

    使用这个符号:

    :root { background-color: #fcfcfc; }
    

    我们得到了一个更通用的符号来访问页面的根元素。在技​​术不断发展和越来越多新的移动设备出现的背景下,这一点非常重要。

    这是一个可以在实践中使用的示例文档。

    <!DOCTYPE HTML>
    <html>
    <head>
    <style type="text/css">
    :root {background-color:#000; }
    p {color:#fff;}
    </style>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Untitled Document</title>
    </head>
    <body>
    <p>Пример документа</p>
    </body>
    </html>
    

    CSS 变量

    但是,:root它也用于在 CSS 中设置变量。这是真正的奇迹开始的地方:

    :root {
      --color-main: #333333;
      --color-alert: #ffecef;
    }
    
    .error {
      color: var(--color-alert);
    }
    

    在 CSS 中使用变量的能力是 CSS 预处理器的一个显着优势。在最简单的示例中,我们可以通过定义设计中使用的颜色和字体,然后在需要特定字体或颜色时使用变量来节省大量时间。如果我们决定改变字体或调色板,我们只需要改变一个地方。

    结论

    最后,我想说 :root 伪类是最近才出现的,在旧的浏览器中不起作用。:rootIE 和 Edge 的支持非常令人沮丧:

    在此处输入图像描述

    • 3
  6. Web Mistress
    2020-01-17T16:33:50Z2020-01-17T16:33:50Z

    真正的操作体验是 :root - 只为特定浏览器编写样式。浏览器陌生感。它起作用只是因为不是每个人都支持它。

    • 1

相关问题

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    Python 3.6 - 安装 MySQL (Windows)

    • 1 个回答
  • Marko Smith

    C++ 编写程序“计算单个岛屿”。填充一个二维数组 12x12 0 和 1

    • 2 个回答
  • Marko Smith

    返回指针的函数

    • 1 个回答
  • Marko Smith

    我使用 django 管理面板添加图像,但它没有显示

    • 1 个回答
  • Marko Smith

    这些条目是什么意思,它们的完整等效项是什么样的

    • 2 个回答
  • Marko Smith

    浏览器仍然缓存文件数据

    • 1 个回答
  • Marko Smith

    在 Excel VBA 中激活工作表的问题

    • 3 个回答
  • Marko Smith

    为什么内置类型中包含复数而小数不包含?

    • 2 个回答
  • Marko Smith

    获得唯一途径

    • 3 个回答
  • Marko Smith

    告诉我一个像幻灯片一样创建滚动的库

    • 1 个回答
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Алексей Шиманский 如何以及通过什么方式来查找 Javascript 代码中的错误? 2020-08-03 00:21:37 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    user207618 Codegolf——组合选择算法的实现 2020-10-23 18:46:29 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5