Related
I created a hover effect for my navigation bar / the list inside it. On hover I want to create a "pressed button" effect by applying a box shadow. But the shadow only is casted in a small box. (check picture below)
I want the shadow to fill out the whole navbar around the hovered area.
I have no idea where to put my code and would be glad about any help :)
HTML CODE:
<nav>
<div class="nav-wrapper">
<ul>
<li>Home</li>
<li>Projekte</li>
</ul>
</div>
</nav>
CSS CODE:
html, body {
margin: 0;
padding: 0;
height: 100%;
background-color:white;
font-family: 'Open Sans', sans-serif;
}
.nav-wrapper {
margin: 0 auto;
margin-top: 50px;
width: 60%;
padding-top: 5px;
padding-bottom: 5px;
color:#787878;
box-shadow: 2px 2px 3px #BDBDBD;
border-radius: 5px;
background: #f9f9f9; /* Old browsers */
background: -moz-linear-gradient(top, #f9f9f9 0%, #ededed 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* IE10+ */
background: linear-gradient(to bottom, #f9f9f9 0%,#ededed 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
}
ul {
list-style: none;
}
li {
display: inline;
padding: 0 15px;
}
li:hover {
box-shadow: 2px 2px 3px #BDBDBD inset;
}
a {
text-decoration: none;
color:#787878;
}
Add this:
li:hover {
box-shadow: 2px 2px 3px #BDBDBD inset, 2px 2px 3px #BDBDBD;
}
Preview:
Or the bevelled effect here:
li:hover {
box-shadow: 2px 2px 3px #BDBDBD inset, -2px -2px 3px #BDBDBD inset;
}
Preview:
Fiddle: http://jsbin.com/wolotuxico/1/edit?html,css,output
Update from Comments
Remove padding for .nav-wrapper and give it to li
.nav-wrapper {
padding: 0;
}
li {
display: inline-block;
padding: 15px;
}
Preview:
Fiddle: http://jsbin.com/bowawodode/2/edit
Remove the padding from the navigation and add it to the li's. Remember the border is outside the padding and inside the margin.
Example:
https://jsfiddle.net/m98yedk6/1/
.nav-wrapper {
position: relative;
margin: 0 auto;
margin-top: 50px;
width: 60%;
color:#787878;
box-shadow: 2px 2px 3px #BDBDBD;
border-radius: 5px;
background: #f9f9f9; /* Old browsers */
background: -moz-linear-gradient(top, #f9f9f9 0%, #ededed 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f9f9f9 0%,#ededed 100%); /* IE10+ */
background: linear-gradient(to bottom, #f9f9f9 0%,#ededed 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
}
li {
display: inline-block;
padding: 10px;
}
How can i force the css to make the li tabs i have fill its section. The number of tabs can change to either 4 or 5.
I have tried adding the follow:
.tabs ul li {
display:table-cell;
}
.tabs ul.static
{
display:table !important;
width:750px !important;
table-layout:fixed !important;
}
But it has not worked. When there is a 5th tab the 5th goes to the line below. The current jsfiddle below does this.
How can i get the tabs to cover 100% of the width of its container whether there are 4 or 5 tabs?
http://jsfiddle.net/L7osd1oc/3/
your ul width 750px fix.
so you can add li fix width in % and remove ul left panding
Follow the table structure when you style the elements like below
.tabs{
display:table;
}
.tabs ul.static{
display:table-row;
}
.tabs ul li{
display:table-cell;
}
When you specifying width, in your case 750px, assign this to .tabs which is the table element.
See if this helps you.
try this demo
.tabs {
position: relative;
top: 1px;
z-index: 2;
display: block;
margin: 0 auto 0 auto;
}
.tabs a.static.selected {
width:100%;
padding:10px 0 10px 0;
background: #4096ee; /* Old browsers */
background: -moz-linear-gradient(top, #4096ee 0%, #88bff7 55%, #93c9ff 99%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4096ee), color-stop(55%,#88bff7), color-stop(99%,#93c9ff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #4096ee 0%,#88bff7 55%,#93c9ff 99%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #4096ee 0%,#88bff7 55%,#93c9ff 99%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #4096ee 0%,#88bff7 55%,#93c9ff 99%); /* IE10+ */
background: linear-gradient(to bottom, #4096ee 0%,#88bff7 55%,#93c9ff 99%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4096ee', endColorstr='#93c9ff',GradientType=0 ); /* IE6-9 */
}
.tabs a.static {
color:#000000 !important;
float:none;
text-decoration:none;
}
.tabs ul li {
list-style: none;
margin-left: 1px;
color: #000000;
margin:0px;
padding:0px;
text-align:center;
background: #93c9ff; /* Old browsers */
background: -moz-linear-gradient(top, #93c9ff 1%, #88bff7 45%, #4096ee 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#93c9ff), color-stop(45%,#88bff7), color-stop(100%,#4096ee)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #93c9ff 1%,#88bff7 45%,#4096ee 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #93c9ff 1%,#88bff7 45%,#4096ee 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #93c9ff 1%,#88bff7 45%,#4096ee 100%); /* IE10+ */
background: linear-gradient(to bottom, #93c9ff 1%,#88bff7 45%,#4096ee 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#93c9ff', endColorstr='#4096ee',GradientType=0 ); /* IE6-9 */
display:inline-block ;
}
.tabs a:link {
color: #000000;
text-decoration:none;
}
.tab {
padding: 10px 15px;
position: relative;
display: inline-block;
list-style: none;
text-align:center;
}
.tabs.static.selected:after {
list-style: none;
padding: 10px 15px;
position: relative;
display: inline-block;
}
.tabs ul.static
{
padding:0px;
background: #93c9ff; /* Old browsers */
background: -moz-linear-gradient(top, #93c9ff 1%, #88bff7 45%, #4096ee 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#93c9ff), color-stop(45%,#88bff7), color-stop(100%,#4096ee)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #93c9ff 1%,#88bff7 45%,#4096ee 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #93c9ff 1%,#88bff7 45%,#4096ee 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #93c9ff 1%,#88bff7 45%,#4096ee 100%); /* IE10+ */
background: linear-gradient(to bottom, #93c9ff 1%,#88bff7 45%,#4096ee 100%); /* W3C */
display:table !important;
width:750px !important;
table-layout:fixed !important;
width:100%;
text-align:center;
}
.tab-content {
width:730px;
margin: auto;
background: #fff;
min-height: 200px;
border-radius: 7px;
padding:10px;
text-align:center;
}
.changeButton {
padding: 10px;
margin-left: 25px;
color: #FFFFFF;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACcQAAAAyCAYAAAB4IErqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABh0RVh0Q3JlYXRpb24gVGltZQAyOS8wNi8yMDExWc9aJgAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAcjSURBVHic7d0xjuVEFEDR/lANAgapA6QhJIPlsFVEDBIpywAhskkIJpl2sYqS1fedswInV+Vn+7//+PXvj/sJSPvx3Wd3XwJw2MuXn999CcBhXz87z6Huz/8ed18CcNhP7+6+AuC0l+e7rwA47au7LwA4bv/7x92XABz2+MaADnXrl78+3n0NwGE/f7/uvgTgsB9evrj7EoDDvntynkPdbx984A5137pth7xnH8RBng/ioG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4d8rxAhz6VQ58X6NBnPoc+8zn07afH3ZcAHGY+hwFsjoI+nUPe2u7cIc+LNehznEOfzKHPfA595nPoc5xDn8xhAJujoE/nkPc/uudLapl/Zw4AAAAASUVORK5CYII=') !important;
background-repeat: repeat-x;
border-style:none;
}
.in-life-container
{
display: block;
margin: auto;
width:750px ;
}
<div class="in-life-container"> <img alt="Skip Navigation Links" src="/WebResource.axd?d=6iNAiGgDBpuUye_ZuQPbwXiF72lVuKy1N2-6JtQmWhRUTLP-_aBCSi-HAD2Zs-eHQCBbOkoJeU_cbrTEvN9ZQUSgy7q8g4vdB9ibfUBW5rM1&t=635418570520000000" width="0" height="0" style="border-width:0px;">
<div class="tabs" id="ContentPlaceHolder_Body_Settings_Repeater_AccountSettings_ctl00_1_Menu_MyVoiceTabMenu_1" style="float: left;">
<ul class="level1 static" tabindex="0" role="menubar" style="position: relative;"><li role="menuitem" class="static" style="position: relative; "><a class="level1 tab static" href="#" onclick="__doPostBack('ctl00$ContentPlaceHolder_Body$Settings$Repeater_AccountSettings$ctl01$ctl00$Menu_MyVoiceTabMenu','4')" tabindex="-1">SIP Details</a></li>
<li role="menuitem" class="static" style="position: relative;"><a class="level1 tab selected static" href="#" onclick="__doPostBack('ctl00$ContentPlaceHolder_Body$Settings$Repeater_AccountSettings$ctl01$ctl00$Menu_MyVoiceTabMenu','0')" tabindex="-1">Change Address</a>
</li>
<li role="menuitem" class="static" style="position: relative;"><a class="level1 tab static highlighted" href="#" onclick="__doPostBack('ctl00$ContentPlaceHolder_Body$Settings$Repeater_AccountSettings$ctl01$ctl00$Menu_MyVoiceTabMenu','1')" tabindex="-1">Change Ownership</a>
</li>
<li role="menuitem" class="static" style="position: relative;"><a class="level1 tab static" href="#" onclick="__doPostBack('ctl00$ContentPlaceHolder_Body$Settings$Repeater_AccountSettings$ctl01$ctl00$Menu_MyVoiceTabMenu','2')" tabindex="-1">Re-grade Service</a>
</li>
<li role="menuitem" class="static" style="position: relative;"><a class="level1 tab static" href="#" onclick="__doPostBack('ctl00$ContentPlaceHolder_Body$Settings$Repeater_AccountSettings$ctl01$ctl00$Menu_MyVoiceTabMenu','3')" tabindex="-1">Cease Service</a>
</li>
</ul>
</div>
<div style="clear: left;"></div><a id="ContentPlaceHolder_Body_Settings_Repeater_AccountSettings_ctl00_1_Menu_MyVoiceTabMenu_1_SkipLink"></a>
<div class="tab-content">To change the address on this account please <a id="ContentPlaceHolder_Body_Settings_Repeater_AccountSettings_ctl00_1_LinkButton_CreateTicket_1" href="javascript:__doPostBack('ctl00$ContentPlaceHolder_Body$Settings$Repeater_AccountSettings$ctl01$ctl00$LinkButton_CreateTicket','')">create a ticket here.</a>
</div>
</div>
I was wondering how can I position navigation titles so that my dropdown menu would work..
The following picture is my perfectly positioned a links, separated thanks to padding-left, which is set to 80 px; Strangely enough, my dropdown category is padded as well, leaving extra space, which makes it very ugly to look. And my dropdown menu link is separated in two lines, although it is only one link. How can I fix this problem? I tried with margin as well, nothing really changed. I would like it to be something like this the third picture..
Picture one - My desired navigation positioning :
http://i61.tinypic.com/2cshw7q.png
Picture two - My dropdown problem :
http://i60.tinypic.com/2z4037c.png
Picture three - The way I would like it to be:
http://i60.tinypic.com/1252ejo.png
How can I accomplish this?
EDIT!
My CSS code:
#menu
{
clear:both;
position: relative;
width: 100%;
height:30px;
background: rgb(38,42,53); /* Old browsers */
background: -moz-linear-gradient(top, rgba(38,42,53,1) 0%, rgba(40,45,63,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(38,42,53,1)), color-stop(100%,rgba(40,45,63,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(38,42,53,1) 0%,rgba(40,45,63,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(38,42,53,1) 0%,rgba(40,45,63,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(38,42,53,1) 0%,rgba(40,45,63,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(38,42,53,1) 0%,rgba(40,45,63,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#262a35', endColorstr='#282d3f',GradientType=0 ); /* IE6-9 */
}
ul#menu {
margin:0;
padding:0;
list-style-type: none;
text-transform: uppercase;
font-size: 15px;
}
ul#menu li{
position: relative;
display:inline-block;
/*float:left;*/
margin:0;
padding:0;
}
ul#menu li a{
display:block;
float:left;
color:#84FD00; /* #874B46 */
text-decoration:none;
padding-left: 80px;
padding-top: 5px;
}
ul#menu li ul {
margin-top:20px;
position: absolute;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow:none;
opacity: 0;
visibility: 0;
padding-left: 30px;
}
ul#menu li ul li {
background: rgb(38,42,53); /* Old browsers */
background: -moz-linear-gradient(top, rgba(38,42,53,1) 0%, rgba(40,45,63,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(38,42,53,1)), color-stop(100%,rgba(40,45,63,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(38,42,53,1) 0%,rgba(40,45,63,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(38,42,53,1) 0%,rgba(40,45,63,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(38,42,53,1) 0%,rgba(40,45,63,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(38,42,53,1) 0%,rgba(40,45,63,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#262a35', endColorstr='#282d3f',GradientType=0 ); /* IE6-9 */
color: #8BA8C5;
height: 40px;
}
ul#menu li ul li:hover {
background: #666;
}
ul#menu li:hover ul {
display: block;
opacity: 1;
visibility: visible;
margin-right:20px;
}
Set the dropdown ul to have text-align: left; - this should show the text on the left hand side. For some reason your text is right aligned...
My Footer div doesn't show the background color..
Here is the style.css file in which all of the background is working except the footer..
[ Style.css]
.Footer {
width: 200px;
border: 1px solid blue;
padding: 5px;
font-weight: bold;
color: #ffffff;
background-color: #000000;
}
body {
background: #b3dced; /* Old browsers */
background: -moz-linear-gradient(top, #b3dced 0%, #29b8e5 50%, #bce0ee 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b3dced), color-stop(50%,#29b8e5), color-stop(100%,#bce0ee)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* IE10+ */
background: linear-gradient(to bottom, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3dced', endColorstr='#bce0ee',GradientType=0 ); /* IE6-9 */
}
.body {
padding-top: 1px;
margin-top: 2px;
width: 1200px;
height: 500px;
}
.about_this_site__title {
width: 200px;
border: 1px solid blue;
padding: 5px;
font-weight: bold;
color: #ffffff;
}
.logo {
margin-top: 10px;
margin-right: 500px;
}
#menu {
padding: 0;
margin: 0;
width: 1000px;
margin-right: auto;
margin-left: auto;
border-radius: 2px;
}
#menu ul {
margin: 0;
padding: 0;
border-radius: 3px;
}
#menu ul li {
background: #ffffff;
float: left;
position: relative;
border-radius: 2px;
list-style-type: none;
}
#menu ul li a {
font-family: Verdana;
font-size: 14px;
color: blue;
text-decoration: none;
display: block;
line-height: 30px;
width: 160px;
height: 30px;
text-align: center;
}
#menu ul ul {
position: absolute;
visibility: hidden;
top: 31px;
}
#menu ul li ul li a:hover {
color: white;
background: #b8e1fc; /* Old browsers */
background: -moz-linear-gradient(top, #b8e1fc 0%, #a9d2f3 10%, #90bae4 25%, #90bcea 37%, #90bff0 50%, #6ba8e5 51%, #a2daf5 83%, #bdf3fd 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b8e1fc), color-stop(10%,#a9d2f3), color-stop(25%,#90bae4), color-stop(37%,#90bcea), color-stop(50%,#90bff0), color-stop(51%,#6ba8e5), color-stop(83%,#a2daf5), color-stop(100%,#bdf3fd)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #b8e1fc 0%,#a9d2f3 10%,#90bae4 25%,#90bcea 37%,#90bff0 50%,#6ba8e5 51%,#a2daf5 83%,#bdf3fd 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #b8e1fc 0%,#a9d2f3 10%,#90bae4 25%,#90bcea 37%,#90bff0 50%,#6ba8e5 51%,#a2daf5 83%,#bdf3fd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #b8e1fc 0%,#a9d2f3 10%,#90bae4 25%,#90bcea 37%,#90bff0 50%,#6ba8e5 51%,#a2daf5 83%,#bdf3fd 100%); /* IE10+ */
background: linear-gradient(to bottom, #b8e1fc 0%,#a9d2f3 10%,#90bae4 25%,#90bcea 37%,#90bff0 50%,#6ba8e5 51%,#a2daf5 83%,#bdf3fd 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b8e1fc', endColorstr='#bdf3fd',GradientType=0 ); /* IE6-9 */
}
#menu ul li:hover ul {
visibility: visible;
font-weight: bold;
}
#menu ul li:hover {
background: #87e0fd; /* Old browsers */
background: -moz-linear-gradient(top, #87e0fd 0%, #53cbf1 40%, #05abe0 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#87e0fd), color-stop(40%,#53cbf1), color-stop(100%,#05abe0)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #87e0fd 0%,#53cbf1 40%,#05abe0 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #87e0fd 0%,#53cbf1 40%,#05abe0 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #87e0fd 0%,#53cbf1 40%,#05abe0 100%); /* IE10+ */
background: linear-gradient(to bottom, #87e0fd 0%,#53cbf1 40%,#05abe0 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#87e0fd', endColorstr='#05abe0',GradientType=0 ); /* IE6-9 */
}
The text shows up but the background doesnt.
[ index.html ]
<div class="Footer">Copyright bla blah</div>
You are opening a p tag and closing with a div tag.
<p class="Footer">Copyright bla blah</p>
Also you have not defined a background color.
Use background-color instead of colorfor it in the css.
Replace
color: #ffffff;
with
background-color: #ffffff;
Sorry i am going to rip your question apart, because someone has to.
Firstly, you are opening with a <p> tag and closing with a </div> tag. This is your first mistake. Secondly, you have not declared a background-color variable at all in the CSS provided. Thirdly, you should never use a <p> tag for ANY BLOCK elements on your page. Always use a <div></div> for your block elements. It is just good practice and valid HTML coding.
In saying that, your code should look something like the following:
[ Style.css]
.Footer {
width: 200px;
border: 1px solid blue;
padding: 5px;
font-weight: bold;
color: #ffffff;
background-color: red;
}
[ index.html ]
<div class="Footer"><p>Copyright bla blah</p></div>
(the <p></p> tag above is purely up to you to have or not as it does allow for more flexibility in your design but not necessary to have.
Hope this helps for future endeavors.
I ned to make the thead scroll left to right when the user scrolls the tbody.
I also need the thead to not show the th that should be hidden if they are not in view.
I tried css overflow but iam not sure if this is the correct way.
Here is the full CSS I use for the table.
I have been stuck on this for over a week now. So thought I would ask
table{
height:300px;
width:980px;
overflow:scroll;
}
#dowithleads, #dowithleads table, thead, #dowithleads tbody{
float:left;
width:980px;
min-height:40px;
margin-top:10px;
-webkit--radius: 8px;
-moz--radius: 8px;
-radius: 8px;
/*background:url("../images/ie/formareabg.png") repeat;*/
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#ffffff), to(#dddddd));
background: -webkit-linear-gradient(#ffffff, #dddddd);
background: -moz-linear-gradient(#ffffff, #dddddd);
background: -ms-linear-gradient(#ffffff, #dddddd);
background: -o-linear-gradient(#ffffff, #dddddd);
background: linear-gradient(#ffffff, #dddddd);
behavior:url(-radius.htc);
}
tr{
width:100%;
}
td,th{
cellspacing:0;
min-width: 100px;
border-bottom:thin solid #999;
line-height:40px;
min-height:40px;
padding-right:5px;
}
th{
line-height:normal;
}
tbody td{
line-height:30px;
min-height:40px;
margin:0 5px;
}
.bigger, .companysize{
min-width:200px;
max-width:200px;
}
tbody tr{
float:left;
:thin solid #999;
-webkit--radius: 8px;
-moz--radius: 8px;
-radius: 8px;
background:url("../images/manage.body.jpg") repeat;
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#ffffff), to(#dddddd));
background: -webkit-linear-gradient(#ffffff, #dddddd);
background: -moz-linear-gradient(#ffffff, #dddddd);
background: -ms-linear-gradient(#ffffff, #dddddd);
background: -o-linear-gradient(#ffffff, #dddddd);
background: linear-gradient(#ffffff, #dddddd);
behavior:url(-radius.htc);
-bottom:none;
}
thead{
color:#fff;
margin:0;
background:url("../images/manage.black.jpg") repeat;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#666666), to(#333333));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(top, #666666, #333333);
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #666666, #333333);
/* IE 10 */
background: -ms-linear-gradient(top, #666666, #333333);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #666666, #333333);
}
tbody{
font-size:12px;
margin:0;
background:#fff;
-bottom:thin solid #999;
}
th.small, td.small{
min-width:40px;
width:40px;
max-width:40px;
}
tr.leadone{
color:#000;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#0099FF), to(#006699));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(top, #0099FF, #006699);
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #0099FF, #00669);
/* IE 10 */
background: -ms-linear-gradient(top, #0099FF, #00669);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #0099FF, #00669);
}
tr.leadred{
color:#000;
background-image: linear-gradient(bottom, rgb(255,81,0) 0%, rgb(255,204,0) 100%);
background-image: -o-linear-gradient(bottom, rgb(255,81,0) 0%, rgb(255,204,0) 100%);
background-image: -moz-linear-gradient(bottom, rgb(255,81,0) 0%, rgb(255,204,0) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(255,81,0) 0%, rgb(255,204,0) 100%);
background-image: -ms-linear-gradient(bottom, rgb(255,81,0) 0%, rgb(255,204,0) 100%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0, rgb(255,81,0)),
color-stop(1, rgb(255,204,0))
);
}
.last{
:none;
}
.page-number, .view-all{
color:#fff;
-webkit--radius: 8px;
-moz--radius: 8px-radius: 8px;
background:#000;
margin:3px;
min-width:30px;
min-height:30px;
line-height:30px;
float:left;
background:url("../images/manage.black.jpg") repeat;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#666666), to(#333333));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(top, #666666, #333333);
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #666666, #333333);
/* IE 10 */
background: -ms-linear-gradient(top, #666666, #333333);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #666666, #333333);
}
#searchbox{
float:right;
width:250px;
text-align:left;
}
#manageleads{
float:left;
width:900px;
}
.ui-state-active{
background:url("../images/manage.active.jpg") repeat;
}
button.manage{
font-size:16px;
width:160px;
float:left;
}
.clickable{
cursor:pointer;
cursor:hand;
margin:0 4px;
}
html>body div.tableContainer {
overflow: hidden;
width: 756px
}
/* define width of table. IE browsers only */
div.tableContainer table {
float: left;
width: 740px
}
/* define width of table. Add 16px to width for scrollbar. */
/* All other non-IE browsers. */
html>body div.tableContainer table {
width: 756px
}
/* set table header to a fixed position. WinIE 6.x only */
/* In WinIE 6.x, any element with a position property set to relative and is a child of */
/* an element that has an overflow property set, the relative value translates into fixed. */
/* Ex: parent element DIV with a class of tableContainer has an overflow property set to auto */
thead.fixedHeader tr {
position: relative
}
/* set THEAD element to have block level attributes. All other non-IE browsers */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */
html>body thead.fixedHeader tr {
display: block
}
/* make the A elements pretty. makes for nice clickable headers */
thead.fixedHeader a, thead.fixedHeader a:link, thead.fixedHeader a:visited {
color: #FFF;
display: block;
text-decoration: none;
width: 100%
}
/* make the A elements pretty. makes for nice clickable headers */
/* WARNING: swapping the background on hover may cause problems in WinIE 6.x */
thead.fixedHeader a:hover {
color: #FFF;
display: block;
text-decoration: underline;
width: 100%
}
/* define the table content to be scrollable */
/* set TBODY element to have block level attributes. All other non-IE browsers */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */
/* induced side effect is that child TDs no longer accept width: auto */
html>body tbody.scrollContent {
display: block;
height: 380px;
overflow: auto;
max-width: 980px;
}
table#manageleads{
width:980px;
height:400px;
overflow:scroll;
}
.ui-datepicker-calendar{
width:300px;
max-width:300px;
}
I answered my own question, to do what I wanted to do I needed to create a DIV overflow box around the table
You have got an interesting problem of yours. However, I believe that it can not be solved only by using CSS.
If I were you I would try to get offset of the body (how much pixels are hidden by the scrooling) by using JavaScript and then make the same offset to head. Try to use dynamic absolute positioning of head's content.
It's just a hint but I have seen something similar done in c# application and it worked.