Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > CSS question: Using height/width at 100% with fixed-width borders/margin/padding

Reply
Thread Tools

CSS question: Using height/width at 100% with fixed-width borders/margin/padding

 
 
cera
Guest
Posts: n/a
 
      08-17-2007
I am trying to create a block where I can use height and width at
100%, with the exception of a small 6-pixel border. An example that
stretches to fit the page is here, but it does not include this border/
margin/padding that needs to be added. Once I try to add a border,
margin, or padding .. it starts to scroll. Using overflow: hidden in
the body just clips the right and bottom sides.

I would appreciate any suggestions on how to resolve this issue.
Thank you, -Chris

div.main-body {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background-color: blue;
padding: 0px;
margin: 0px;
}

I have an html snippet here:
http://cera.us/css-test.html

 
Reply With Quote
 
 
 
 
Neredbojias
Guest
Posts: n/a
 
      08-18-2007
Well bust mah britches and call me cheeky, on Fri, 17 Aug 2007 20:54:11 GMT
cera scribed:

> I am trying to create a block where I can use height and width at
> 100%, with the exception of a small 6-pixel border. An example that
> stretches to fit the page is here, but it does not include this border/
> margin/padding that needs to be added. Once I try to add a border,
> margin, or padding .. it starts to scroll. Using overflow: hidden in
> the body just clips the right and bottom sides.
>
> I would appreciate any suggestions on how to resolve this issue.
> Thank you, -Chris
>
> div.main-body {
> position: absolute;
> top: 0px;
> left: 0px;
> width: 100%;
> height: 100%;
> background-color: blue;
> padding: 0px;
> margin: 0px;
> }
>
> I have an html snippet here:
> http://cera.us/css-test.html


Your snippet doesn't work at all in ie6, and you didn't close the <div>.

What I usually do is put a div in a div. There are some particulars to
this, but I have no idea of what you are trying to accomplish.

--
Neredbojias
Half lies are worth twice as much as whole lies.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tetration (print 100^100^100^100^100^100^100^100^100^100^100^100^100^100) jononanon@googlemail.com C Programming 5 04-25-2012 08:49 PM
100% TABLE + 100% ROW + 100% DIV..? fred Javascript 3 03-17-2005 04:25 AM
CSS 2 columns (1 nav + 1 content) 100% height & 100% width Not4u HTML 9 02-27-2004 10:09 AM



Advertisments