What is better HTML code for this
What is better HTML code :
case 1 :
<body bgcolor=" #000000" width="100%" height="100%">
</body>
case 2 :
<body>
<img src="black.jpg" width="100%" height="100%"/>
</body>
seems case 1 wins or css is best option Thanks. Sorry guys i have edited my question again.
Its like this :
What is better HTML code :
case 1 :
<body bgcolor="<!--Is there a color combination code for a photogr开发者_运维知识库aph/any css approach ?? -->" width="100%" height="100%">
</body>
case 2 :
<body>
<img src="your_photo.jpg" width="100%" height="100%"/>
</body>
Well, I am all this doing because image is too large in size and internet speed is very low.I guess twitter also does it when we set themes(not sure)
This is better:
<body>
...
</body>
and in an external CSS style:
body {
background: #000 url('black.jpg') no-repeat;
}
In general the css would be preferred for performance (its faster to load CSS than load an image).
The CSS would be faster, and would yield less wasted bandwidth on the hosting end for a high traffic site.
you can set background using CSS instead of loading images everytime into your HTML document, it will help in many cases
as you are using css you won't need to load the image everytime you can set an image background to any class while loading the page it won't load each time but it'll load the page and have the image as its background
<body> </body>
and in a CSS file(external) use
body
{
background-image: xx.jpg;
}
avoid using the tag for simplicity purpose use external CSS files to classify the CSS codes
and also avoid
this is totally horrendous when you have to style a very complex site, if you go on styling each and every element in the HTML code itself, at a later stage you'll have to start again from scratch!
精彩评论