Border-Right-Length property is not working in a Div

  • Thread starter webeditor-coutre
  • Start date
W

webeditor-coutre

I am trying to limit the length of a right-side border for a div, to about
90% (which here is about 170px). All of the other properties work fine (e.g.,
"solid", "width: 1px", color: black, etc.).

But the "length" property does not "take". The length of the border persists
in being 100% of the side of the div.

I have tried these two ways of attributing length in the div that is 200px
tall (neither of these is working):

border-right-length: 160px;
border-right-length: 80%;

Question: Does anyone know how I can get a border in a div to limit to a
percentage length?
 
S

Steve Easton

Try:
border-right-width: length 80%;


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
 
W

webeditor-coutre

At first, adding "border-right-width: length 80%;" made the whole border
disappear. Then I moved "border-right-width: length 80%;" line to ABOVE the
"border-right-width: 2px" line in the stylesheet, and simply changing that
order of lines, it made the border appear again, but still at 100%. Maybe it
is just impossible to control a div border length from a stylesheet.
 
S

Stefan B Rusynko

Div is a container (element) which controls the size (length/width) of the container
Border is an property of that container (separately addressable for all 4 sides)
Length is not an attribute of border since the length is controlled by the container size

Only way to do what you want is to nest 2 divs w/ different borders: one div at 80 % of outer div (100%)




| At first, adding "border-right-width: length 80%;" made the whole border
| disappear. Then I moved "border-right-width: length 80%;" line to ABOVE the
| "border-right-width: 2px" line in the stylesheet, and simply changing that
| order of lines, it made the border appear again, but still at 100%. Maybe it
| is just impossible to control a div border length from a stylesheet.
|
| "Steve Easton" wrote:
|
| > Try:
| > border-right-width: length 80%;
| >
| >
| > --
| > Steve Easton
| > Microsoft MVP FrontPage
| > 95isalive
| > This site is best viewed..................
| > ...............................with a computer
| >
| > | > > I am trying to limit the length of a right-side border for a div, to about
| > > 90% (which here is about 170px). All of the other properties work fine (e.g.,
| > > "solid", "width: 1px", color: black, etc.).
| > >
| > > But the "length" property does not "take". The length of the border persists
| > > in being 100% of the side of the div.
| > >
| > > I have tried these two ways of attributing length in the div that is 200px
| > > tall (neither of these is working):
| > >
| > > border-right-length: 160px;
| > > border-right-length: 80%;
| > >
| > > Question: Does anyone know how I can get a border in a div to limit to a
| > > percentage length?
| > >
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top