Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    478
    Thanks
    3
    Thanked 0 Times in 0 Posts

    CSS border instead of tables border

    i have played around with this code i wrote but not able to get the borders to work right.

    wanting a botrder around the whole DIV, width of 20px, but not the whole browser,

    can someone please advise what i am doing wrong

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style>
    <!--
    .page {
    width: 500px;
    height: 400px;
    }
    
    .left {
    width: 20px;
    height: 100%;
    background:  url(spacer.gif) left top repeat-y;
    }
    
    .top {
    width: 100%;
    height: 20px;
    background:  url(spacer.gif) left top repeat-x;
    }
    
    .middle {
    text-align: center;
    }
    
    .bottom {
    width: 100%;
    height: 20px;
    background:  url(spacer.gif) left bottom repeat-x;
    }
    
    .right {
    width: 20px;
    height: 100%;
    background:  url(spacer.gif) right top repeat-y;
    }
    -->
    </style>
    </head>
    
    <body>
    <div class="page">
    	<div class="left">
    		<div class="top">
    			<div class="bottom">
    				<div class="right">
    					<div class="middle">afghdfghdfghndfghbdfghbdfghbdfghfghdfgbc<br><br><br><br><br><br><br><br><br><br><br><br><br><br></div>
    				</div>
    			</div>
    		</div>
    	</div>
    </div>
    </body>
    </html>

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Add this to any element to make it a 20px wide, solid black border. You can see the property here.

    Code:
    border: 20px solid #000000;
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Posting Permissions

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