Henrik Petterson
Henrik Petterson

Reputation: 7094

Formatting text only with CSS

I run a site where users submit basic news articles. I want to add some formatting features for their submissions.

Is it possible to add custom formatting to text only using CSS?

For example, user can add:

**This should be bold**

And the text appears bold. Or user adds > at the beginning of the paragraph:

> This could be a lengthy paragraph

And the paragraph is aligned to the center.

Is such thing possible to do?

Upvotes: 1

Views: 68

Answers (2)

Moshtaf
Moshtaf

Reputation: 4903

It's not possible using pure CSS. You have to use Javascript or JQuery or process your custom tags in Server-Side and render them as html and css as you want.

Upvotes: 1

Philipp Braun
Philipp Braun

Reputation: 1573

No it is not. You will need javascript or php to replace ** with <b> for example. Otherwise your users would need to put in <b>Hello</b>

Upvotes: 0

Related Questions