Removing iframe Horizontal Scrollbar
Oh c’mon! A few days ago, I was already about to die trying to remove a freakin’ horizontal scrollbar of the iframe in this fanlisting. The problem is only associated with Internet Explorer. :devil: The last resort I could do was to compare it line after line with another code that does not show the said scrollbar. So how did it turn out? Well, the only thing that was missing was a line before the document type declaration (DTD). I then remembered that the same thing holds true for the scrollbar colors that are not supported in Firefox (I used to do it before). So anyway, for instance, the first line of the code should not be:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Instead,
<!--anything goes here (perhaps even a blank line)--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Whew, glad I did it. And oh, please bear with the title of this post. :sweat:
On other whatnots…
- I find the new Voice biscuit ad really awesome. Its concept is mutants (or the “Heroes” TV series every entity on earth is talking about).
- Last Saturday was the last day of the Salakayan Festival here in Miag-ao. I went to the plaza for dinner together with my dormmates Julius, McDeansem, Michael, and Rodrigo. We walked our way back to the dorm and happily chatted about animes, Koreanovelas, X-Men and Power Rangers every Friday night then, and Mexicanovelas like Rosalinda and Ruby (Ang Bidang Kontrabida). š
- I knew that Spring Waltz in ABS-CBN is the fourth and last installment of the Endless Love series after three years. The first three all aired in GMA ā Autumn In My Heart, Winter Sonata, and Summer Scent.
- Watched Bicentennial Man in ABS last Sunday and shed. :no: šÆ
- First long exam in Operating Systems tomorrow. I must do good!
- Today is Ash Wednesday, but I’m not going to the church. š I’m becoming the devil.
8 Comments
February 7, 2008 at 18:41
oooooh.. spring waltz.. endless love series pala. i haven’t tried watching it.maybe i should watch one of these days.. haha i notice that everyone watches it. š
good luck with your exam. š
Today is Ash Wednesday, but Iām not going to the church. š Iām becoming the devil. — that made me LOL. xD
February 7, 2008 at 20:01
Talaga? Fourth and last installment ng Endless Love ang Spring Waltz. Nagyon ko lang nalaman. Ang weird kasi eh, bakit ba sa 2 kasi ipinalabas. Lol. I’m not a fan of koreanovelas, madalang lang akong manood ng mga ganyan, the last koreanovela I watched was Princess Hours.
February 7, 2008 at 20:44
Hello Nelson. Goodluck to that exam in OS š I believe you will do well. Have a great day
February 9, 2008 at 18:28
wooow… Spring waltz is an installment of the Endless Love series???
Woah.
ooh, Good luck with the exaaaammmm!!!! :cheerful: :angel: š
August 11, 2008 at 20:26
hi..machan(thats one of word for friend in our country..)
thanks lot..
i also dieying with iframe horizontal scrollbar..now fixed it..
thanx..again.
bye
August 11, 2008 at 20:39
Oi,
I’m really pleased to finally hear from someone who also finds this little ‘fix’ effective.
Glad to be of help, machan. š
December 2, 2008 at 18:15
Nelson,
The W3C specification for XHTML states “There must be a DOCTYPE declaration in the document prior to the root element” (http://www.w3.org/TR/xhtml-basic/#s2.1)
Now exactly how this is interpreted, differs (of course) between browsers. Most browsers will allow most whitespace characters before the doctype, though Internet Explorer (versions 6 – 8b2) and Opera will not allow a non-breaking space (Alt-0160). Firefox and Safari will allow anything that is not a tag (for example ), even plain text. Internet Explorer (all versions) will not allow comments before the doctype either, but all other browsers do.
Having illegal content before the doctype has the same effect as an invalid doctype or having no doctype at all; the page is interpreted in quirks (backwards compatibility) mode.
Now, back to the horizontal scrollbar. I have also witnessed this, it happens in Internet Explorer 6 with iframes (and normal frames?) where the content is forced to 100% wide, and the content document is standards compliant. (Clearly a bug in IE6’s standards compliance.)
What now, if you don’t want that scrollbar, but still needs pages that can be tested for standard compliance? Internet Explorer 6, in all it’s wisdom, does not even allow an XML declaration (for example ) before the doctype. All other browsers I tested, including newer versions of IE, do allow the XML declaration. So just add an XML declaration before the doctype of the iframe contents document, and you will not have a horizontal scrollbar anymore. Of course, this may mean you will have to deal with other weirdness in the document because it’s rendered in quirks mode in IE6 (only)….
Some more info about quirks mode:
http://www.cs.tut.fi/~jkorpela/quirks-mode.html
http://www.quirksmode.org/
December 2, 2008 at 22:24
Hello Peter,
First of all thank you very much for the very informative comment. I think I haven’t heard anything about that that quirks mode before but I must say that for my part, even though you stated that having illegal content before the doctype has the same effect as an invalid doctype or having no doctype at all, I still consider it “harmless” by the mere basis that the validator accepted it without any warnings.
I have tried using an XML declaration before but it didn’t turn out valid when I checked it. I didn’t know if there was only a typo but one thing’s for sure: from that day until today, I haven’t used it again and stuck to the meta tag instead. Lastly, I think there are still a lot of IE users out there who use 6.