Jump to content

Why (margin-top:-302px) Can't Display On Ie But Work With Firefox Needhelp


lovekit
 Share

Recommended Posts

Sorry if I used wrong or bad Language. that because my english skill is pretty bad.if I used some bad word or hard to understand Please forgive me I don't intend-----------------------------------------------------------------------------------------------this is my problemfirst I'll show you my codethis is body tag and its options

<body style="font-family:tahoma" topmargin=0 leftmargin=0 bgcolor=#ffffff  background="/a/pic/bg_writer2.gif" id="pagediv">

,which I can't edit it myselfbecause I use one of free space web hostingbut I have permission to edit the CSS fileso I made this

<style type="text/css">body {margin-top:-302px; position:absolute;}</style>

to lift up the page that have my journal which I want to hide it out until I write it completely.it's workweb browser which I use is Firefoxbut any one who use IE can't see anything changeso I test it my self with IE ver 6,7,8and yes, it don't workhow can I fix my problem?please tell meThanksps. I had spend my time all 3 day ago with website http://www.w3schools.comand I try to read all of content about

 [CSS] [xml] and [php]but I can't find the way to fix my problem (so CRY)
Link to comment
Share on other sites

Firstly, I would suggest you search for a better webhost, it is very hard to develop without full controll over your entire code. If the webhost does not permit modification of that body tag, it would definitely limit what you can do. No stylesheet can overrule the style attribute for instance.However, secondly, I would not reccommend positioning the body. It seems only logical to me that it should not work, as the body representsw the content of the webpage, which is tipically the browser itself. Some sollutions you may like to consider:- If you want to position something, try using another element that you place inside the body, a div for example. You can apply any style on it, whatever limitation was placed on the page by your host.- If the removal of some content from view is what you want, you could simply place it in comments too.- If you want to automatically scroll the page the hide something instead, you could use the javascript "scrollBy()" method for the document if you know howmany pixels the content is viewed in.Whatever choice you choose, it is a good practice to use a better webhost that enables you to fully manage your pages, instead of limiting what you can edit. There are so many services to find, one better that the other, both paid and free, that support loads of features that you, as a developer, would appreciate. Like FTP support, instead of editing online (for the advanced developer). If I may reccommend a good webhost (free, no ads, 100MB storage, FTP & PHP & MySQL support), take www.dhost.info.

Link to comment
Share on other sites

Your body tag styles also have several syntax errors. Declare all your styles at once, in the same set of quotes:<body style="font-family: tahoma; background: #fff url(/a/pic/bg_writer2.gif); margin-left: 0; margin-top: 0;">Note that it's margin-left, margin-top and not leftmargin and topmargin. Also, as Jack said, you shouldn't be positioning the body that way. You should have a look at the CSS tutorials, too.

Link to comment
Share on other sites

And to take it a step further, note that the best way of styling your elements would be using a stylesheet, of which you would learn all about in the tutorials. Not even noting the attributes that you cannot modify on your body element, are just in HTML format, not complying to the Xhtml syntax.

Link to comment
Share on other sites

Thanks you allI have tried so I was tiredwith this free web hostingI can't coding all page by my selfbut only edit CSS fileI don't know why they restrict :) ?maybe Finding a new host is best choice like you said, Jack :) Q chibineku: I knew how to use margin under <body> tagbut that line of body tag is set from host and I can't edit it directly :) I only can Edit CSS and XML file (external files)so this is questionscan I replace this tag

<body style="font-family:tahoma" [color="#FF8C00"]topmargin=0 leftmargin=0[/color] bgcolor=#ffffff  background="/a/pic/bg_writer2.gif" id="pagediv">

using CSS stylesheet(the BODY tag has ID="pagediv")can I edit by

<style type="text/css">#pagediv {style="font-family: tahoma; background: #ffffff url(/a/pic/bg_writer2.gif); margin-left: 0; margin-top: 0;"}</style>

last Question: Whare can I find information about "The Difference of code&attrib to make the same look on IE&Firefox"for eg. in some website you can see many feature& thing todo But not in IEHave any site make its index

Edited by lovekit
Link to comment
Share on other sites

Ofcource you can apply style to the body using the ID, but unfortunately not all styles can be overruled that way. Inline style has precedance over stylesheet, but those topmargin etc. attributes on the body tag are deprecated so I cannot tell if they can be overruled by it.The best way to solve all this and future problems, is to migrate to another host. As a beginning developer, you mustn't be limited to some idiotic rules of a webhost like this. There are loads out there, though the best are really hidden between the lot. So I can reccomend Dhost in the above link, which does not limit at all, and gives you loads of features for free as well. You should try it out (it may take a little time before your appication gets reviewed, as this is done manually there).Oh, yeah, advertising the webhost I too use.. :)

Edited by Jack McKalling
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...