# Add span to selected text

**URL:** <https://forum.pinegrow.com/t/add-span-to-selected-text/164>\
**Category:** Styling (CSS)\
**Created:** [September 5, 2016, 11:06pm UTC](https://forum.pinegrow.com/t/add-span-to-selected-text/164 "2016-09-05T23:06:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cescc78](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/cescc78/32/77_2.png) [@cescc78](https://forum.pinegrow.com/u/cescc78)\
**Post date:** [September 5, 2016, 11:06pm UTC](https://forum.pinegrow.com/t/add-span-to-selected-text/164/1 "2016-09-05T23:06:32Z")

</div>

Hi!! Is there any option to add span classes to selected text??

Regards, César Carranza

---

<div class="post-metadata">

**Author:** ![Rob](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/rob/32/9_2.png) [@Rob](https://forum.pinegrow.com/u/Rob)\
**Post date:** [September 6, 2016, 8:47am UTC](https://forum.pinegrow.com/t/add-span-to-selected-text/164/2 "2016-09-06T08:47:54Z")

</div>

Hi @cescc78 If I’m understanding your question correctly the answer is yes. If you are working with Bootstrap for example then search for “span” in the Lib tab and drag the span element onto the page. This will add span to the page (when viewed in code mode you will see span), all you have to do is double click on the work span and replace the word span with whatever text you want instead.

![](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/1X/7b0797113a87763e11d6008c1f0c507655e99e8a.png)

---

<div class="post-metadata">

**Author:** ![Thomas](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/thomas/32/61_2.png) [@Thomas](https://forum.pinegrow.com/u/Thomas)\
**Post date:** [September 6, 2016, 1:39pm UTC](https://forum.pinegrow.com/t/add-span-to-selected-text/164/3 "2016-09-06T13:39:22Z")

</div>

Hi I think it’s more meant to select a word (or more) and have then the ability to “wrap” a span around this selection (pretty similar as you would turn it into a link). And if possible, to add classnames in this dialogue.

![](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/1X/ddd6f13b6e5f0dbf088fec80a8dfdc908bc11c99.jpg)

Cheers

Thomas

---

<div class="post-metadata">

**Author:** ![Rob](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/rob/32/9_2.png) [@Rob](https://forum.pinegrow.com/u/Rob)\
**Post date:** [September 6, 2016, 2:00pm UTC](https://forum.pinegrow.com/t/add-span-to-selected-text/164/4 "2016-09-06T14:00:09Z")

</div>

@cescc78 @Thomas I think I understand better now what was asked. Once the span has been created, select it in the Document Tree, then click on the **CSS Tab** and “ **Add Rule** ” \> .nameRule (remember to have **.** in front of the name) \> **Create & Assign class** then edit the properties for this rule. This creates and assigns the rule to the current span.

![](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/1X/30b7f161cbfc9c2eb172c8fd3718b844613b68a5.png)

* * *

## Span after creating a new class and assigning it to the span

 ![](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/1X/5b0740aed952310cc40d4bc81551ff603d65e7c2.png)

---

<div class="post-metadata">

**Author:** ![Thomas](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/thomas/32/61_2.png) [@Thomas](https://forum.pinegrow.com/u/Thomas)\
**Post date:** [September 6, 2016, 8:43pm UTC](https://forum.pinegrow.com/t/add-span-to-selected-text/164/5 "2016-09-06T20:43:50Z")

</div>

Sure Rob. Thanks for your efforts and help here.

But it’s perhaps more about **creating** the span (rather than its class and assignment). And I hereby agree with the original poster that it could be a lil bit more elegant. I don’t see anything speaking against handling this similar to creating a link.

Just my two cents.

Cheers

Thomas

---

<div class="post-metadata">

**Author:** ![cescc78](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/cescc78/32/77_2.png) [@cescc78](https://forum.pinegrow.com/u/cescc78)\
**Post date:** [September 7, 2016, 6:04pm UTC](https://forum.pinegrow.com/t/add-span-to-selected-text/164/6 "2016-09-07T18:04:03Z")

</div>

Hi @Rob and @Thomas

Both are correct I need to add “code free” span’s with the editor and the span.rule class as new CSS rule.

Thanks.
