PDA

View Full Version : Aligning .swf file to top middle.


GTB
10-09-2009, 12:52 PM
I wonder if anyone can help me.

I am trying to get my games pages to automatically put the games (.swf) into the top centre of my page underneath the header for which I am using "includes".

I normally have to do this by putting lots of <p>&nbsp;</p> under each game.

The problem is that it never looks the same in firefox as it does in I.E as well as being time consuming.

I have tried putting in tables (Most of the games on my site are inside tables) but it doesn't seem to do anything if I align them to the top.

I did try to post the code I am using but the code tags aren't working for me for some reason.

My test page is here, http://www.thegtb.co.uk/666.php and as you will see the game needs to go up further, ideally so the top of it is in line with the red forum link on the left.

Many Thanks

Corrosive
10-09-2009, 01:15 PM
You could try taking out all the superfluous opening and closing head, html and body tags. That might help ;)

domedia
10-09-2009, 01:22 PM
The best advice I think I can give you on this point is to study regular web design for a bit. Your design should be driven by CSS.

Never use empty paragraphs to create space, this makes no sense.

Tables are mean for tabular data, not a way of designing your website.
Right now I am surprised your page displays at all. You got two -2 - body tags and stuff between your head and body.

You seem to have the site content and the interest to take it further. This is a perfect time to re-educate yourself. We've all been through it, and once you do, you will never look back again either 8)

GTB
10-09-2009, 01:32 PM
Many thanks for your replies.
As soon as I understand what the answers mean I will act on them.
I would dearly love to learn more about it all but unfortunately I just haven't got the time.
It is only a hobby that gets me away from watching rubbish on T.V. but I do enjoy thinking of things for the website then seeing if I can put my ideas in practice.
As you can see though, I am very much an amateur.
I will struggle on nonetheless !

Strange about the body tags.
This is what I see in dreamweaver:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The {GTB} Clan</title>
</head>
<body>
<table width="100%" border="0">
<tr>
<td colspan="3"><div id="header"><?php include("includes/header.php"); ?></div>&nbsp;</td>
</tr>
<tr>
<td><div id="left"><?php include("includes/left_links.php"); ?></div>&nbsp;</td>
<td><div id="main"><script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="700" height="800" align="top" id="FlashID">
<param name="movie" value="Games/ablast.swf">
<param name="quality" value="high">
<param name="wmode" value="opaque">
<param name="swfversion" value="6.0.65.0">
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="Scripts/expressInstall.swf">
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object data="Games/ablast.swf" type="application/x-shockwave-flash" width="700" height="800" align="top">
<!--<![endif]-->
<param name="quality" value="high">
<param name="wmode" value="opaque">
<param name="swfversion" value="6.0.65.0">
<param name="expressinstall" value="Scripts/expressInstall.swf">
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
</td>
<td><div id="right"><?php include("includes/right_links.php"); ?></div>&nbsp;</td>
</tr>
<tr>
<td colspan="3"><div id="header"><?php include("includes/bottom.php"); ?></div></td>
</tr>
</table>
</body>
</html>

I assume that the extra body tags come from the includes.

Corrosive
10-09-2009, 01:53 PM
If they are in your includes files then take them out. You just need the bare minimum code in your includes files. None of the automatic DW stuff.

GTB
10-09-2009, 01:54 PM
Many thanks i will try that now.

GTB
10-09-2009, 02:04 PM
No I'm afraid that didn't work either, unless I missed some.

I will keep looking.

domedia
10-09-2009, 02:15 PM
Strange about the body tags.
This is what I see in dreamweaver: Check in the browser, it's the only place that matters.

GTB
10-09-2009, 05:35 PM
I have deleted everything I can think of with this and still the same problem.

I may be heading down the road to pay for Corrosives services soon I think !

Corrosive
10-09-2009, 08:07 PM
I have deleted everything I can think of with this and still the same problem.

I may be heading down the road to pay for Corrosives services soon I think !

Things can't possibly have got THAT bad! Lol

GTB
10-11-2009, 05:27 PM
Hehe, It would seem they have.

I have tried cleaning up everything I can think of with no success.

I am sure this must be a simple issue for someone that knows what they are doing but my tired old brain just wont find the solution for me.

