Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2005-05-18, 08:42 PM   #11
Barron
You tried your best and you failed miserably. The lesson is 'never try'
 
Join Date: Oct 2004
Posts: 166
Whew! This was a trick!

This works in IE6. I didnt test in other browsers.

Your div is now centered on the page and the black box now expands and contracts with the size of the line/text.

You cant test by putting various lines of text in.

EDIT: You can test

Quote:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title>Untitled</title>
<style type="text/css">

body {
margin: 0;
padding: 0;
border: 0;
max-width: 100%;
width: 100%;
}

#container {
margin: 0 auto;
width: 5em;
max-width: 100%; /* for compliant browsers to apply */
white-space: nowrap;
}

#content {
border: 1px solid black;
padding: 10px;
left-margin:10px;
float: left;
display: inline; /* to combat IE's double margin bug */
}
</style>
</head>
<body>
<div id="container">
<div id="content">

This is you test asdasd test a;skdjf;laskdjfa;s ldkfja;sdlkfjas;dkflsjadfk asdfsdfsdfsdf<br>
This is my test for lines

</div>
</div>
<!-- need this --><br style="clear: both;">

</body>
</html>
Barron is offline   Reply With Quote
 


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 Off

Forum Jump


All times are GMT -4. The time now is 08:10 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc