1

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?

1
  • You're thinking of Markdown and its variants, much like what's used here on StackOverflow and which was exploited in your very own question to highlight the text you posted. Thus, your question as to whether it's possible to do this seems a little strange. Commented Aug 9, 2014 at 15:19

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for the response, I have opened a question specifically using Javascript or jQuery: stackoverflow.com/questions/25220102/…
0

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>

1 Comment

Thank you. I will shortly open a question asking the same thing aimed at Javascript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.