edbr
10-12-2009, 02:29 AM
sorry not yet you havent, on line 4698 you repeat the body tag, make sure you have one only , move the scripts into the head section and the menu table into the body section.
you have the flash set at mode opaque im really am not sure but try using transparent instead

edbr
10-12-2009, 02:31 AM
these errors showing on html inspector
Result: 0 errors / 37 warnings

line 37 column 1 - Warning: <style> isn't allowed in <div> elements
line 10 column 21 - Info: <div> previously mentioned
line 64 column 9 - Warning: discarding unexpected <body>
line 97 column 1 - Warning: discarding unexpected <body>
line 104 column 195 - Warning: <img> element not empty or not closed
line 107 column 170 - Warning: <img> element not empty or not closed
line 110 column 171 - Warning: <img> element not empty or not closed
line 113 column 168 - Warning: <img> element not empty or not closed
line 116 column 164 - Warning: <img> element not empty or not closed
line 119 column 174 - Warning: <img> element not empty or not closed
line 122 column 168 - Warning: <img> element not empty or not closed
line 125 column 170 - Warning: <img> element not empty or not closed
line 128 column 168 - Warning: <img> element not empty or not closed
line 131 column 175 - Warning: <img> element not empty or not closed
line 134 column 166 - Warning: <img> element not empty or not closed
line 137 column 171 - Warning: <img> element not empty or not closed
line 140 column 172 - Warning: <img> element not empty or not closed
line 254 column 9 - Warning: missing </div>
line 287 column 42 - Warning: <img> element not empty or not closed
line 290 column 42 - Warning: <img> element not empty or not closed
line 293 column 42 - Warning: <img> element not empty or not closed
line 296 column 42 - Warning: <img> element not empty or not closed
line 299 column 42 - Warning: <img> element not empty or not closed
line 302 column 42 - Warning: <img> element not empty or not closed
line 305 column 42 - Warning: <img> element not empty or not closed
line 311 column 42 - Warning: <img> element not empty or not closed
line 317 column 42 - Warning: <img> element not empty or not closed
line 320 column 106 - Warning: unescaped & or unknown entity "&u"
line 320 column 128 - Warning: <img> element not empty or not closed
line 323 column 42 - Warning: <img> element not empty or not closed
line 326 column 42 - Warning: <img> element not empty or not closed
line 329 column 42 - Warning: <img> element not empty or not closed
line 468 column 1 - Warning: discarding unexpected <body>
line 470 column 143 - Warning: <img> element not empty or not closed
line 65 column 65 - Warning: <a> escaping malformed URI reference
line 99 column 3 - Warning: <table> attribute "align" has invalid value "top left"
line 282 column 3 - Warning: <table> attribute "align" has invalid value "top right"
line 439 column 21 - Warning: <div> anchor "header" already defined
Info: Doctype given is "-//W3C//DTD XHTML 1.0 Transitional//EN"
Info: Document content looks like XHTML 1.0 Transitional

GTB
10-12-2009, 11:17 AM
Thankyou very much that will be very helpful.

I suppose the problem I am having is that because I am using the includes, then the html when the source is viewed is different to how it is shown when I view it in dreamweaver.

Can I ask what html inspector you are using as I can't seem to find one in dreamweaver.

edbr
10-12-2009, 11:20 AM
its a firefox plugin

GTB
10-12-2009, 03:09 PM
OK

What's it called ?

edbr
10-13-2009, 01:29 AM
html validator

GTB
10-13-2009, 11:33 PM
Thankyou for that.

Well I have been having lots of fun.

I have used the html validator and had a look.

I had 180 errors and 3 warnings.

Oh dear !

So being the canny lad I am, I took a backup of my includes and then started to follow some of the corrective advice that the validator suggested. i.e closing image tags with > instead of />
(Which, I might add, Dreamweaver put there automatically)

Well would you believe it, I now have 475 errors and 3 warnings.

Well that's no problem I thought, I will just put back in the old includes and have another go.

Oh no, not on Dreamweavers Nelly !

I have put the old includes back and am now still getting 475 errors and 3 warnings showing !

I have not the words !

http://www.thegtb.co.uk/storage/sisko.gif

I should point out that it is my index page I am talking about now, not any of my test pages.

GTB
10-14-2009, 01:32 AM
OK well I don't want to double post but I feel I need to in this case.

