Re: How to line a box with thin border containing background image
Just to follow up because I found something interesting. I had my divs
in my html document coded like this:
<div id="top-border"/>
As I'm really a java programmer, when I deal with xml (which xhtml
actually is), it's usually revolving around data processing (dom or
xslt), where there is no difference between <node/> and <node></node>.
But, aparently, there *is* when it comes to browsers and css. When I
changed it to
<div id="top-border"></div>
the results were much better (not perfect). Now, I still have a
question, but it's different now.
I've changed the top and bottom borders to:
#top-border {
width: 100%;
background-image: url(images/bg_top.gif);
background-repeat: repeat-x;
position: absolute;
top: 0em;
left: 0em;}
The bottom border has different coordinates and gif. Otherwise,
theyr'e the same.
The problem is that they're too tall.
Should be like:
-----------------------------------------------
|xxxxxxxxxxxxxxxxxxxxxxxxxx| <-- height of 7px to match the gif
-----------------------------------------------
Instead it's like:
-----------------------------------------------
|xxxxxxxxxxxxxxxxxxxxxxxxxx| <-- gif is 7px but
| | <-- the box extends
beyond that
-----------------------------------------------
I changed the div's height to be smaller, and then just removed the
height property, but it makes no difference. The graphic that is
repeated along the x axis is only 7 px, but the height of the box is
closer to double that, and I can't seem to shrink it to 7px. I suspect
that it thinks there some character in there that is forcing the
height, but I'm not certain.
Thoughts? And, I'm still interested in why the form of the div tag
really makes a difference, so if anyone has any thoughts...
Thanks again.
Skeeve
|