# C1.Win.Editor.C1Editor.SetCssStyleAtSelectionAsync

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Editor_C1Editor_SetCssStyleAtSelectionAsync_" data-uid="C1.Win.Editor.C1Editor.SetCssStyleAtSelectionAsync*">SetCssStyleAtSelectionAsync Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Editor_C1Editor_SetCssStyleAtSelectionAsync_" data-uid="C1.Win.Editor.C1Editor.SetCssStyleAtSelectionAsync*"></a>
<h4 id="C1_Win_Editor_C1Editor_SetCssStyleAtSelectionAsync_System_String_System_String_System_String_" data-uid="C1.Win.Editor.C1Editor.SetCssStyleAtSelectionAsync(System.String,System.String,System.String)">SetCssStyleAtSelectionAsync(string, string, string)</h4>
<div class="markdown level1 summary"><p>Sets CSS style to the selected tag asynchronously.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Task SetCssStyleAtSelectionAsync(string className, string cssStyleInfo, string tag = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function SetCssStyleAtSelectionAsync(className As String, cssStyleInfo As String, Optional tag As String = Nothing) As Task</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>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
