Jump to content

<P id>tag for Flash reference won't validate w/W3C - need alt.

Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

<P id>tag for Flash reference won't validate w/W3C - need alt. Rate Topic: -----

#1 User is offline   Alcivar 

  • W.R. Private
  • Group: Members
  • Posts: 8
  • Joined: 16-April 07
  • Location:NY

Posted 04 May 2007 - 03:03 PM

I need an alternative or workaround etc for the following code which W3C gives me an error and won't validate the page:

<td align="center" width="550" height="440" valign="top"><h1>
<img src="images/spacer.gif" width="500" height="3" alt="">
<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
&lt;script type="text/javascript">
var s1 = new SWFObject("video/flvplayer.swf","single","480","292","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("file","BLTrailer_Medium.flv");
s1.addVariable("image","preview.jpg");
s1.addVariable("autostart","true");
s1.write("player1");
</script>
<img src="images/spacer.gif" width="500" height="70" alt="">
</h1></td>


W3C won't allow the <p id>. They say "document type does not allow element "P" here; missing one of "APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag ."

I guess it has something to do with the <h1> tag I created for a background image which shows behind the Flash movie which in the style in the header is:
h1 {background-image: url('images/screen_bg_immedium.jpg'); background-repeat: no-repeat; background-position: top;
}


I don't know how to get around this and still keep my bg image. Any suggestions would be appreciated.
Thanks.

You can check out the page at: http://www.idriveinm...iler_medium.htm

This post has been edited by Alcivar: 04 May 2007 - 11:29 PM

0

#2 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 04 May 2007 - 03:31 PM

The easiest fix is to replace the <h1></h1> with a <div></div>, because a <p> element is allowed inside a <div>.
0

#3 User is offline   Ryan Fait 

  • W.R. Sergeant
  • Group: Members
  • Posts: 204
  • Joined: 07-January 07
  • Location:Las Vegas

Posted 04 May 2007 - 04:25 PM

Not to mention it's semantically incorrect to do that. Why would you stick a paragraph inside of a header? That's like a newspaper printing all of its articles in the same size font as the title.
The commercial front for my freelance web design company.
0

#4 User is offline   James Mitchell 

  • Legendary
  • Group: Administrators
  • Posts: 922
  • Joined: 26-July 06
  • Gender:Male
  • Location:Fort Wayne, IN

Posted 04 May 2007 - 08:11 PM

Yeah it doesn't make sense to do that, but Marc's suggestion will fix your "validation" problem.
Posted Image
0

#5 User is offline   Alcivar 

  • W.R. Private
  • Group: Members
  • Posts: 8
  • Joined: 16-April 07
  • Location:NY

Posted 04 May 2007 - 08:15 PM

Yup, replacing the <h1> with the <div> did the trick!
Thank you oh guru of code! :notworthy:

Webradiance is turning out to be a great resource!
0

#6 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 04 May 2007 - 11:30 PM

While I don't want to downplay :wr: being a great resource (because it is, and always will be), swapping a <h1> for a <div> doesn't make me a guru :blushing:
0

#7 User is offline   Alcivar 

  • W.R. Private
  • Group: Members
  • Posts: 8
  • Joined: 16-April 07
  • Location:NY

Posted 05 May 2007 - 09:04 AM

View Postherkalees, on May 5 2007, 12:30 AM, said:

While I don't want to downplay :wr: being a great resource (because it is, and always will be), swapping a <h1> for a <div> doesn't make me a guru :blushing:

Well, yes, perhaps I went overboard with that one. I'm just grateful. My knowledge, even of the lowly html code is limited and I haven't use the block-level <div> tag too much as you can see.
When I used the <h1> tag to command a bg image I wasn't thinking of "header" and I'm not sure if using the <div> tag the way I did was even advisable except for the unique way in which it solved my particular problem. Since the <div> tag is now described in the CSS style in the header, does that make it unusable in other ordinary circumstances on the webpage if I needed it?

Excuse me if I sound completely ignert! :rolleyes1:
0

#8 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 05 May 2007 - 09:52 AM

View PostAlcivar, on May 5 2007, 10:04 AM, said:

Since the <div> tag is now described in the CSS style in the header, does that make it unusable in other ordinary circumstances on the webpage if I needed it?

Well, if you give the <div> tag a unique ID, for instance, then you can aim style meant only for that div directly to it.

In your HTML:
<div id="headerArea">
...content...
</div>

In your CSS:
div#headerArea {
property: value;
}
0

#9 User is offline   Alcivar 

  • W.R. Private
  • Group: Members
  • Posts: 8
  • Joined: 16-April 07
  • Location:NY

Posted 14 May 2007 - 08:59 PM

View Postherkalees, on May 5 2007, 10:52 AM, said:

Well, if you give the <div> tag a unique ID, for instance, then you can aim style meant only for that div directly to it.

In your HTML:
<div id="headerArea">
...content...
</div>

In your CSS:
div#headerArea {
property: value;
}


Understood. Thanks again!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users