Log in

View Full Version : Is this possible with css?



jlizarraga
08-21-2008, 07:35 AM
Hi all,

I have a 3 boxes within a container. One is floated left, one right, and one I want to center but it would be preferable to allow it to have a min-width somehow (for varying user text sizes).

Thanks!

Moshambi
08-21-2008, 09:49 AM
dont know if this will help but i know in CSS there is a min-width:



div
{
/* this way */
min-width: 50px;
/* or this */
min-width: 35%;
/* or this */
min-width: inherit;
}


This should work on all elements except table elements i believe. And also note this will not work in IE 5.5 or 6 and only works partially in Safari 1.2

Hope this helps!

jlizarraga
08-23-2008, 01:56 AM
>_>

I'm trying to center an element with min-width.

Moshambi
08-23-2008, 05:27 PM
ok well i dont know if this is what you mean but i would do something like that by doing this:



<html>
<head>
<title>3 column Divs</title>

<style type="text/css">

#left, #center, #right
{
display: block;
width: 25%;
height: 100%;
border: 1px solid black;
}

#left
{
position: absolute;
left: 0px;
top: 0px;
}

#center
{
position: absolute;
left: 25%;
top: 0px;
width: 50%;
}

#right
{
position: absolute;
right: 0px;
top: 0px;
}

</style>

</head>

<body>

<div id="left">
Left content!
</div>

<div id="center">
Center content!
</div>

<div id="right">
Right content!
</div>

</body>
</html>


it makes it so there is a left column, center column, and right column...and of course the column sizes and position can be changed in the CSS