What I want to accomplish is to have one division with the first part of the text red and the second part green. How would I do that?

Recommended Answers

All 2 Replies

You mean that you wnt to have the first part of a text green and the second red

//add your css

#green p{color:green;}
#red   p{color :red;}

<div id="main">

    <div id="green">

    <div id="red">

commented: I imagined something very complicated. Thank you! +0

If one div is required, you can place a span element around the text that you want to format differently, then apply a style on that span element. Or you can do this with jQuery. Please clarify exactly what you are trying to do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.