tags:

views:

330

answers:

5

I believe this isn't legal html, correct? as far as I can tell, almost every browser display/executes this anyway anything I can do as an enduser?

the problem: its stuff added by free hosting provider, i don't really want to see it if its outside html tags, I don't care what it is. If there's a setting/button for firefox I'd like to know, thanks

+1  A: 

I believe this isn't legal html, correct?

Correct.

.. as far as I can tell, almost every browser display/executes this anyway ..

Yes - Browsers try to get the best out of the mess that they get served.

.. anything I can do as an enduser?

What is the problem you're having with it?

troelskn
+1  A: 

Correct, it's not legal HTML. However, browsers have always attempted to render pretty much anything, no matter how malformed, in order not to make creating HTML pages difficult for people who might not understand the standard completely. Unfortunately, this has resulted in a widespread complete disregard for the standard.

There is apparently a way to configure Opera not to use the "quirks mode" and stick to the letter of the standard.

Michael Borgwardt
A: 

Firefox adheres to strict html 4 I think. You can also switch modes in firefox to "strict"

Rimian
No browser could reach the number of users Firefox has if it didn't attempt to render malformed HTML. I'd be very interested to learn how to switch on that "strict mode", however.
Michael Borgwardt
@Michael: +1 for that bold statement of the truth.
Cerebrus
+1  A: 

the problem: its stuff added by free hosting provider, i don't really want to see it if its outside html tags, I don't care what it is. If there's a setting/button for firefox I'd like to know

For you:

  • install AdBlock Plus
  • create a new Element Hiding Rule: (affected.domain.com##HTML + *), effectively selecting all siblings to the HTML element

For all other people visiting your web site, either:

  • make them do what you did, or
  • at your own risk, break the rules of your hosting provider by adding a CSS rule similar the one above to your page, or
  • live with it, or
  • change to a paid hosting provider who do not attach ads to your page
Tomalak
A: 

I have not tried it, but if you want to get rid of it for everybody, you could try something in your style-sheet like:

    img {
        display: none;
    }
    body img {
        display: inline;
    }

This should remove all images outside the body but I don´t know how the browser will handle the images and the styles when it is not valid html.

You can do the same for other elements if it works (obviously not the <script> tag).

Edit: It does not work with the body tag, but it does with a div inside the body tag, so if your content is located in a tag with id contents, this works (in IE7 and Firefox 3 at least):

    img {
        display: none;
    }
    #contents img {
        display: inline;
    }
jeroen