4 corner liquid box issue sample...

  • ArtphotoasiA
  • Graduate
  • Graduate
  • User avatar
  • Posts: 204
  • Loc: Italy

Post 3+ Months Ago

4 corner liquid box issue sample...

Waiting for CSS version 3 (I read that probably we need to wait several years) we all poor webdesigners / webmaster are forced to get mad for the 4 round corner box issue.

- 1 it is possible do the box layout base with tab tag
- 2 it is possible do the box layout base using div tag and no table


Case 1 - is probably easier to work with specially if you have never done that before but is not recommended
Case 2 - actually you do not save much code in the page using div instead of tab but is much better for consistency and for future development


In both cases basically must add a set of corner's images (of the due color), can be 2 or 4 images x box depending if the box have a fix width or a width 100% ===> the liquid case

Today i have just made some of those liquid boxes so I wish to share where the problem is worst, where you need all 4 corners images, and of course you need 4 XHTML elements in order to look them up.

Please note that:
- I have not used a background-color option because the color to be used for my customer was a pantone color not web safe, so no way to make a # color code but need to work with a background-image option _zzz.png
- The 4 corner images are:
_aaa.png _bbb.png _ccc.png _ddd.png







So here comes the CSS...


Code: [ Select ]
<!-- main liquid box -->

.minibox {
background-image:url(../images/_zzz.png);
width:100%;
}




<!-- link text image all content style -->

.imgminibox
{
border: #660033 solid 1px;
}
.textminibox {
text-align:left;
padding:10px;
font:Arial, Helvetica, sans-serif;
font-size:12px;
color:#FFFFFF;
font-weight:bold;
}
a.linkminibox {
font:Arial, Helvetica, sans-serif;
font-size:12px;
color:#FFFFFF;
font-weight:bold;
text-decoration: underline;
}
a.linkminibox:hover {
font:Arial, Helvetica, sans-serif;
font-size:12px;
color:#FFFFFF;
font-weight:bold;
text-decoration:none;
}



<!-- here are the 4 cornes -->


.roundaaa {
background-image:url(../images/_aaa.png);
background-repeat:no-repeat;
background-position: left top;
}
.roundbbb {
background-image:url(../images/_bbb.png);
background-repeat:no-repeat;
background-position: right top;
}
.roundccc {
background-image:url(../images/_ccc.png);
background-repeat:no-repeat;
background-position: left bottom;
}
.roundddd {
background-image:url(../images/_ddd.png);
background-repeat:no-repeat;
background-position: right bottom;
}
  1. <!-- main liquid box -->
  2. .minibox {
  3. background-image:url(../images/_zzz.png);
  4. width:100%;
  5. }
  6. <!-- link text image all content style -->
  7. .imgminibox
  8. {
  9. border: #660033 solid 1px;
  10. }
  11. .textminibox {
  12. text-align:left;
  13. padding:10px;
  14. font:Arial, Helvetica, sans-serif;
  15. font-size:12px;
  16. color:#FFFFFF;
  17. font-weight:bold;
  18. }
  19. a.linkminibox {
  20. font:Arial, Helvetica, sans-serif;
  21. font-size:12px;
  22. color:#FFFFFF;
  23. font-weight:bold;
  24. text-decoration: underline;
  25. }
  26. a.linkminibox:hover {
  27. font:Arial, Helvetica, sans-serif;
  28. font-size:12px;
  29. color:#FFFFFF;
  30. font-weight:bold;
  31. text-decoration:none;
  32. }
  33. <!-- here are the 4 cornes -->
  34. .roundaaa {
  35. background-image:url(../images/_aaa.png);
  36. background-repeat:no-repeat;
  37. background-position: left top;
  38. }
  39. .roundbbb {
  40. background-image:url(../images/_bbb.png);
  41. background-repeat:no-repeat;
  42. background-position: right top;
  43. }
  44. .roundccc {
  45. background-image:url(../images/_ccc.png);
  46. background-repeat:no-repeat;
  47. background-position: left bottom;
  48. }
  49. .roundddd {
  50. background-image:url(../images/_ddd.png);
  51. background-repeat:no-repeat;
  52. background-position: right bottom;
  53. }




so here comes XHTML...


Code: [ Select ]
<div class="minibox">
              <div class="roundaaa">
            <div class="roundbbb">
            <div class="roundccc">
            <div class="roundddd">
            <div class="textminibox">


                CONTENT WITH TEXT IMG LINK GOES HERE



            </div>
            </div>
            </div>
            </div>
            </div>
</div>
  1. <div class="minibox">
  2.               <div class="roundaaa">
  3.             <div class="roundbbb">
  4.             <div class="roundccc">
  5.             <div class="roundddd">
  6.             <div class="textminibox">
  7.                 CONTENT WITH TEXT IMG LINK GOES HERE
  8.             </div>
  9.             </div>
  10.             </div>
  11.             </div>
  12.             </div>
  13. </div>




Hope you like
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 43 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.