fit to screen achtergrond combineren met 3 column holy grail.

Status
Niet open voor verdere reacties.

blackeagle67

Gebruiker
Lid geworden
13 okt 2009
Berichten
158
Waarschijnlijk is dan de pagina nog niet helemaal geladen :)
 
IDD verdorie.
Dat had ik zelf ook kunnen bedenken met een plaatje van 1mb als achtergrond :o
Bedankt:thumb:

Ik post de code ff snel die ik dan ga gebruiken.
Voor een school project gaan ik en een vriend een website in elkaar zetten voor z'n wow private server.
Ik wou graag deze 3 kolom layout met een fixed image gaan gebruiken.
iig bedankt.:p

HTML:
<!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-GB"> 
<head> 
	<title>The Perfect 3 Column Liquid Layout: No CSS hacks. SEO friendly. iPhone compatible.</title> 
	<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> 
	<meta name="description" content="The Perfect 3 Column Liquid Layout: No CSS hacks. SEO friendly. iPhone compatible." /> 
	<meta name="keywords" content="The Perfect 3 Column Liquid Layout: No CSS hacks. SEO friendly. iPhone compatible." /> 
	<meta name="robots" content="index, follow" /> 
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> 
	<style media="screen" type="text/css"> 
	/* <!-- */
	
	#scroller {
	position:absolute; 
	width:100%; 
	height:100%; 
	top:0; 
	left:0; 
	overflow:auto; 
	z-index:2;
	margin:0;
	padding:0;
	border:0;		
	}
	
	/* General styles */
	body {
		margin:0;
		padding:0;
		border:0;			/* This removes the border around the viewport in old versions of IE */
		width:100%;
		background:#fff;
		min-width:600px;		/* Minimum width of layout - remove line if not required */
						/* The min-width property does not work in old versions of Internet Explorer */
		font-size:90%;
		height:100%;
		overflow:hidden;
	}
	#background{
	position:absolute; 
	z-index:1; 
	width:100%; 
	height:100%;
	margin:0;
	padding:0;
	border:0;	
	}
	a {
		color:#369;
	}
	a:hover {
		color:#fff;
		background:#369;
		text-decoration:none;
	}
	h1, h2, h3 {
		margin:.8em 0 .2em 0;
		padding:0;
	}
	p {
		margin:.4em 0 .8em 0;
		padding:0;
	}
	img {
		margin:10px 0 5px;
	}
	/* Header styles */
	#header {
		clear:both;
		float:left;
		width:100%;
	}
	#header {
		border-bottom:1px solid #000;
	}
	#header p,
	#header h1,
	#header h2 {
		padding:.4em 15px 0 15px;
		margin:0;
	}
	#header ul {
		clear:left;
		float:left;
		width:100%;
		list-style:none;
		margin:10px 0 0 0;
		padding:0;
	}
	#header ul li {
		display:inline;
		list-style:none;
		margin:0;
		padding:0;
	}
	#header ul li a {
		display:block;
		float:left;
		margin:0 0 0 1px;
		padding:3px 10px;
		text-align:center;
		background:#eee;
		color:#000;
		text-decoration:none;
		position:relative;
		left:15px;
		line-height:1.3em;
	}
	#header ul li a:hover {
		background:#369;
		color:#fff;
	}
	#header ul li a.active,
	#header ul li a.active:hover {
		color:#fff;
		background:#000;
		font-weight:bold;
	}
	#header ul li a span {
		display:block;
	}
	/* 'widths' sub menu */
	#layoutdims {
		clear:both;
		background:#eee;
		border-top:4px solid #000;
		margin:0;
		padding:6px 15px !important;
		text-align:right;
	}
	/* column container */
	.colmask {
		position:relative;	/* This fixes the IE7 overflow hidden bug */
		clear:both;
		float:left;
		width:100%;			/* width of whole page */
		overflow:hidden;		/* This chops off any 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 and right padding on columns, we just make them narrower instead 
						only padding top and bottom is included here, make it whatever value you need */
		overflow:hidden;
	}
	/* 3 Column settings */
	.threecol {
		background:#eee;		/* right column background colour */
		/* for IE */
		  filter:alpha(opacity=80);
		  /* CSS3 standard */
		  opacity:0.8;
	}
	.threecol .colmid {
		right:25%;			/* width of the right column */
		background:#fff;		/* center column background colour */
	}
	.threecol .colleft {
		right:50%;			/* width of the middle column */
		background:#f4f4f4;	/* left column background colour */
	}
	.threecol .col1 {
		width:46%;			/* width of center column content (column width minus padding on either side) */
		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) */
	}
	/* Footer styles */
	#footer {
		clear:both;
		float:left;
		width:100%;
		border-top:1px solid #000;
	}
	#footer p {
		padding:10px;
		margin:0;
	}
	#header img { 
	padding: 0px; 
	display:block; 
	margin-left:auto; 
	margin-right:auto; 
	margin-top:0;
	margin-bottom:0;
	}
	/* --> */
	</style> 
</head> 
<body> 
<div> 
<img id="background" src="http://img12.imageshack.us/img12/3559/deathwing339.jpg" alt="" title="" /> 
</div>
<div id="scroller"> 
<div id="header"> 
	<img src="http://webpages.scu.edu/ftp/jhhoward/images/world-of-warcraft-logo.jpg" width="300px" height="200px" alt="" title="" />
	<p id="layoutdims">Lijn boven en onder tekst in de header</p> 
</div> 
<div class="colmask threecol"> 
	<div class="colmid"> 
		<div class="colleft"> 
			<div class="col1"> 
				<!-- Column 1 start --> 
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				INHOUD<br />
				lengte van de kolommen past zich aan aan de inhoud
				<!-- Column 1 end --> 
			</div> 
			<div class="col2"> 
				<!-- Column 2 start --> 
				<!-- Column 2 end --> 
			</div> 
			<div class="col3"> 
				<!-- Column 3 start --> 
				<!-- Column 3 end --> 
			</div> 
		</div> 
	</div> 
</div> 
<div id="footer"> 
	<p>Copyright etc.</p> 
</div> 
</div>
 
</body> 
</html>

Edit: Dit is ook erg handig voor al die anderen die ook graag een fixed achtergrond willen die zich aanpast aan de schermresolutie
 
Laatst bewerkt:
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan