Below is a snippet of code that I believe SHOULD render differently than it does.
Step one: Create an image that is a 16 x 16 .PNG file, name it slider.png and place it the same folder as the HTML code listed below. Basically you should get what looks like a slider bar and the .PNG is the part you click on with your mouse and move back and forth on the bar.
The issue is this: in the body section I have four <DIV> tags. Two of these are self closing tags. When they are self closing tags, you cannot see the majority of the .PNG image. Change the two <DIV> tags to not be self closing and it displays correctly.
My question is WHY. This works the same in all browsers so am I doing something wrong in my style?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head>
<title>Slider Bar</title>
<style type="text/css">
.currentVal {
position:relative;
display:inline;
top:12px;
margin:0px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.sliderFrame {
height: 38px;
padding: 4px;
border: 1px #000;
overflow:hidden;
}
.slider {
position:relative;
z-index:2;
top: -5px;
width:16px;
height:16px;
margin:0px;
overflow:hidden;
background-image: url(slider.png);
}
.sliderBar {
position: relative;
height:2px;
top:5px;
margin:1px;
clear:left;
overflow:hidden;
background-color:#CCCCCC;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #666666;
border-right-color: #FFFFFF;
border-bottom-color: #FFFFFF;
border-left-color: #666666;
}
</style>
</head>
<body>
<div id="slider1-sliderFrame" style="width: 250px;" class="sliderFrame">
<div id="slider1-currVal" style="left: 220px;" class="currentVal">50</div
>
<div id="slider1-bar" style="width: 213px;" class="sliderBar" />
<div id="slider1-slider" style="left: 50px;" class="slider" />
</div>
</body>
</html>