www.webdeveloper.com
Results 1 to 3 of 3

Thread: How to create the css for this graphic

  1. #1
    Join Date
    Jan 2005
    Location
    UK
    Posts
    381

    How to create the css for this graphic

    Hi, I need to create css using the attached graphic, can anyone tell me the best way to go about it and how to slice it up?

    I need to the div to expand vertically depending upo howmuch text is in there.

    Thankyou
    Attached Images Attached Images

  2. #2
    Join Date
    Sep 2009
    Posts
    146
    Vertical is easy, there are probably better ways to do this but this will probably be the easiest:

    Code:
    	<style type="text/css">
    		.constant {
                background-repeat:repeat-y;
                background-attachment: scroll;
                background-position: top center;	
                background-image:url(images/-CENTER SLICE-);		
    		}
            #container {
                width:585px;
    			padding:0px;
    			margin:0px;
            }
    		#roof {
    			background-image:url(images/-TOP SLICE-);
    			height:-HEIGHT OF TOP SLICE-px;
    			background-repeat:no-repeat;			
    		}
    		#content_floor {
    			background-image:url(images/-BOTTOM SLICE-);
    			background-repeat:no-repeat;
    			background-position:bottom center;		
    		}
        </style>
        <div id='container' class='constant'>
        	<div id='roof' class='constant'></div>
            <div id='content_floor' class='constant'>
            	put your content here
            </div>
        </div>
    -aPeg

  3. #3
    Join Date
    Mar 2010
    Posts
    2,803
    This code will create a box that is automatically expandable in both the X and Y directions depending on the content.

    The background is a 4 sided border with rounded corners.

    I have attached the 2 background image slices the box uses.

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
    >
    <
    html xmlns="http://www.w3.org/1999/xhtml">
    <
    head>
    <
    title>Fluid Box</title>
    <
    style type="text/css">
    <!--
     
    .
    container {
    width200px;
    colorrgb(0,0,255);
    backgroundurl("roundedRight.jpg"top right no-repeat}
    .
    container a {
    font-size12pt}
     
    .
    desc {
    font-size18pt;
    margin0px 0px 0px 0px;
    padding20px 0px 0px 20px;
    backgroundurl("roundedLeft.jpg"top left no-repeat}
     
    .
    link {
    margin0px 0px 0px 0px;
    padding20px 0px 0px 20px;
    backgroundurl("roundedLeft.jpg"bottom left no-repeat}
     
    .
    link div {
    displayblock;
    padding0px 20px 20px 0px;
    font-stylenormal;
    backgroundurl("roundedRight.jpg"bottom right no-repeat}

    -->
    </
    style>

    </
    head>
    <
    body>
     
    <
    div class="container">
     <
    div class="desc">This box is:</div>
        <
    div class="link">
            <
    div>
                <
    a href="#">Indestructable</a><br />because it is expandable both X and Y directions
                <
    p>Even more text<p>
                <
    p>Some paragraph text</p>
                <
    ul>
                    <
    li>List item 1</li>
                    <
    li>List item 2</li>
                    <
    li>List item 3</li>
                </
    ul>
            </
    div>
        </
    div>
    </
    div>
     
    </
    body>
    </
    html
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles