Your HostICan Community  


Go Back   Your HostICan Community > Programming & Design > HTML / Design

HTML / Design Are you a designer? Or just trying to become one? Great! You'll be able to talk about layouts, and HTML code to help your fellow designers, so everyone can work together to master the tricks of the trade. (Maybe even some JavaScript too!)

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-11-2009, 01:23 PM
ikon ikon is offline
Junior Member
 
Join Date: Mar 2009
Posts: 3
Default auto size background image in my hosting

How can I put a picture as background and resize it depending of the resolution of the browser visitors? Does anyone know how to do this?
Reply With Quote
  #2  
Old 06-11-2009, 02:13 PM
cech's Avatar
cech cech is offline
Member
 
Join Date: Feb 2009
Posts: 83
Default Re: auto size background image in my hosting

HTML is not sufficiently expressive language to make this code. For this you will need CSS. Make the following files:
-test.html
HTML Code:
<html>
<head>
    <title>My resizable background test page!</title>
    <link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
    <div id="content">
        <h1>Hello world!</h1>
    </div>       
    <img id="imgBackground" src="background.gif">
</body>
</html>
-background.gif

-styles.css
HTML Code:
#content {
    position:    absolute;
    z-index:    5;
}
#imgBackground {
    position:    absolute;
    z-index:    1;
    width:        100%;
}
Field id = "content" contain all html code at the page itself. To be able to put picture as background use z-index. Image accordingly receive lower z-index compared to the field code. It remains only to make the picture 100% of the width of the body element.
Reply With Quote
Reply

Tags
auto, background, hosting, image, size

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:46 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Copyright © 2003 - 2008 HostICan. All Rights Reserved.