terov
10-31-2003, 07:19 PM
I'm working on creating theme-friendly code website for my company and am having a few problems getting it to come together.
My first hurdle is creating a box model that can contain a top border (background image) as well as left, right and bottom, as well as specifically defined corners. I've been trying to pull this off with the repeat-x, repeat-y, and no-repeat properties in conjuntion with setting the starting point for the background (left center, etc.). Here is the code I currently have:
.newsBox {
position: relative; left: 0px; top: 50px;
height: auto; width: 175px;
background-color: #14141F;
margin-bottom: 8px; margin-top: 4px;
color: white;
margin-left: 4px;
margin-right: 4px;
}
.newsT {
z-index: 5;
width: 100%; height: 100%;
position: absolute; left: 0px; top: 0px;
background: url(original/newsboxT.gif) repeat-x center top;
}
.newsTL {
z-index: 10;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxTL.gif) no-repeat top left;
}
.newsTR {
z-index: 10;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxTR.gif) no-repeat top right;
}
.newsL {
z-index: 1;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxL.gif) repeat-y left center;
}
.newsR {
z-index: 1;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxR.gif) repeat-y right center;
}
.newsB {
z-index: 5;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxB.gif) repeat-x center bottom;
}
.newsBL {
z-index: 10;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxBL.gif) no-repeat bottom left;
}
.newsBR {
z-index: 10;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxBR.gif) no-repeat bottom right;
}
.newsEntry {
z-index: 100;
position: absolute; left: 0px; top: 0px;
width: 155;
padding-top: 5px; padding-bottom: 5px; padding-left: 13px; padding-right: 10px;
font: 10px/13px verdana,arial,helvetica,sans-serif;
color: gray;
}
I'm hoping that will display properly--I'm new to these forums so I'm not yet acquainted with their quirks :-) Here's the associated HTML:
<HTML>
<HEAD>
<TITLE>Testing</TITLE>
<LINK rel=stylesheet href="testing.css" type: "text/css">
</HEAD>
<BODY>
<DIV class="news">
<DIV class="newsImg"></DIV>
<DIV class="newsBox">
Testing. This is where news would be, if I could get the dang news boxes to work.
<DIV class="newsT"></DIV>
<DIV class="newsTL"></DIV>
<DIV class="newsTR"></DIV>
<DIV class="newsL"></DIV>
<DIV class="newsR"></DIV>
<DIV class="newsB"></DIV>
<DIV class="newsBL"></DIV>
<DIV class="newsBR"></DIV>
</DIV>
<DIV class="newsBox">
<DIV class="newsEntry">Stuff. Things. This is some text. Really we're
just going for a turn-line. That should do it.</DIV>
<DIV class="newsT"></DIV>
<DIV class="newsTL"></DIV>
<DIV class="newsTR"></DIV>
<DIV class="newsL"></DIV>
<DIV class="newsR"></DIV>
<DIV class="newsB"></DIV>
<DIV class="newsBL"></DIV>
<DIV class="newsBR"></DIV>
</DIV>
<DIV class="newsBox">
<DIV class="newsT"></DIV>
<DIV class="newsTL"></DIV>
<DIV class="newsTR"></DIV>
<DIV class="newsL"></DIV>
<DIV class="newsR"></DIV>
<DIV class="newsB"></DIV>
<DIV class="newsBL"></DIV>
<DIV class="newsBR"></DIV>
</DIV>
</DIV>
</BODY>
</HTML>
Here is the crux of my problem:
I cannot get text to display properly within or above the box. This happens for a few reasons:
1) If I place the text inside the container DIV, that being "newsBox", the text falls behind my left, right, top, and bottom backgrounds.
2) If I place the text in an overlapping DIV, text will display properly, but the background DIVs do not scale to the size of the overlapping DIV (which is still inside the newsBox DIV mind you). I get a number of quirky results in latest stable Mozilla and IE from this. I need it to size dynamically, and all backgrounds to tile in accordance with the appropriate size of the container DIV (newsBox). I simply do not understand why placing a DIV (newsEntry) inside newsBox—which has no height assigned to it—does not adjust the size of newsBox and cause the backgrounds, set at 100% height and 100% width of their parent (newsBox) to tile appropriately.
Really pretty frustrating, and somewhat difficult to explain. Please let me know if you need clarification and thanks so much in advance from a CSS newbie :-)
My first hurdle is creating a box model that can contain a top border (background image) as well as left, right and bottom, as well as specifically defined corners. I've been trying to pull this off with the repeat-x, repeat-y, and no-repeat properties in conjuntion with setting the starting point for the background (left center, etc.). Here is the code I currently have:
.newsBox {
position: relative; left: 0px; top: 50px;
height: auto; width: 175px;
background-color: #14141F;
margin-bottom: 8px; margin-top: 4px;
color: white;
margin-left: 4px;
margin-right: 4px;
}
.newsT {
z-index: 5;
width: 100%; height: 100%;
position: absolute; left: 0px; top: 0px;
background: url(original/newsboxT.gif) repeat-x center top;
}
.newsTL {
z-index: 10;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxTL.gif) no-repeat top left;
}
.newsTR {
z-index: 10;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxTR.gif) no-repeat top right;
}
.newsL {
z-index: 1;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxL.gif) repeat-y left center;
}
.newsR {
z-index: 1;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxR.gif) repeat-y right center;
}
.newsB {
z-index: 5;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxB.gif) repeat-x center bottom;
}
.newsBL {
z-index: 10;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxBL.gif) no-repeat bottom left;
}
.newsBR {
z-index: 10;
position: absolute; left: 0px; top: 0px;
width: 100%; height: 100%;
background: url(original/newsboxBR.gif) no-repeat bottom right;
}
.newsEntry {
z-index: 100;
position: absolute; left: 0px; top: 0px;
width: 155;
padding-top: 5px; padding-bottom: 5px; padding-left: 13px; padding-right: 10px;
font: 10px/13px verdana,arial,helvetica,sans-serif;
color: gray;
}
I'm hoping that will display properly--I'm new to these forums so I'm not yet acquainted with their quirks :-) Here's the associated HTML:
<HTML>
<HEAD>
<TITLE>Testing</TITLE>
<LINK rel=stylesheet href="testing.css" type: "text/css">
</HEAD>
<BODY>
<DIV class="news">
<DIV class="newsImg"></DIV>
<DIV class="newsBox">
Testing. This is where news would be, if I could get the dang news boxes to work.
<DIV class="newsT"></DIV>
<DIV class="newsTL"></DIV>
<DIV class="newsTR"></DIV>
<DIV class="newsL"></DIV>
<DIV class="newsR"></DIV>
<DIV class="newsB"></DIV>
<DIV class="newsBL"></DIV>
<DIV class="newsBR"></DIV>
</DIV>
<DIV class="newsBox">
<DIV class="newsEntry">Stuff. Things. This is some text. Really we're
just going for a turn-line. That should do it.</DIV>
<DIV class="newsT"></DIV>
<DIV class="newsTL"></DIV>
<DIV class="newsTR"></DIV>
<DIV class="newsL"></DIV>
<DIV class="newsR"></DIV>
<DIV class="newsB"></DIV>
<DIV class="newsBL"></DIV>
<DIV class="newsBR"></DIV>
</DIV>
<DIV class="newsBox">
<DIV class="newsT"></DIV>
<DIV class="newsTL"></DIV>
<DIV class="newsTR"></DIV>
<DIV class="newsL"></DIV>
<DIV class="newsR"></DIV>
<DIV class="newsB"></DIV>
<DIV class="newsBL"></DIV>
<DIV class="newsBR"></DIV>
</DIV>
</DIV>
</BODY>
</HTML>
Here is the crux of my problem:
I cannot get text to display properly within or above the box. This happens for a few reasons:
1) If I place the text inside the container DIV, that being "newsBox", the text falls behind my left, right, top, and bottom backgrounds.
2) If I place the text in an overlapping DIV, text will display properly, but the background DIVs do not scale to the size of the overlapping DIV (which is still inside the newsBox DIV mind you). I get a number of quirky results in latest stable Mozilla and IE from this. I need it to size dynamically, and all backgrounds to tile in accordance with the appropriate size of the container DIV (newsBox). I simply do not understand why placing a DIV (newsEntry) inside newsBox—which has no height assigned to it—does not adjust the size of newsBox and cause the backgrounds, set at 100% height and 100% width of their parent (newsBox) to tile appropriately.
Really pretty frustrating, and somewhat difficult to explain. Please let me know if you need clarification and thanks so much in advance from a CSS newbie :-)