Results 1 to 4 of 4

Thread: Is this possible with css?

  1. #1
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default Is this possible with css?

    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!

  2. #2
    Join Date
    Nov 2007
    Location
    USA
    Posts
    170
    Thanks
    8
    Thanked 22 Times in 22 Posts

    Default

    dont know if this will help but i know in CSS there is a min-width:

    Code:
    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!

  3. #3
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default

    >_>

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

  4. #4
    Join Date
    Nov 2007
    Location
    USA
    Posts
    170
    Thanks
    8
    Thanked 22 Times in 22 Posts

    Default

    ok well i dont know if this is what you mean but i would do something like that by doing this:

    Code:
    <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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •