Solved

Tidy - avoid removal of empty elements

Posted on 2010-11-07
1
1,727 Views
Last Modified: 2012-05-10
Hello,

we'd like to avoid removing empty elements with tidy, such as:
<span class="test"></span>

Open in new window


since we need it for several css hacks. We know the option to just include an escaped whitespace:
<span class="test">&nbsp;</span>

Open in new window


but that's not really an option. Also we cannot add name or id attributes, since otherwise any single span element would need a unique name.

Is there a way in the tidy options to configure NOT to remove empty tags?

Thanks and bests
0
Comment
Question by:semantique
[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
1 Comment
 
LVL 9

Accepted Solution

by:
pg-expert earned 500 total points
ID: 34081703
what you are using is the best option to avoid tidy removing empty tags.

~PG
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

634 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