MOON
Server: Apache
System: Linux res.emeff.ca 3.10.0-962.3.2.lve1.5.24.10.el7.x86_64 #1 SMP Wed Mar 20 07:36:02 EDT 2019 x86_64
User: accemeff (1004)
PHP: 7.0.33
Disabled: NONE
Upload Files
File: /home/accemeff/vendor/craftcms/cms/docs/dev/tags/css.md
# `{% css %}` Tags

The `{% css %}` tag can be used to register a `<style>` tag in the page’s `<head>`.

```css
{% css %}
    .content {
        color: {{ entry.textColor }};
    }
{% endcss %}
```

::: tip
The tag calls <api:yii\web\View::registerCss()> under the hood, which can also be accessed via the global `view` variable.

```twig
{% set styles = ".content { color: #{entry.textColor}; }" %}
{% do view.registerCss(styles) %}
```
:::

## Parameters

The `{% css %}` tag supports the following parameters:

### `with`

Any HTML attributes that should be included on the `<style>` tag.

```twig
{% css with {type: 'text/css'} %}
```

Attributes will be rendered by <api:yii\helpers\BaseHtml::renderTagAttributes()>.