Ok... in my website (that I hope to be able to have hosted here
) I am trying to embed Google Videos to be able to share my favorite videos with my viewers (mainly my friends) but the code Google gives me isn't xhtml 1.0 compliant, it uses <embed> which was depricated in favor of <object> but I don't really understand how to use the tag and I was wondering if anyone could help me understand... I've googled the crap out of this problem and still don't really understand fully.
Thanks,
Codeman
| Code: |
<object
type="application/x-shockwave-flash" data="URL"
width="" height="">
<param name="movie" value="URL" />
</object> |
just change height, width and the 2 url's 
Ok, that worked! Thank you, but now I'm having a problem with my background randomly not showing up any more in Firefox and also... my div's are all screwed up in IE (I hate that browser so bad) any advice there?
P. S. Because I know you can't really fix a problem like this without seeing it usually my url is http://codeman.byethost2.com and I'd also like some feedback on the layout and stuff while we're at it lol
Thanks again,
Codeman
A few things...
1. The ads at the top are displayed in an IFRAME, which isn't a part of XHTML 1.1 (or 1.0 Strict) - only XHTML 1.0 Frameset or Transitional.
2. Since your page isn't higher than the typical browser window, there's no reason to use "position: fixed" for the Firefox logo etc., especially since IE doesn't understand "position: fixed". Use "position: absolute" instead. If you need the "fixed" attribute, you could, for example, use an IE conditional comment to restyle the "fixed" elements to "position: absolute" - and add this to the IE-only stylesheet also:
| Code: |
html, body {
height: 100%;
overflow: auto;
} |
The would make things work pretty much like position: fixed in IE. Just remember not to include IE7 in the conditional comment, since that one does support position: fixed. And it's rather important that only IE sees those rules, since it is a hack
3. The reason the background doesn't show up in Firefox is that <body> isn't "special" in XML like it is in HTML. So, it doesn't fill up the entire browser window. The <html> element does. So, all you should need to do is change any CSS for body to also include html:
| Code: |
html, body {
background: #660000 url('images/bg_grad1.gif') repeat-x fixed top;
color: #FFCC00;
} |
4. A few semantic HTML things...
| Code: |
| <h1><span class="bg_coloring"><C<img src="images/firefox2.png" alt="firefox">DEMAN /></span></h1> |
Just change that to:
| Code: |
| <h1><C<img src="images/firefox2.png" alt="firefox">DEMAN /></h1> |
... and put the styling in h1 instead.
And consider using <dl>/<dd>/<dt> rather than tables for the FAQ. 
Thanks all of that worked perfectly! Thank you very much! Oh, and the IFRAME thing comes from the host... thus I'm here
I just completely did away with the fixed idea... the whole reason it's there is that my page used to scroll but then I changed like that and didn't even think to change that part lol The HTML thing... I've not really read as much as I should on 1.1 vs 1.0 and didn't know that about body and html. I probably shouldn't even use 1.1 but it's cool anyway. The span thing too was old code... don't even really remember why lol and the definition tags seem a lil weird to use and it doesn't render the text quit the way I want but I'll get used to it... it's easier to code anyway lol... so that is what I've learned from this... thanks to all!!!
| codeman wrote: |
| The HTML thing... I've not really read as much as I should on 1.1 vs 1.0 and didn't know that about body and html. I probably shouldn't even use 1.1 but it's cool anyway. |
It's not a difference between 1.1 and 1.0 as such. But as soon as you serve the page as XML (application/xhtml+xml), a standards compliant browser will render it as XML, not HTML. And in XML, body doesn't have the special meaning it does in HTML. It will do the same for XHTML 1.0, if you serve that as XML.
| Quote: |
| and the definition tags seem a lil weird to use and it doesn't render the text quit the way I want but I'll get used to it... it's easier to code anyway lol... |
Well, it's a matter of taste. You could argue that the FAQ is a table, but I prefer to think of it as a list of definitions - the question being the term, and the answer being the definition. But mainly because it requires less tags. As for rendering, you can get it to render the exact same way using CSS. 
Ok, so one more question... so the doctype and mime type information on my page is generated through some php code I found on the net... I tried it to see what it would do... not realizing it was xhtml+xml what is the advantage or difference of the "+xml" part? Also where can I learn more about xhtml+xml. I understand the two concepts seperately but I've never seen a mime type of xhtml+xml before until now.
| codeman wrote: |
| Ok, so one more question... so the doctype and mime type information on my page is generated through some php code I found on the net... I tried it to see what it would do... not realizing it was xhtml+xml what is the advantage or difference of the "+xml" part? Also where can I learn more about xhtml+xml. I understand the two concepts seperately but I've never seen a mime type of xhtml+xml before until now. |
That mime type is the recommended mime-type for XHTML 1.0 and later. To quote the W3C note on the issue,
| W3C wrote: |
| The 'application/xhtml+xml' media type [RFC3236] is the media type for XHTML Family document types |
(their emphasis).
http://www.w3.org/TR/xhtml-media-types/
The reason it's "application/xhtml+xml", and not just "application/xhtml" has to do with the idea that you can embed other types of XML documents (SVG, MathML etc.) inside the XHTML. "application/xml" may (in the W3C use of the word 'may') be used, but that has no advantages. There's no mime type called "application/xhtml".
The PHP script you're using deals with content negotiation, i.e., a browser that doesn't parse XML (such as Internet Explorer) will get the XHTML served as "text/html", and with the XML prolog (<?xml version="1.0" encoding="whatever") left out, in order to not trigger IE's quirks mode. In that case, it also seems to actually convert your XHTML to HTML 4.01 (by removing the empty-tag end-slashes). Modern browsers will get the content served as "application/xhtml+xml", with the proper prolog and doctype. All good
If you're not serving XHTML as "application/xhtml+xml" (and you must serve it as that when using XHTML 1.1) then XHTML really offers little in terms of advantages. A browser getting XHTML served as HTML will just see an old-fashioned HTML document with lots and lots of errors (ending slashes etc.), which it then has to send through cleanup.
What a lot of people don't realize is, that just because the page validates in W3C's validator, doesn't mean it'll actually work when they someday switch the mimetype (like the html/body problem you had).
In short, you're doing things the right way
As a somewhat funny sidenote, the developers of Visual Studio 2005 and .NET 2.0 promised for a long time "XHTML 1.1 compliance by default" from ASP.NET 2.0 output. That is, until they realized that to be XHTML 1.1 compliant, they'd have to make IIS serve it as application/xhtml+xml - which would make everything done in Microsoft's own development tool unviewable in Microsoft's own browser
So they settled with XHTML 1.0.
I thought that embed was for like... Macs? I know there's some type of browser that needs it.
Or am I crazy?
If you are dying to use embed use the javascript equivalent then...
| Marston wrote: |
I thought that embed was for like... Macs? I know there's some type of browser that needs it.
Or am I crazy? |
There's no modern browser that needs <embed>. Netscape introduced the <embed> tag about a decade ago. Shortly after, Microsoft introduced the <object> tag (since it was the time of browser wars). W3C decided on the <object> tag. Understandably, since - unlike <embed> - <object> does plugin parameters in a proper, extensible way. Strangely, IE today is the browser that has the worst support for the W3C standard of the element IE itself introduced
All that said, while Mozilla, IE, Safari, Konqueror, Opera all support <object>, none of them are without problems - either in terms of specific features (like fallback mechanisms for alternate content), or in terms of certain plugins behaving erratically when only included using <object> (Flash is one example, where a plain, standards-compliant <object>-tag won't allow Flash to stream content).
Also, any static <object> element which uses an ActiveX-component in IE - and that means Flash, Shockwave, QuickTime, Windows Media Player etc. etc., will get the "Click to activate this content" issue with the latest updates from MS. The best support is made by, as yjwong hints at, inserting the content through an external JS script, and possibly alternating between embed and object depending on the specific browser making the request. SWFObject (formerly FlashObject) is good for that
Most such scripts (including SWFObject) don't work when serving your page as application/xhtml+xml, however, since they tend to use innerHTML and document.write, which aren't supported in XML. Same reason that Google Maps etc. can't be used on pages served as XML.
Also, using <embed> at all in an XHTML page - by way of javascript - is just a hack. While the page will validate (only because the validator doesn't execute javascript
), it isn't really standards compliant XHTML, no matter what people may want to think
Basically, it's sheer luck that it works, since the browser really should throw out errors when trying to add invalid elements to the DOM.
One last thing... I'm still having trouble displaying correctly in IE or at least IE6. I'm pretty sure I'm going to have to use css hacks or something to get it to look right in IE but I'd rather not if I don't have to, they seem kind of complicate (some of them) and I'm trying to keep my css as simple as posible. If any of you have any alternate solutions I would love to hear them.
Thanks,
Codeman
| codeman wrote: |
One last thing... I'm still having trouble displaying correctly in IE or at least IE6. I'm pretty sure I'm going to have to use css hacks or something to get it to look right in IE but I'd rather not if I don't have to, they seem kind of complicate (some of them) and I'm trying to keep my css as simple as posible. If any of you have any alternate solutions I would love to hear them.
Thanks,
Codeman |
Well, a lot of the remaining issues are due to you using CSS-selectors which aren't supported in IE6 (they will be in IE7):
element + element
element > element
The :target pseudo-class.
While those are nice, you can do without them. I'd think (without looking closely at your source), that you can replace
with
... and get the same result. The > simply indicates that only immediate children, and not "grandchildren" are covered by this rule. A simple space indicates that any descendants are covered.
Replace :target with simply using an actual class name for such targets (or do without them).
Oh, and you're missing a "." or "#" before "warning" in one of the first rules:
| Code: |
dt, warning, a:link, a:visited, a:hover
{
color: #FFCC00;
} |
So, what about a browser detection script, and change the content based on that? I found one that looks pretty good. Seems to work for at least detecting the defference between IE6 and my Firefox (having the script redirect to another folder if the browser is IE else display current page) when I get it fully set up, it will have a version for IE that works (and maybe looks) differently.