Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Resizable round corner box. Resizable round corner box.
Previous
 
Next
New Post
6/1/2011 7:26 AM
 

I would like to know the proper CSS way to creating a resizeable rounded corners box that holds content. The rounded corners should be with proper PNG transparency, so it will work with any background.

The box should be graphic. I mean that it wont rely on CSS backgroundcolor and border but images.

I have seen an example called sliding doors, that scales the images. The problem with this method is that it distorts the original image. For example the corner radius. Also it will probably mess upp more graphical boxes.

The way i have solved this now is with a 3x3 table. It works great! But i know tha tables are not considered proper for styling. So id like to learn how to do the same thing with DIVs and CSS.

 
New Post
6/2/2011 4:07 AM
 
Had a similar request from a client last year - have a look at this as a possible place to start

http://designmovesme.com/scalable-box/

Westa
 
New Post
6/3/2011 9:47 AM
 
Also see the excellent CSS Play site. 
http://www.cssplay.co.uk/boxes/
Ian

Mutate and Survive
 
New Post
6/3/2011 12:20 PM
 
Lautaro Arino wrote:

I would like to know the proper CSS way to creating a resizeable rounded corners box that holds content. The rounded corners should be with proper PNG transparency, so it will work with any background.

 I have all but switched to pure CSS3 for all of this.

... but if you reallly must support < ie8 then I suggest the method from 456 Berea St.  I have modified it to be a JQuery plugin here:

jQuery Function:

(function($) {
    $.fn.cbb = function(el){
        if($(this).parent().hasClass('.i3')||$(this).parent().parent().hasClass('.i3')){return;}
        if($(this).parent().is('a')){var root=$(this).parent();}
        else{var root=$(this);}
        root.wrap('<div class="cb" />').wrap('<div class="i1" />').wrap('<div class="i2" />').wrap('<div class="i3" />');
        $(this).closest('div.i1').after('<div class="bb"><div></div></div>')
        $(this).closest('div.i1').before('<div class="bt"><div></div></div>')
        $(this).closest('.cb').width($(this).width()+36);
    };
})(jQuery);

jQuery Call:

$("#myobject").cbb();

My CSS:

.cbb{margin:.25em 0;padding:0 .25em;border:1px solid #666;background:#fff;}
.cbb h1{margin:0 -10px;padding:0.3em 10px;background:#efece6;font:bold 1.2em/1 Arial, Helvetica, sans-serif;}
.cbb .Normal{display:block;}
.cb .Normal{display:block;}
.cb{margin:0.25em;text-align:center;}
.bt{height:14px;margin:0 0 0 15px;background:url(/portals/0/images/box.png) no-repeat 100% 0;}
.bt div{position:relative;float:left;left:-15px;width:15px;height:14px;background:url(/portals/0/images/box.png) no-repeat 0 0;font-size:0;line-height:0;}
.bb{height:14px;margin:0 0 0 12px;background:url(/portals/0/images/box.png) no-repeat 100% 100%;}
.bb div{position:relative;float:left;left:-12px;width:12px;height:14px;background:url(/portals/0/images/box.png) no-repeat 0 100%;font-size:0;line-height:0;}
.i1{padding:0 0 0 12px;background:url(/portals/0/images/borders.png) repeat-y 0 0;}
.i2{padding:0 12px 0 0;background:url(/portals/0/images/borders.png) repeat-y 100% 0;}
.i3{margin:0;padding:1px 5px;background:#fff;display:block;}
.i3:after{content:".";display:block;height:0;clear:both;visibility:hidden;}

You can get the supporting files from the link above which also teaches you how to create your own borders.  Use a condintional style sheet to replace the image with a clean gif for ie6 or play with PNG fix.



 
New Post
6/3/2011 1:05 PM
 
Hi Lance

Have you seen this method using a definition list?

http://www.cssplay.co.uk/boxes/four_c...

View source for the css.  Not tried it but is seems simple and elegant?

That said I have never found making a container with rounded corners to be difficult?
Surely it can be done with divs and floats or am I missing something?

Ian



Ian

Mutate and Survive
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Resizable round corner box. Resizable round corner box.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out