Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Push in the right direction please

Status
Not open for further replies.

RCorrigan

MIS
Joined
Feb 24, 2004
Messages
2,872
Location
MT
I have seen two varieties of CSS websites (when viewed at 1280x1024) ... the ones that have large borders, either on both sides or just on one - so that when sized up or down they view correctly and ones where they seem to resize themselves (csszengarden is one example) ..... as a total newcomer to css can someone please point me in the direction of what actually controls that "auto" resizing.

TIA

<Do I need A Signature or will an X do?>
 

Using non-absolute units for your values, such as % instead of px, would be one such way.

Hope this helps,
Dan

 
Not a px in sight !!!! all em ...... would that work ?

<Do I need A Signature or will an X do?>
 
Try this:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] lang="en" xml:lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<style type="text/css">
		#myBox {
			position: absolute;
			width: 50%;
			height: 100px;
			left: 25%;
			top: 25%;
			border: 2px dashed #666666;
		}
	</style>
</head>

<body>
	<div id="myBox"></div>
</body>
</html>

I've tried it in IE6, FF1, NN7, and Opera 7 - all with the same working result.

It will expand to fill 50% of the with regardless of browser window size.

Should give you a good starting point.

Hope this helps,
Dan
 
RCorrigan, em is another example of relative size, where 1em is considered the width of character m in the currently selected font family.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top