/    Sign up×
Community /Pin to ProfileBookmark

Position trouble

Hello, I know this is not Javascript forum, but read this code:

[CODE]<html>
<title>Menú Ivanzinho</title>
<style type=”text/css”>
.submenu{visibility:hidden; position:absolute; border:solid; border-width:1px; border-color:black;}
.menu{border:solid; border-width:1px; border-color:black;}
body{font-family:Verdana; font-size:12px; cursor:default; color:#0033FF}
</style>

<script language=”javascript”>
function muestra(submenu,interruptor){
objeto = document.all(submenu)
if(interruptor>0)
objeto.style.visibility = ‘visible’
else
objeto.style.visibility = ‘hidden’
}

</script>
<body>
<!–este es el menú–>
<table class=”menu” onMouseOver=”muestra(‘ivan’,1)” onMouseOut=”muestra(‘ivan’,0)”><tr><td>Pase por encima de esto</td></tr></table>

<!–este es el submenú–>
<table id=”ivan” class=”submenu” onMouseOver=”muestra(‘ivan’,1)” onMouseOut=”muestra(‘ivan’,0)” style=”LEFT: 13px; TOP: 33px”>
<tr>
<td height=”23″>Lo que hay que mostrar</td>
</tr>
</table>
</body>
</html>[/CODE]

This code runs ok, but when I upload to host server, this includes a code like this

[CODE]</noscript>
<div style=”text-align: center;”><div style=”position:relative; top:0; margin-right:auto;margin-left:auto; z-index:99999″>
Hosting por www.buensitio.info
</div></div>[/CODE]

The problem is in the property “position”, when I delete the tag “style” on the “<div>” the problem is solved, but, ¿I can’t use “position” property on twice tags?

Thank you for your time

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@paulkoanFeb 14.2008 — Are you saying that someone else is adding code when you upload?

You didn't actually describe the problem you are getting the position attribute is there, versus when it is not there.
Copy linkTweet thisAlerts:
@IvanzinhoauthorFeb 14.2008 — Are you saying that someone else is adding code when you upload?

You didn't actually describe the problem you are getting the position attribute is there, versus when it is not there.[/QUOTE]

Yes, when I upload "index.html" which has it code, this is modified like this:

[CODE]<html>
<title>Men&#250; Ivanzinho</title>
<style type="text/css">
.submenu{visibility:hidden; position:absolute; border:solid; border-width:1px; border-color:black;}
.menu{border:solid; border-width:1px; border-color:black;}
body{font-family:Verdana; font-size:12px; cursor:default; color:#0033FF}
</style>

<script language="javascript">
function muestra(submenu,interruptor){
objeto = document.all(submenu)
if(interruptor>0)
objeto.style.visibility = 'visible'
else
objeto.style.visibility = 'hidden'
}

</script>
<body>
<!--este es el men&#250;-->
<table class="menu" onMouseOver="muestra('ivan',1)" onMouseOut="muestra('ivan',0)"><tr><td>Pase por encima de esto</td></tr></table>

<!--este es el submen&#250;-->
<table id="ivan" class="submenu" onMouseOver="muestra('ivan',1)" onMouseOut="muestra('ivan',0)" style="LEFT: 30px; TOP: 25px">
<tr>
<td height="23">Lo que hay que mostrar</td>
</tr>
</table>
</body>
</noscript>
<div style="text-align: center;"><div style="position:relative; top:0; margin-right:auto;margin-left:auto; z-index:99999">
Hosting por www.buensitio.info
</div></div>
</html>[/CODE]


And the trouble is submenu runs ok before uploading host server on, I like to say, when the mouse is over, submenu remains visible , but when I upload the file, submenu hides when the mouse pass over it.

I solve this problem removing the tag "style" on de <div>, but when I upload again the file, host server add the code, I don&#180;t know what to do for solve this.
Copy linkTweet thisAlerts:
@paulkoanFeb 14.2008 — What are you using to upload the code?
Copy linkTweet thisAlerts:
@IvanzinhoauthorMar 04.2008 — I'm using a FTP client, is this what you ask me?
Copy linkTweet thisAlerts:
@paulkoanMar 04.2008 — When you say the code is added, do you mean that if you look at the file, the extra lines are there once it is uploaded, or when you view the source in a browser?

I suspect the latter, so this is just the host added their code as the page is displayed. But then you say you can remove the code - so I guess you are downloading it, modifying and testing it, and then uploading it only to have the host put the code back.

But you also say "position" is used twice, where it is only used once. So it isn't clear how you are testing this.

This is one of the downsides of using a free or cheap hosting provider. They reserve the right to advertise on your pages, which will change your code, and so change its behaviour.
Copy linkTweet thisAlerts:
@IvanzinhoauthorMar 05.2008 — When I upload "index.html" extra line are added to this file, for this reason, the code I've posted on this thread does not run.
×

Success!

Help @Ivanzinho spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...