Quizzes & Puzzles37 mins ago
HTML query
6 Answers
i recently started learning html. i've almost learned everything except back ground image. this is how i do it
<body background="filename.gif">
is it wrong. because its not working for me. i see an image then right click and then "save picture as" and then i save the pic as it is. i write filename.gif in the "file name" box. please someone tell me what am i doing wrong. and if my saving technique is wrong then what is the right way. and where can i find website with nice gif images . thaaaaaannnnnnnkkkk you in advance.
<body background="filename.gif">
is it wrong. because its not working for me. i see an image then right click and then "save picture as" and then i save the pic as it is. i write filename.gif in the "file name" box. please someone tell me what am i doing wrong. and if my saving technique is wrong then what is the right way. and where can i find website with nice gif images . thaaaaaannnnnnnkkkk you in advance.
Answers
Best Answer
No best answer has yet been selected by arianas. Once a best answer has been selected, it will be shown here.
For more on marking an answer as the "Best Answer", please visit our FAQ.It's technically correct, but it's the wrong way to do it.
HTML is for structure, but early on (and it seems you've been reading a tutorial that is of this era), it was used for styling too.
Really, it should work like this (imagine layers of a cake):
Presentation
---------
Scripting
---------
Structure
The structure layer is the basic layer, written in HTML. Use it only for saying what parts of the page are what. i.e., This is a heading, this is a sub-heading (H1 and H2 respectively), this is a division of the page, this is a list, this is a paragraph, etc. Right now the page is just basic fonts, black and white and plain. No alignment of text or anything.
Then use the scripting layer (JavaScript) if you want, to do other fancy things. This isn't required.
Then, you use CSS for the presentation layer. This is everything to do with moving parts of the page around, to put the site links on the side for example, as well as colour, backgrounds, etc.
Put this in your HTML at the top, in the HEAD section:
<style type="text/css">
html {background: url(filename.gif);
</style>
HTML is for structure, but early on (and it seems you've been reading a tutorial that is of this era), it was used for styling too.
Really, it should work like this (imagine layers of a cake):
Presentation
---------
Scripting
---------
Structure
The structure layer is the basic layer, written in HTML. Use it only for saying what parts of the page are what. i.e., This is a heading, this is a sub-heading (H1 and H2 respectively), this is a division of the page, this is a list, this is a paragraph, etc. Right now the page is just basic fonts, black and white and plain. No alignment of text or anything.
Then use the scripting layer (JavaScript) if you want, to do other fancy things. This isn't required.
Then, you use CSS for the presentation layer. This is everything to do with moving parts of the page around, to put the site links on the side for example, as well as colour, backgrounds, etc.
Put this in your HTML at the top, in the HEAD section:
<style type="text/css">
html {background: url(filename.gif);
</style>