Guest User

div box

a guest
Sep 17th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.83 KB | None | 0 0
  1.  
  2. function box($width, $overskrift, $indhold)
  3. {
  4.  
  5. $widthP = $width + 20;
  6.  
  7. print"
  8.     <div style=\"width: ".$widthP."px; position: relative; min-height: 200px;\">
  9.         <div style=\"position: absolute; left: 8px; top: -22px;\"><h3>".$overskrift."</h3></div>
  10.         <div style=\"position: absolute; left: 0px; top: 0px; background-image: url('pics/design2/lefttopbox.png'); background-repeat: no-repeat; width: 10px; height: 10px;\"></div>
  11.         <div style=\"position: absolute; left: 10px; right: -10px; top: 0px; background-image: url('pics/design2/topbox.png'); background-repeat: repeat-x; width: ".$width."px; height: 10px;\"></div>
  12.         <div style=\"position: absolute; right: 0px; top: 0px; background-image: url('pics/design2/righttopbox.png'); background-repeat: no-repeat; width: 10px; height: 10px;\"></div>
  13.        
  14.             <div style=\"position: absolute; left: 0px; top: 10px; bottom: 10px; background-image: url('pics/design2/leftbox.png'); background-repeat: repeat-y; width: 10px;\"></div>
  15.                 <div style=\"position: absolute; left: 20px; right: 20px; top: 20px; bottom: 20px;\"><h5>".$indhold."</h5></div>
  16.             <div style=\"position: absolute; right: 0px; top: 10px; bottom: 10px; background-image: url('pics/design2/rightbox.png'); background-repeat: repeat-y; width: 10px;\"></div>
  17.            
  18.         <div style=\"position: absolute; left: 0px; bottom: 0px; background-image: url('pics/design2/leftbottombox.png'); background-repeat: no-repeat; width: 10px; height: 10px;\"></div>
  19.         <div style=\"position: absolute; left: 10px; right: -10px; bottom: 0px; background-image: url('pics/design2/bottombox.png'); background-repeat: repeat-x; width: ".$width."px; height: 10px;\"></div>
  20.         <div style=\"position: absolute; right: 0px; bottom: 0px; background-image: url('pics/design2/rightbottombox.png'); background-repeat: no-repeat; width: 10px; height: 10px;\"></div>
  21.     </div>
  22.     ";
  23. }
Advertisement
Add Comment
Please, Sign In to add comment