# C1.Win.Editor.C1Editor.SetCssStyleAtSelection

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Editor_C1Editor_SetCssStyleAtSelection_" data-uid="C1.Win.Editor.C1Editor.SetCssStyleAtSelection*">SetCssStyleAtSelection Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Editor_C1Editor_SetCssStyleAtSelection_" data-uid="C1.Win.Editor.C1Editor.SetCssStyleAtSelection*"></a>
<h4 id="C1_Win_Editor_C1Editor_SetCssStyleAtSelection_System_String_System_String_System_String_" data-uid="C1.Win.Editor.C1Editor.SetCssStyleAtSelection(System.String,System.String,System.String)">SetCssStyleAtSelection(string, string, string)</h4>
<div class="markdown level1 summary"><p>Sets CSS style to the selected tag.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Obsolete(&quot;This method is deprecated, please, use SetCssStyleAtSelectionAsync instead.&quot;)]
public void SetCssStyleAtSelection(string className, string cssStyleInfo, string tag = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;Obsolete(&quot;This method is deprecated, please, use SetCssStyleAtSelectionAsync instead.&quot;)&gt;
Public Sub SetCssStyleAtSelection(className As String, cssStyleInfo As String, Optional tag As String = Nothing)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">className</span></td>
      <td><p>A css class name to use for the selected tag.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">cssStyleInfo</span></td>
      <td><p>Specifies a css style definition for the tag. If null, then the classname css style
is used. If both classname and cssTyleInfo are specified, the css class is defined.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">tag</span></td>
      <td><p>Tag to which the style should be applied. If 'null' or Empty is applied to the first tag at the selection.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
