How to remove padding (cellpadding) from the <td> element? - html

I am building a simple calculator using HTML, CSS, and JS. My question is how to remove the padding of the element inside my calculator table.
Visuals
To remove spacing between elements in HTML, googling suggests adding the attributes cellspacing="0" cellpadding="0" to the element, which I did. It also suggests adding a CSS selector table { border-collapse: collapse}. However, border-collapse does not work as I expected: the padding does not get removed, and the table corners become wrecked.
/* Global CSS */
*,
*::before,
*::after {
box-sizing: border-box;
}
:root {
--calc-bg: rgb(184, 243, 216);
--btn-bg: rgb(252, 246, 230);
--active-btn-bg: rgb(106, 200, 153);
--main-btn-bg: rgb(71, 202, 143);
--text-color: rgb(45, 53, 44);
--display-bg: rgb(252, 246, 230);
}
/* Calculator CSS */
#import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght#900&display=swap');
.calculator {
font-family: 'Source Code Pro', monospace;
font-weight: 900;
padding: 10px;
border-radius: 2em;
height: 580px;
width: 500px;
margin: auto;
background-color: var(--calc-bg);
border: solid rgb(45, 52, 42) 5px;
-webkit-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
-moz-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
}
.display-box {
background-color: var(--display-bg);
border: solid black 0.5px;
color: black;
border-radius: 1em;
width: 100%;
height: 80px;
-webkit-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
-moz-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
}
#btn {
background-color: var(--main-btn-bg);
}
th,
td {
padding: 0;
}
td {
text-align: center;
vertical-align: middle;
}
input[type=button] {
font-weight: 900;
background-color: var(--btn-bg);
color: var(--text-color);
border: solid rgb(45, 52, 42) 2px;
width: 4rem;
border-radius: 10%;
height: 4rem;
outline: none;
-webkit-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
-moz-box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
box-shadow: 3px 3px 0px 2px rgb(45, 52, 42);
}
input:active[type=button] {
background: var(--active-btn-bg);
transition-duration: 100ms;
transition-timing-function: ease-out;
<table class="calculator" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"> <input class="display-box" type="text" id="result" disabled /> </td>
<!-- clearScreen() function clears all the values -->
<td> <input type="button" value="C" onclick="clearScreen()" id="btn" /> </td>
</tr>
<tr>
<!-- display() function displays the value of clicked button -->
<td> <input type="button" value="1" onclick="display('1')" /> </td>
<td> <input type="button" value="2" onclick="display('2')" /> </td>
<td> <input type="button" value="3" onclick="display('3')" /> </td>
<td> <input type="button" value="/" onclick="display('/')" /> </td>
</tr>
<tr>
<td> <input type="button" value="4" onclick="display('4')" /> </td>
<td> <input type="button" value="5" onclick="display('5')" /> </td>
<td> <input type="button" value="6" onclick="display('6')" /> </td>
<td> <input type="button" value="-" onclick="display('-')" /> </td>
</tr>
<tr>
<td> <input type="button" value="7" onclick="display('7')" /> </td>
<td> <input type="button" value="8" onclick="display('8')" /> </td>
<td> <input type="button" value="9" onclick="display('9')" /> </td>
<td> <input type="button" value="+" onclick="display('+')" /> </td>
</tr>
<tr>
<td> <input type="button" value="." onclick="display('.')" /> </td>
<td> <input type="button" value="0" onclick="display('0')" /> </td>
<!-- calculate() function evaluates the mathematical expression -->
<td> <input type="button" value="=" onclick="calculate()" id="btn" /> </td>
<td> <input type="button" value="*" onclick="display('*')" /> </td>
</tr>
</table>
} ```

Changing the width and height of the table and its elements, along with using border-collapse: collapse and border-spacing: 0 helped to solve the issue

Related

Content in absolute positioned div is overflowing

I have a weird question, and perhaps it's more suitable for the CSS fans out there, but why would content inside an absolute positioned div overflow out past everything else?
The example provided here (as a picture) shows that the content overflows out the blue bordered div. The content inside this box should rightfully define the the div's height no? How can this be remedied so that my 'blue' box fits to its content?
Here's the markup in question:
* {
box-sizing: border-box;
font-family: Verdana, Arial, sans-serif;
font-size: 9pt;
}
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
height: 100%;
background: rgb(105, 105, 105);
}
#table-container {
display: table;
text-align: center;
width: 100%;
height: 100%;
}
#container {
display: table-cell;
vertical-align: middle;
}
#wrapper {
padding: 25px;
}
.tabs {
position: relative;
margin: 40px 0 25px;
}
.tab {
float: left;
}
.tab label {
background: rgb(105, 105, 105);
padding: 10px;
border: 1px solid transparent;
color: #FFF;
margin-left: -1px;
position: relative;
left: 1px;
top: -26px;
}
.tab label:hover {
background: #000;
}
.tab [type=radio] {
display: none;
}
.content {
position: absolute;
top: -1px;
left: 0;
background: rgb(222, 222, 222);
right: 0;
bottom: 0;
padding: 20px;
border: 1px solid transparent;
opacity: 0;
color: rgb(58, 58, 58);
}
[type=radio]:checked~label {
background: rgb(222, 222, 222);
font-weight: bold;
border-bottom: 1px solid transparent;
color: #000;
z-index: 2;
}
[type=radio]:checked~label~.content {
z-index: 1;
opacity: 1;
}
/* CSS for Table and Field styling */
.table {
width: 100%;
padding: 0;
margin: 0;
text-align: left;
}
.table td {
border: 1px solid #000;
}
.inputbox {
border: 1px solid rgb(170, 170, 170);
width: 100%;
}
.inputbox:hover {
border: 1px solid rgb(109, 109, 109);
}
.input {
border-style: none;
border-color: inherit;
border-width: 0;
padding: 3px;
height: 20px;
}
input[type="text"],
textarea {
width: 100%;
box-sizing: border-box;
}
.input:focus {
background: rgb(255, 255, 196);
}
<div id="table-container">
<div id="container">
<div id="wrapper">
<div style="border: 1px solid red; text-align: left; font-size: 8pt; color: #fff;">Choose language/Choisissez langue:</div>
<div style="border: 1px solid blue; height: 100%;">
<div class="tabs">
<!-- TAB [1] -->
<div class="tab">
<input type="radio" id="tab-1" name="tab-group-1" checked><label for="tab-1">English</label>
<div class="content">
<table class="table">
<tr>
<td>Traveller's Name:</td>
<td colspan="2">
<div class="inputbox"><input type="text" id="tname" class="input" name="Name of Traveler" tabindex="1" /></div>
</td>
<td style="width: 15%;"></td>
<td>Tan #:</td>
<td></td>
</tr>
<tr>
<td>Destination:</td>
<td colspan="2">
<div class="inputbox"><input type="text" id="location" class="input" name="Location" tabindex="2" /></div>
</td>
<td></td>
<td>Status:</td>
<td></td>
</tr>
<tr>
<td>iTravel Trip Number:</td>
<td colspan="2">
<div class="inputbox"><input type="text" id="location" class="input" name="Location" tabindex="2" /></div>
</td>
<td></td>
<td>Date Issued:</td>
<td>
<div class="inputbox"><input type="text" id="dissued" class="input" disabled/></div>
</td>
</tr>
<tr>
<td>Event Plan ID Code:</td>
<td colspan="2">
<div class="inputbox"><input type="text" id="evt-plan-code" class="input" name="Event Plan ID Code" tabindex="4" /></div>
</td>
<td></td>
<td>Issued by:</td>
<td>
<div class="inputbox"><input type="text" id="issuer" class="input" disabled/></div>
</td>
</tr>
<tr>
<td>Dates of Travel</td>
<td>From:</td>
<td>
<div id="ddate" name="Departure Date" tabindex="5"></div>
</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td> </td>
<td>To:</td>
<td>
<div id="rdate" name="Return Date" tabindex="6"></div>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Trip Purpose</td>
<td colspan="3"></td>
<td></td>
<td></td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-2" name="tab-group-1"><label for="tab-2">Français</label>
<div class="content">
tab2
</div>
</div>
</div>
</div>
<div style="border: 1px solid green; text-align: left;">
<input type="button" value="Issue TAN" id="issue">
<input type="button" value="Reset form" id="issue">
<input type="button" value="Save changes" id="issue">
</div>
</div>
<!-- end of div #wrapper -->
</div>
<!-- end of div #container -->
</div>
<!-- end of div #table-container -->
The absolute-positioned div doesn't affect the container div's size since setting position to absolute removes it from the document flow. It's essentially the same behaviour as when position is set to fixed, except it stays at the same place in the page when you scroll. More info can be found here and here.
As for how to fix the height of your div, the short answer is that it can't be done with CSS unless you use a different value for position, perhaps relative in your case but that will depend on the structure of your html. This question covers some other ways that you could go about it.

Two columns are not divided equally in Mailchimp advanced mode

I am creating a form with table in Mailchimp Advanced mode. I can't divide the 2 columns 50% - 50%. I don't know why the left column takes more space than the right.
.formLabel {
vertical-align: top;
font-size: 14px;
color: #4d858d;
font-weight: bold;
text-align: left;
margin: 22px;
padding: 10 15 10 15;
width: auto;
}
.container {
background-color: #FFFFFF;
width: 700px;
border: none;
padding: 5 5 15 5;
margin-left: auto;
margin-right: auto;
}
ul,li {
margin: 0;
padding: 0;
list-style: none;
}
body {
background-color: #FFFFFF;
font-family: verdana;
font-size: 12px;
text-align: center;
min-width: 700px;
margin: 20 0 0 0;
}
input[type="text"] {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background-color: #F5F5F5;
border-width: 0px;
border-style: solid;
width: 100%;
max-width: 100%;
font-size: 14px;
padding: 6 10 6 10;
box-sizing: border-box;
font-weight: normal;
box-shadow: 0 3px 0px rgba(0, 0, 0, 0.075);
}
.select-small {
width: 100%;
height: 27;
webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background-color: #F5F5F5;
border-width: 0px;
border-style: solid;
width: 100%;
max-width: 100%;
box-shadow: 0 3px 0px rgba(0, 0, 0, 0.075);
}
<tr>
<td align="left" class="formLabel">Anrede <span class="req asterisk">*</span>
<br>
<div class="interestgroup_field radio-group" id="MERGE3">
<label class="radio" for="MERGE3-0">
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="MERGE3" id="MERGE3-0" value="Herr" class="av-radio"><span>Herr</span></label>
<label class="radio" for="MERGE3-1">
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="MERGE3" id="MERGE3-1" value="Herr" class="av-radio"><span>Frau</span></label>
<label class="radio" for="MERGE3-2">
<input type="radio" data-dojo-type="dijit/form/RadioButton" name="MERGE3" id="MERGE3-2" value="Dr" class="av-radio"><span>Dr</span></label>
</div>
<br>
<div class="error">*|HTML:MMERGE3ERROR|*</div>
</td>
</tr>
<tr>
<td align="left" class="formLabel">Vorname <span class="req asterisk">*</span>
<br>
<input type="text" name="MERGE1" id="MERGE1" size="35" value="*|MERGE1|*">
<br>
<div class="error">*|HTML:FNAMEERROR|*</div>
</td>
<td align="left" class="formLabel">Nachname <span class="req asterisk">*</span>
<br>
<input type="text" name="MERGE2" id="MERGE2" size="35" value="*|MERGE2|*">
<br>
<div class="error">*|HTML:LNAMEERROR|*</div>
</td>
</tr>
<tr>
<td align="left" class="formLabel">Position
<br>
<input type="text" name="MERGE5" id="MERGE5" value="*|MERGE5|*">
<br>
<div class="error">*|HTML:MMERGE5ERROR|*</div>
</td>
<td align="left" class="formLabel">Firma <span class="req asterisk">*</span>
<br>
<input type="text" name="MERGE6" id="MERGE6" value="*|MERGE6|*">
<br>
<div class="error">*|HTML:MMERGE6ERROR|*</div>
</td>
</tr>
There are two things wrong with this code
You are missing the code to start and end a table <table width="100%" border="0" cellspacing="0" cellpadding="0"> and </table>
Your HTML closes before the the style tags.
Fix those two things and your form takes shape.
<html>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="left" class="formLabel">Anrede <span class="req asterisk">*</span><br>
<div class="interestgroup_field radio-group" id="MERGE3"> <label class="radio" for="MERGE3-0"><input type="radio" data-dojo-type="dijit/form/RadioButton" name="MERGE3" id="MERGE3-0" value="Herr" class="av-radio"><span>Herr</span></label><label class="radio" for="MERGE3-1"><input type="radio" data-dojo-type="dijit/form/RadioButton" name="MERGE3" id="MERGE3-1" value="Herr" class="av-radio"><span>Frau</span></label><label class="radio" for="MERGE3-2"><input type="radio" data-dojo-type="dijit/form/RadioButton" name="MERGE3" id="MERGE3-2" value="Dr" class="av-radio"><span>Dr</span></label> </div>
<br><div class="error">*|HTML:MMERGE3ERROR|*</div>
</td>
</tr>
<tr>
<td align="left" class="formLabel">Vorname <span class="req asterisk">*</span><br>
<input type="text" name="MERGE1" id="MERGE1" size="35" value="*|MERGE1|*">
<br> <div class="error">*|HTML:FNAMEERROR|*</div>
</td>
<td align="left" class="formLabel">Nachname <span class="req asterisk">*</span><br>
<input type="text" name="MERGE2" id="MERGE2" size="35" value="*|MERGE2|*">
<br> <div class="error">*|HTML:LNAMEERROR|*</div>
</td>
</tr>
<tr>
<td align="left" class="formLabel">Position <br>
<input type="text" name="MERGE5" id="MERGE5" value="*|MERGE5|*">
<br> <div class="error">*|HTML:MMERGE5ERROR|*</div>
</td>
<td align="left" class="formLabel">Firma <span class="req asterisk">*</span><br>
<input type="text" name="MERGE6" id="MERGE6" value="*|MERGE6|*">
<br> <div class="error">*|HTML:MMERGE6ERROR|*</div>
</td>
</tr>
</tr>
</table>
<style> .formLabel {
vertical-align: top;
font-size: 14px;
color: #4d858d;
font-weight: bold;
text-align: left;
/*margin: 22px;
padding: 10 15 10 15;*/
width: auto;
border:1px solid #000000;
}
.container {
background-color: #FFFFFF;
width: 700px;
border: none;
/*padding: 5 5 15 5;*/
margin-left: auto;
margin-right: auto;
} ul,
li {
margin: 0;
padding: 0;
list-style: none;
} body {
background-color: #FFFFFF;
font-family:verdana;
font-size: 12px;
text-align: center;
min-width: 700px;
margin: 20 0 0 0;
} input[type="text"] {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background-color: #F5F5F5;
border-width: 0px;
border-style: solid;
width: 100%;
max-width: 100%;
font-size: 14px;
padding: 6 10 6 10;
box-sizing: border-box;
font-weight: normal;
box-shadow: 0 3px 0px rgba(0, 0, 0, 0.075); }
.select-small {
width: 100%;
height: 27;
webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background-color: #F5F5F5;
border-width: 0px;
border-style: solid;
width: 100%;
max-width: 100%;
box-shadow: 0 3px 0px rgba(0, 0, 0, 0.075); }
</style></html>
Let me know if this is what you were after.

Create an overlay over a table column

I have a table with 5 columns (city, 1st quarter, 2nd quarter, 3rd quarter, 4th quarter).
I want that if we already passed a quarter to display an overlay over that quarter's column. My problem is how to make an overlay that covers the whole column. I tried a solution but it would not cover the cell padding. Anybody has an idea how to approach that? Here is my code:
http://jsfiddle.net/7kp3atp7/1/
This is happening because there are spaces between table td. You can either use border-collapse: collapse or modify your current implementation. For example i create an overlay using pseudo-element :after and apply it to all td that has class disable:
/* line 452, ../sass/screen.scss */
.year-calendar {
width: 918px;
margin: 0 auto;
min-height: 260px;
height: auto;
background-color: #ffffff;
border: 8px solid transparent;
padding: 0px;
box-shadow: 1px 1px 30px 1px #adb2b7;
display: block;
border-radius: 8px 8px;
-o-border-radius: 8px 8px;
-ms-border-radius: 8px 8px;
-moz-border-radius: 8px 8px;
-webkit-border-radius: 8px 8px;
}
/* line 463, ../sass/screen.scss */
.year-calendar th, .year-calendar tr {
margin: 0;
padding: 0;
height: 40px;
text-align: center;
}
/* line 470, ../sass/screen.scss */
.year-calendar th {
font-family:"Gotham Medium";
font-size: 15px;
background-color: #0070b9;
border: 0;
border-right: 1px solid #adb2b7;
border-left: 1px solid #adb2b7;
border-top: none;
color: #ffffff;
display: table-cell;
width: 182px;
}
/* line 481, ../sass/screen.scss */
.year-calendar th:first-child {
text-align: left;
border-top-left-radius: 5px;
}
/* line 482, ../sass/screen.scss */
.year-calendar th:last-child {
border-top-right-radius: 5px;
}
/* line 484, ../sass/screen.scss */
.year-calendar td {
border: 0;
width: 182px;
border-right: 1px solid #adb2b7;
border-left: 1px solid #adb2b7;
font-family:"Gotham Medium";
font-size: 13px;
}
/* line 496, ../sass/screen.scss */
.year-calendar tr {
border: 0;
border-top: 1px solid #adb2b7;
border-bottom: 1px solid #adb2b7;
}
/* line 501, ../sass/screen.scss */
.year-calendar tr td:first-child, .year-calendar tr th:first-child {
border-left: none;
}
/* line 502, ../sass/screen.scss */
.year-calendar tr td:last-child, .year-calendar tr th:last-child {
border-right: none;
}
/* line 504, ../sass/screen.scss */
.year-calendar tr:first-child {
border-top: none;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
/* line 509, ../sass/screen.scss */
.year-calendar tr:last-child {
border-bottom: none;
}
/* line 511, ../sass/screen.scss */
.year-calendar tr:last-child td:first-child {
border-bottom-left-radius: 8px;
}
/* line 514, ../sass/screen.scss */
.year-calendar tr:last-child td:last-child {
border-bottom-right-radius: 8px;
}
td, th {
position:relative;
}
td.disable:after {
content:"";
position:absolute;
background-color:black;
display:block;
width:100%;
height:100%;
top:0px;
left: -5px;
padding-left: 4px;
padding-right: 5px;
}
<table class="table year-calendar">
<thead>
<tr>
<th>City</th>
<th><span class="q1"></span>Q1</th>
<th>Q2</th>
<th>Q3</th>
<th>Q4</th>
</tr>
</thead>
<tbody>
<tr>
<td>New York</td>
<td class="reserved disable"><span class="q1"></span>
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
</tr>
<tr>
<td>San Francisco</td>
<td class="reserved disable"><span class="q1"></span>
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="available active">
<input name="" type="checkbox" value="1" checked="checked" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Boston</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Dallas</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Chicago</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
</tbody>
</table>
Or in your example using border-collapse: collapse:
/* line 452, ../sass/screen.scss */
.year-calendar {
width: 918px;
margin: 0 auto;
min-height: 260px;
height: auto;
background-color: #ffffff;
border: 8px solid transparent;
padding: 0px;
box-shadow: 1px 1px 30px 1px #adb2b7;
display: block;
border-radius: 8px 8px;
-o-border-radius: 8px 8px;
-ms-border-radius: 8px 8px;
-moz-border-radius: 8px 8px;
-webkit-border-radius: 8px 8px;
border-collapse: collapse;
}
/* line 463, ../sass/screen.scss */
.year-calendar th,
.year-calendar tr {
margin: 0;
padding: 0;
height: 40px;
text-align: center;
}
/* line 470, ../sass/screen.scss */
.year-calendar th {
font-family: "Gotham Medium";
font-size: 15px;
background-color: #0070b9;
border: 0;
border-right: 1px solid #adb2b7;
border-left: 1px solid #adb2b7;
border-top: none;
color: #ffffff;
display: table-cell;
width: 182px;
}
/* line 481, ../sass/screen.scss */
.year-calendar th:first-child {
text-align: left;
border-top-left-radius: 5px;
}
/* line 482, ../sass/screen.scss */
.year-calendar th:last-child {
border-top-right-radius: 5px;
}
/* line 484, ../sass/screen.scss */
.year-calendar td {
border: 0;
width: 182px;
border-right: 1px solid #adb2b7;
border-left: 1px solid #adb2b7;
font-family: "Gotham Medium";
font-size: 13px;
}
/* line 496, ../sass/screen.scss */
.year-calendar tr {
border: 0;
border-top: 1px solid #adb2b7;
border-bottom: 1px solid #adb2b7;
}
/* line 501, ../sass/screen.scss */
.year-calendar tr td:first-child,
.year-calendar tr th:first-child {
border-left: none;
}
/* line 502, ../sass/screen.scss */
.year-calendar tr td:last-child,
.year-calendar tr th:last-child {
border-right: none;
}
/* line 504, ../sass/screen.scss */
.year-calendar tr:first-child {
border-top: none;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
/* line 509, ../sass/screen.scss */
.year-calendar tr:last-child {
border-bottom: none;
}
/* line 511, ../sass/screen.scss */
.year-calendar tr:last-child td:first-child {
border-bottom-left-radius: 8px;
}
/* line 514, ../sass/screen.scss */
.year-calendar tr:last-child td:last-child {
border-bottom-right-radius: 8px;
}
td,
th {
position: relative;
}
.q1 {
position: absolute;
background-color: black;
display: block;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
}
<table class="table year-calendar">
<thead>
<tr>
<th>City</th>
<th><span class="q1"></span>Q1</th>
<th>Q2</th>
<th>Q3</th>
<th>Q4</th>
</tr>
</thead>
<tbody>
<tr>
<td>New York</td>
<td class="reserved disable"><span class="q1"></span>
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="reserved disable">
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
</tr>
<tr>
<td>San Francisco</td>
<td class="reserved disable"><span class="q1"></span>
<input name="" type="checkbox" value="1" checked="checked" disabled="disabled" />
</td>
<td class="available active">
<input name="" type="checkbox" value="1" checked="checked" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Boston</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Dallas</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
<tr>
<td>Chicago</td>
<td class="available"><span class="q1"></span>
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
<td class="available">
<input name="" type="checkbox" value="1" />
</td>
</tr>
</tbody>
</table>

CSS : Border in IE8

I have dialog with html :
<div id="sample">
<div class="sample-wraper">
<a class="modal_close" href="#"></a>
<form id="Form1" name="Form1" method="post">
<table id="tt">
<tr align="center">
<td colspan="2" id="naam"><b>Cha test</b></td>
</tr>
<tr>
<td colspan="2">
<div id="boodschap" class="text" style="border-right: 1px solid; border-top: 1px solid; overflow: auto;
border-left: 1px solid; width: 468px; height: 182px; border-bottom: 1px solid;
background-color: white">njnknkkm</div>
</td>
</tr>
<tr>
<td colspan="2">
<textarea id="antwoord" name="antwoord" class="text"
style="width: 465px; height: 182px; border-width: 1px; border-style: solid; border-color: black;"
onkeydown="textCounter(antwoord,aantal,1000)"
onkeyup="textCounter(antwoord,aantal,1000)"></textarea>
</td>
</tr>
<tr>
<td class="text" align="left" width="210">
Caráters permitidas
<input readonly type="text" name="aantal" size="3" maxlength="4" value="1000" id="aantal"></td>
<td align="right">
<input id="Submit" name="Submit" type="button" value="Enviar" onclick="submitForm();"
class="button" style="width: 130px">
</td>
</tr>
</table>
<input id="IdTo" name="IdTo" type="hidden">
</form>
</div>
and css like this :
#sample {
background: none repeat scroll 0 0 #FFFFFF;
border-radius: 5px;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
border: 1px solid;
display: none;
padding: 15px 10px 10px;
position:absolute !important;
}
.modal_close {
background: url("Close-icon-download-182005456677-png/button.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Close-icon-download-182005456677-png/button.png',sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Close-icon-download-182005456677-png/button.png',sizingMethod='scale')";
display: block;
height: 20px;
position: absolute;
right: 10px;
top: 10px;
width: 20px;
z-index: 2;
}
Problem is that in IE8 on this dialog in top-left corner i get some square, which disappears if i remove border from dialog (#sample).
http://clip2net.com/s/i6klpi (sample of problem)
In IE7 and IE9 i didn't get this "feature" in corner.
I found this post about problem with IE borders http://www.brasee.com/displayPost.htm?postId=64. As my dialog is with position absolute (this is for not moving dialog when scrolls) i add wrapper of this dialog. So i set for dialog position relative and for wrapper position absolute. But this also didn't help. Get this result: clip2net.com/s/i6lcKz

CSS/HTML: Input fields not using CSS styles

I want to style the text input areas on my form, however when I create a style for input in css, it does not actually style the input box. I have been able to style my button, just not input boxes.
<div class="loginContainer">
<form action ="" method="post">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<label for="username" class="label">Username</label>
</td>
<td width="150">
<input type="text" name="username" size="25" id="username" autocomplete="off" />
</td>
</tr>
<tr>
<td>
<label for="password" class="label">Password</label>
</td>
<td width="150">
<input type="password" name="password" size="25" id="password" autocomplete="off" />
</td>
</tr>
<input type="hidden" name="token" value="<?php echo Token::generate(); ?>">
<tr>
<td>
<label for="remember">
<input type="checkbox" name="remember" id="remember"> Keep me signed in
</td>
</tr>
<tr>
<td>
<input type="submit" class="submit" value="Log in">
</td>
</tr>
</table>
</form>
And here is the CSS for it:
input[type="text"] {
padding: 4px;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
box-shadow: 0px 0px 8px #d9d9d9;
-moz-box-shadow: 0px 0px 8px #d9d9d9;
-webkit-box-shadow: 0px 0px 8px #d9d9d9;
display: block;
}
This ends up creating a form which creates: http://i.imgur.com/9Hj9Vie.png
Note the lack of style on the input fields. How should I go about fixing this?
It's kind of strange that the border radius is not applied, you can try the following ( note the lack of quotes ):
input[type=text] {
padding: 4px;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
box-shadow: 0px 0px 8px #d9d9d9;
-moz-box-shadow: 0px 0px 8px #d9d9d9;
-webkit-box-shadow: 0px 0px 8px #d9d9d9;
display: block;
/* new stuff */
border: 1px solid pink;
outline: 1px solid green;
background: orange;
}
If you want the for the password field also to be styled you need to add that tag in the style as well, like this:
input[type=text], input[type=password] {
padding: 4px;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
box-shadow: 0px 0px 8px #d9d9d9;
-moz-box-shadow: 0px 0px 8px #d9d9d9;
-webkit-box-shadow: 0px 0px 8px #d9d9d9;
display: block;
}