Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I apply CSS to badly written HTML???

Posted on 2008-06-26
6
Medium Priority
?
335 Views
Last Modified: 2013-12-25
Is there a way, on my Style Sheet, to tell the browser to apply my CSS styles to HTML that is badly formed??

I have a client who must, at times, write and post his own HTML. Unfortunately the best description of his code is "WIlly Nilly" ! Biggest problem is lack of use of <p> tags, closing tags, using closing tags where opening tags should be.

So how can I specify in CSS that "Willy Nilly" text (OK -- text with paragraph tags around it) will be formatted the same as I specify for <p> tags??



0
Comment
Question by:Spitfire6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:JurgenvH
ID: 21877936
You could search the posted (Willy Nilly) text for new lines and explode on every double new line. Each array element of the result can then be saved with paragraph-tags around it.
0
 

Author Comment

by:Spitfire6
ID: 21878111
Thanks for the response JurgenVH! That would seem very complicated. I have thought about writing a routine that would solve on of this guy's other bad habits, That of including mile long text links ("link text" ??) that causes Mozilla browsers to widen out.

But, There has to be a CSS specification that will apply a style to what is essentially text not enclosed in an HTML tag.

I just fooled around with the code attached added to my style sheet. Caused everything on a correctly written page to go Gigantic. I think it applied the style below IN ADDITION TO the style specified -- resulting in increased text sixe.
*P{font-family: "Franklin Gothic Medium";
	font-size: 105%;
	font-weight: normal;
	color: #000000;}

Open in new window

0
 
LVL 2

Expert Comment

by:JurgenvH
ID: 21878895
And the asterix declarations work in other browsers than IE?
0
 

Author Comment

by:Spitfire6
ID: 21879104
Please note that the "P" after the asterisk was a typo.

No, the same thing happed in Firefox.
0
 
LVL 2

Accepted Solution

by:
JurgenvH earned 150 total points
ID: 21881589
Sorry, didin't get the typo...
I never heard of the asterix as declaration of its own but probably its some kind of default for unstyled text or body text because only my bodytext gets supersized.
So I you could use it but since it is a default you'd have to catch all you Willy Nilly text with that same declaration.
If you don't want that, my first solution is still a possibility...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will learn how to dynamically set the form action using jQuery.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question