473,388 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

How to prevent a div from inheriting font colors

I have a bit of a tricky (at least for me) CSS question.

What I'm doing is creating a div with a specific ID to it that controls the background color, border, font, font size and font color. All of that works fine. This div displays text and html entered in a wysiwyg editor by an end user.

The problem I'm having is that when people put in links in the editor the text color of those links is being set to something outside of my div. In fact this div is inside an overall div.

So, the link text is picking up the characteristics of the overall div and what I want to do is to specify what links will look like when they are inside the specific div for this section.

I've tried a number of variations with no success. I know I can hack the text entered in the wysiwyg editor before displaying it but I'd rather not do something like that.

Thanks in advance.
Jun 18 '07 #1
3 2406
drhowarddrfine
7,435 Expert 4TB
Can't you just give that div its own ID and set the color there?
Jun 18 '07 #2
Can't you just give that div its own ID and set the color there?
Not unless I hack it. The idea is that an external user will be entering in information in a wysiwyg editor and IT will assign paragraph tags but not with div names.
Jun 19 '07 #3
drhowarddrfine
7,435 Expert 4TB
Then you might look into the first-child pseudo class . It's been a while since I've messed with it so I don't know if this would do the trick or not.
Jun 19 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Tom | last post by:
I'm calling an external .js file with plain html links for my navigation text area (so I can update it across the site more easily), but the links are "inheriting" my css hyperlink qualities. I...
2
by: Mr.Baha | last post by:
Hello, I have a situation where I am appending text to a multi-line (rich)textbox in a C# form. Now depending on which event does the appendtext, i want to distinguish the lines in the textbox by...
10
by: Darrell Wesley | last post by:
Where xlWs is an Excel.Worksheet and xlRG is an Excel.Range xlRG = xlWS.Cells(row, 7) xlRG.Font.Bold = True xlRG.Font.Color = 255 In VB6 you could just simply say xlRG.Font.Color = vbRed...
1
by: Steve Bottoms | last post by:
Hi, all! How does one prevent table cell background colors from alternating between grey and white? I've dropped a basic table control on an ASP.Net page (using VB.Net codebehind), and...
4
by: JoelW | last post by:
Let's say you're programming in VB.NET, and you have: Dim str1 As String Dim str2 As String Dim str3 As String str1 = "I am red" str2 = "I am yellow" str3 = "I am dark green"
7
by: Will Hartung | last post by:
I have a simple rule: ..main p { font-size: small; color: red;} But if I put a paragraph in a TABLE, it basically comes out black and a different size. I found if I did: ..main table {...
1
by: iwdu15 | last post by:
hi, im trying to figure out how to get all the font and color selections of a richt text box. for instance we could have this: Red (formatted in red color and Arial font) Green (formatted in...
3
by: Dan Jacobson | last post by:
Let's say all one can do to override a document's link colors, <a href="FAQ.aspx"><font color="#0000ff">FAQ</font></a> is inject things like: <a href="FAQ.aspx"><span style="color:green"><font...
2
by: kheitmann | last post by:
OK, so I have a blog. I downloaded the "theme" from somewhere and have edited a few areas to suit my needs. There are different font themes within the page theme. Long story short, my "Text Posts"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.