hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Design and Content : 3 columns AND resizing background image ??
Reply

Web Design and Content Subjects include, HTML, graphics, editors, CSS, Flash, graphics creation, placing of ads, ad serv companies, copyright, content and nearly anything else design related. Also talk about businesses that provide design services. If you link to your site, you must post in Web Site Reviews.
Forum Jump

3 columns AND resizing background image ??

Reply Post New Thread In Web Design and Content Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 07-29-2008, 01:15 PM
expatCanuck expatCanuck is offline
WHT Addict
 
Join Date: Oct 2007
Location: New England
Posts: 145

3 columns AND resizing background image ??


Greetings -

There are plenty of templates/sites/tutorials/examples that advise how to create a 3-column site with a header & footer. (e.g. - http://css-discuss.incutio.com/?page=ThreeColumnLayouts)


There are also some sites (tho' considerably fewer) that advise how to have a background image automagically resize according to the size of the browser window. The key seems to be to specify the following bit in the "<div style=" definition:

<img src="myImageHere.jpg" width="100%">

specifying the width, but NOT the height (so that the image height can resize according to the browser window size).

But -- has anyone seen or built a layout which will allow a single resizing background image ACROSS THE ENTIRE PAGE, but also have the 3 columns (ideally percentage-based (say 20/60/20), and ideally with a header & footer)?

If so, can you point me towards an example? -- 'cause that's what I'd really like to do.

Thanks kindly,

- Richard

Reply With Quote


Sponsored Links
  #2  
Old 07-30-2008, 09:20 AM
Yawp Yawp is offline
Junior Guru Wannabe
 
Join Date: Jul 2008
Location: Australia
Posts: 73
Hi expatcanuck,

If I understand you correctly, you are trying to have a background image fit to 100% of the screen, with three columns over the top.

If that’s the case you need to create a 1x1 table at 100% width and place the background image in that…then nest a 3 column table inside (without a background image). This method is also used to keep the content central on the page.

Hope that helps.

__________________
Yawp domains USA | UK | AUST
|| 24/7 Support - Unmatched Reliability - Redundancy
|| Web/Email Hosting - Managed DNS - Domain Names
|| Business Solutions - Web Design Support - 24/7 Monitoring

Reply With Quote
  #3  
Old 07-30-2008, 10:10 AM
expatCanuck expatCanuck is offline
WHT Addict
 
Join Date: Oct 2007
Location: New England
Posts: 145
Yawp -

Thanks. I think that's what I've managed to do here by merging what I found here:
http://matthewjamestaylor.com/blog/perfect-3-column.htm


with what I found here:
http://css-tricks.com/how-to-resizeable-background-image/



and created the following, which is a reasonable start. Not elegant, but workable (at least on IE6 and Firefox2, which are all I have handy right now):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>blah</title>
<meta name="Author" content="writer" />
<meta name="Keywords" content="whatever" />
<meta name="Description" content="yadda yadda" />
<meta http-equiv="imagetoolbar" content="no" />
<style type="text/css">
html, body {margin:0; padding:0; width:100%; height:100%; overflow:hidden;}
body {font-family:verdana, arial, sans-serif; font-size:70%; color: white;}
#background{position:absolute; z-index:1; width:100%; }
#scroller {position:absolute; width:100%; height:100%; top:0; left:0; overflow:auto; z-index:2;}

p {line-height:1.8em; letter-spacing:0.1em; text-align:left;}
#layoutdims {
clear:both;

border-top:4px solid #000;
margin:0;
padding:6px 15px !important;
text-align:right;
}
/* column container */
.colmask {
position:relative;/* Fixes the IE7 overflow hidden bug */
clear:both;
float:left;
width:95%;/* almost width of whole page (avoid horizontal scrollbar */
overflow:hidden;/* chop off overhanging divs */
}

/* common column settings */
.colright,
.colmid,
.colleft {
float:left;
width:100%;/* width of page */
position:relative;
}
.col1,
.col2,
.col3 {
float:left;
position:relative;
padding:0 0 1em 0;/* no left or right padding on columns; just made narrower */
/* only top and bottom padding */
overflow:hidden;
}
/* 3 Column settings */
.threecol {
}
.threecol .colmid {
right:25%;/* width of the right column */
}
.threecol .colleft {
right:50%;/* width of the middle column */

}
.threecol .col1 {
width:46%;/* width of center column content (column width minus side padding) */
left:102%;/* 100% plus left padding of center column */
}
.threecol .col2 {
width:21%;/* Width of left column content (column width minus padding on either side) */
left:31%;/* width of (right column) */
/*plus (center column left and right padding) */
/*plus (left column left padding) */
}
.threecol .col3 {
width:21%;/* Width of right column content (column width minus padding on either side) */
left:85%;/* Please make note of the brackets here:*/
/* (100% - left column width) */
/*plus (center column left and right padding)*/
/*plus (left column left and right padding) */
/*plus (right column left padding) */
}

</style>
</head>
<body>
<div>
<img id="background" src="yourImageHere.jpg" alt="" imgTitle="" />
</div>
<div id="scroller">
<div id="content">
<div class="colmask threecol">
<div class="colmid">
<div class="colleft">
<div class="col1">

<!-- Column 1 start -->
<h4>Column 1</h4>
<p>c1 text here</p>
<h4>Meanwhile, back at the ranch ...</h4>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Nam fermentum pulvinar nibh. Vivamus eu leo. Sed facilisis,
odio sed mattis sagittis, nunc ante fermentum erat,
at volutpat nisl pede fringilla nisl.</p>
<p>Yadda, yadda, yadda ...</p>
<!-- Column 1 end -->
</div>
<div class="col2">
<!-- Column 2 start -->
<h4>Column 2 (left)</h4>
<p>c2 text here</p>
<!-- Column 2 end -->
</div>
<div class="col3">
<!-- Column 3 start -->

<h4>Column 3</h4>
<p>c3 text here</p>

<!-- Column 3 end -->
</div>
</div>

</div>
</div>

</div>
</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-451410-1";
urchinTracker();
</script>
</body>

</html>

Cheers.

- Richard

Reply With Quote
Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted
eTail West 2013 Web Hosting Events 2013-02-01 10:35:53
Customer Feature: How EdgeCast Delivers One Billion Imgur Images Each Day Web Hosting News 2012-05-31 12:22:36
5 Popular Site Builders for Web Hosts Web Hosting News 2012-02-23 15:46:58
A First Look at cPanel’s new User Interface Web Hosting News 2011-09-15 19:35:40
Web Host SoftLayer Launches Public Image Repository for Cloud Templates Web Hosting News 2011-06-08 14:56:19


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?