Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trim empty HTML tag

Tags:

html

aptana

I have in my HTML code this line:

<iframe src="http://example.com"></iframe>

As editor I use Aptana.

How can I solve this warning? What does it mean?

"Should trim empty <iframe>."

"Should trim empty <iframe>."

like image 239
Ionică Bizău Avatar asked Mar 10 '13 16:03

Ionică Bizău


People also ask

How do you delete empty elements in HTML?

Answer: Use the filter() Method You can simply use the filter() method to remove empty elements (or falsy values) from a JavaScript array. A falsy value is a value that is considered false in a Boolean context.

What tag is empty in HTML?

Some examples of empty tags are img, embed, area, meta, link, etc. The empty elements are those elements of HTML that cannot have some content like text or child element inside them. There is no need to specify the closing tag, and the opening tag should end with /> instead of >.


1 Answers

It is because there is no body for the iframe tag.

One option to remove the warning will be putting the closing tag in a different line:

<iframe src="http://example.com">
</iframe>

Or adding a space:

<iframe src="http://example.com"> </iframe>
like image 151
ATOzTOA Avatar answered Sep 21 '22 16:09

ATOzTOA