My html code is
<tr>
<td><input type="image" style="height:25px; width:25px;" src="plus.png"></td>
</tr>
The cell is being created but image is not showing. However, if I use img
tag, it is showing, so no problem with image's src.
EDIT: The CSS linked maybe the problem, but cannot figure out what:-
*{
font-family: Arial, sans;
margin: 0;
padding: 0;
box-sizing: border-box;
-moz-box-sizing: border-box;
}
h1 {
margin: 1em 0;
text-align: center;
}
#container {
margin: 0 auto;
width: 50%;
}
#container input {
height: 2.5em;
visibility: hidden;
}
#container label {
background: #f9f9f9;
border-radius: 1em 1em 0 0;
color: #888;
cursor: pointer;
display: block;
float: left;
font-size: 1em;
height: 2.5em;
line-height: 2.5em;
margin-right: .25em;
padding: 0 1.5em;
text-align: center;
}
#container input:hover + label {
background: #ddd;
color: #666;
}
#container input:checked + label {
background: #DBF3FD;
color: #444;
position: relative;
z-index: 6;
/*
-webkit-transition: .1s;
-moz-transition: .1s;
-o-transition: .1s;
-ms-transition: .1s;
*/
}
#content {
background: #DBF3FD;
border-radius: 0 .25em .25em .25em;
min-height: 18em;
position: relative;
width: 100%;
z-index: 5;
}
#content div {
opacity: 0;
padding: 1.5em;
position: absolute;
z-index: -100;
}
#content-1 p {
clear: both;
margin-bottom: 1em;
}
#content-1 p.last {
margin-bottom: 0;
}
#content-2 p {
float: left;
width: 48.5%;
}
#content-2 p.column-right {
margin-left: 3%;
}
#content-3 p {
float: left;
width: 48.5%;
}
#content-3 p.column-right {
margin-left: 3%;
}
#container input#tab-1:checked ~ #content #content-1,
#container input#tab-2:checked ~ #content #content-2,
#container input#tab-3:checked ~ #content #content-3
{
opacity: 1;
z-index: 100;
}
input.visible {
visibility: visible !important;
}
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(odd) {
background-color: #FFFFFF;
}
table {
border-collapse: collapse;
width: 100%;
}
th, td {
padding: 8px;
text-align: left;
border-bottom: 1px solid #ddd;
}
tr:hover{background-color:#96DCF7}
In your code, you write that input:
input.visible {
visibility: visible !important;
}
But you also have:
input {
visibility: hidden;
}
You never refer to the .visible class on the code you show us, so it stays hidden. Maybe this is the problem. Try adding class="visible"
to the input.
<tr>
<td>
<input class="visible" type="image" style="height:25px; width:25px;" src="plus.png">
</td>
</tr>
Try with css. Add style=" background-image: url("plus.png");"
to input tag. input type="image"
is not valid property of type attribute.
This seems to be a problem with the other code interacting with your html. The following code works for me:
<table>
<thead>
<tr>
<th>Image</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="image" src="Image.png"></td>
</tr>
</tbody>
</table>
Maybe you should start here and then add your styles back little by little until you find whatever caused the problem.
EDIT: I copied all the code you have put here and assumed that you had a div with an id of container and another div with an id of content and that your table lived in there. Following @Benjamin Naesen's advice I set the visibility to visible and the picture appeared.
input.visible {
visibility: visible;
}
Did this work for you?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.