I'm not quite sure what happened there but I have sorted quite a few things out now, and I suppose I enjoyed the rant.

I am now down to 43 errors which has made me feel a whole lot better.

Even Google has 41.

There are some things though that just refuse to be fixed.

e.g The Validator says:Line 79, Column 67: Attribute "onMouseOut" is not a valid attribute. Did you mean "onmouseout"?

I went through all the on onMouseOut' and changed them all to onmouse out, I also did the same with onMouseOver to onmouseover.

Now......when I publish the page then look at the script again it magically reverts back to onMouseOut etc

Is there some kind of wizardry going on here that should not be, or is Dreamweaver trying to look after my best interests and correct errors automatically. ??

Whichever is the answer, HTML Validator doesn't like it !

There are many more that are puzzling me but I will try and sort them one by one.

I am DETERMINED to get that swf to align at the top, no matter how long it takes.

Corrosive
10-14-2009, 08:08 AM
I hate to say this but you'd be getting on a lot better if you'd just drop the tables and learn CSS/div based layout. Benjamin Sisko says it all when it comes to your code!

GTB
10-14-2009, 09:43 AM
Well I suppose that's true about anything.

If everyone knew CSS or HTML I would suspect this forum would not be the success it has become.

If I ring the Doctor they don't tell me to learn medicine !

I am now down to 29 errors showing on the page but it still doesn't help me with my original post.

I will percevere :wink:

Corrosive
10-14-2009, 09:49 AM
If I ring the Doctor they don't tell me to learn medicine !



They would if you were going to practice on yourself!

And this forum has become a success because we try to teach the correct methods. We offer help on CSS and you'll see a LOT of posts where we encourage members to learn it. If we just said 'carry on using tables' then we'd be down the tubes in a fortnight.

GTB
10-14-2009, 10:02 AM
I wasn't told that this wasn't possible with tables, just that css would be better.

I have no doubt that it is.

As I have said, I would love to learn CSS but I just haven't got the time so I was hoping that it was possible to achieve my objective using the little amount of knowledge that I have.

If it isn't possible using the methods I am currently using then it's no problem, I will work around it for now.

I was under the impression that it could be done, albeit not in the best way possible, by removing supurfluous tags etc.

I still dream of flying in the Red Arrows but I haven't got time to learn that either at the minute.

Corrosive
10-14-2009, 10:21 AM
Sheesh :roll:

Three things;

1. You could have learnt CSS in the time you have been messing about with tables and validators etc.

2. CSS saves you a lot of time further down the road. Especially for updates and adding new pages etc. Could you not invest the time now to save it later? 'stitch in time' and all that.

3. Are you actually enjoying owning and running a website? You should be by now but your frustrations seem to be boiling over to the point that you are equating learning to fly a Hawk T1 in death defying stunts to three weeks getting the basics of modern web design down.

I know I am a git sometimes but, hey, this is a forum and it is my opinion.

GTB
10-14-2009, 03:53 PM
My apologies, I didn't mean to sound as if I was being impatient, and I don't think you're a git, I appreciate the fact the people reply even if it's not what I want to hear.

I think you hit the nail on the head with "modern web design"

When I started some years ago I was using frontpage and I never knew that I had the need to learn anything like css because everything I tried looked as I wanted on the screen.

When I made the original post I just assumed that I might need to align something to the top or whatever.

If that isn't the case, as it would appear so, I will continue as I have for the time being, it isn't that much of a problem.

I'm sure CSS is the bees knees, but honestly I haven't got the time to learn it all, I have more pressing commitments, family, dogs, pub etc.

I love doing things on the site and it fills a creative void in my sad little life that nothing else can fill.

As for the Red Arrows, maybe in another life, until then I will have to make do with driving fire engines :(

Until then, I do appreciate the help and advice here.

GTB
10-15-2009, 03:11 PM
<td><div id="main">


to this:


<td valign="top"><div id="main">

Did the trick !

Corrosive
10-15-2009, 05:03 PM
<td><div id="main">


to this:


<td valign="top"><div id="main">

Did the trick !

Nice one GTB. Good work :)

edbr
10-16-2009, 01:59 AM
As for the Red Arrows, maybe in another life, until then I will have to make do with driving fire engines
and thank you for that