CSS workaround to reset overwriting obsolete HTML attributes (e.g. align, bgcolor)?

I have a website that is updated through the WYSIWYG editor by people with very little knowledge of HTML. WYSIWYG exports a table-based structure with old obsolete tags such as "align" and "bgcolor" to the CSS site, so these attributes will be overwritten.

For example, a black background is applied to a table in the WYSIWYG editor, but as soon as it goes live to the site, the background defaults to no one (default) due to the CSS reset site.

Is there a way to account for these old tags that CSS rewrites that I may not see without getting rid of CSS reset, creating extra CSS markup, or updating the WYSIWYG tool?

+6
html css html-table deprecated
source share
4 answers

Ideally, you should not use the WYSIWYG editor, which generates table layouts and obsolete attributes - this is just bad semantics.

I would suggest updating to a better editor like TinyMCE, since you cannot force an attribute style to override your CSS rules.

+3
source share

Can you use JavaScript to replace bum attributes with RegEx?

replace () - http://www.w3schools.com/jsref/jsref_replace.asp

RegEx - http://www.regular-expressions.info/tutorial.html

+1
source share

Not. CSS explicitly overrides any presentation markup in a document.

0
source share

You will need to do some work,

The best IMO option is to style the classes for these elements in CSS and redefine them.

0
source share

All Articles