Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIV layer

Status
Not open for further replies.

ThomasJSmart

Programmer
Sep 16, 2002
634
How can i give a div layer the size: (100% - 30 pixels) ?


I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Code:
<div style="margin-left: 30px:"></div>
<div style="margin-right: 30px:"></div>
By default divs as block level elements have width set to 100%. If you do not change this, they will remain 100%. If you add margin-left or margin-right of 30px, their width will be just what you ask -- 100% minus 30px, depending on which side you want the 30px. Of course, if you want it on both sides, go with 15px on each side. Hope it helps.
 
Thanks but its not what im after, my bad my question was a bit cryptic :)

the size i meant is the height.

what i have is a page. on this page is a table
row 1 is 30 pix high and the table height is set to 100%.

This would make row 2 100% high - 30pix.

in this second row iv put a DIV layer. this has the set width of the table (700px) and needs to have the full height of the 2nd row.

problem is if i give the div height 100% it falls of the bottom because of the 30px space at the top.

im using the div to scroll the content in the 2nd row so if theres another way to acomplish this its fine too.

thank you :eek:)


I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
UPDATE: 100% height seems to be working fine in internet explorer. its just firefox & netscape thats giving a problem (havnt tested it on an apple system)

and also, why does internet explorer have a different width for the div?

why to divs suck so bad in a multibrowser enviroment...

the style class for the div:

.contentDiv{
position:absolute;
left: 0;
top: 30px;
width:587px;
z-index:1;
overflow: auto;
visibility: visible;
height: 100%;
padding: 0px 10px 20px 10px;
}

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
iv solved the problem.
im using iframe instead of div :eek:)


I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top