मैं ऊपरी तालिका पंक्ति को अपने बच्चे div (cp2) का आकार रखना चाहता हूं, लेकिन मैं ऊंचाई को नियंत्रित नहीं कर सका। मैंने मार्जिन, पैडिंग, ऊंचाई, टेबल table-layout
सीएसएस-विशेषता को संशोधित करने का प्रयास किया, लेकिन यह काम नहीं करना चाहता।एचटीएमएल सीएसएस तालिका पंक्ति ऊंचाई काम नहीं कर रही
कोड:
<!DOCTYPE html>
<html>
<head>
<style>
.cp1{
display: inline-block;
width: 32px;
height: 32px;
background-color: red;
vertical-align: top;
}
.cp2{
display: inline-block;
width: 128px;
height: 10px;
background-color: black;
vertical-align: top;
margin:0px;
margin-left: 10px;
}
.out{
display: inline-block;
width: 3em;
height: 1.2em;
background-color: red;
vertical-align: top;
margin-left: 10px;
}
td,tr{
padding: 0px;
margin:0px;
}
table{
border: 0px;
table-layout:fixed;
}
.in{
height: 1.2em;
padding: 0px;
margin-left: 10px;
vertical-align: top;
}
</style>
</head>
<body>
<table>
<tr>
<td rowspan="2">
<input type="checkbox">cb1 <br/>
</td>
<td rowspan="2" style="padding-left: 10px;">
<div class="cp1"></div>
</td>
<td style="height: 1px;">
<div class="cp2"></div>
</td>
</tr>
<tr>
<td>
<div class="out"></div><input class="in" type="text" size="3">
</td>
</tr>
</table>
</body>
</html>
धन्यवाद
क्या आपने प्रदर्शन करने की कोशिश की है: ब्लॉक; अपने सीपी 2 div के लिए इनलाइन-ब्लॉक की बजाय? –
@ मार्क-इमानुअलरमेज धन्यवाद, हाँ, यह समस्या थी, लेकिन मैंने सोचा कि मुझे मार्जिन के लिए इसकी आवश्यकता होगी। – xoxox