Home  >  Article  >  Web Front-end  >  After editing the table style, why does the table deform when I insert a picture? _html/css_WEB-ITnose

After editing the table style, why does the table deform when I insert a picture? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:01:532493browse

8c1dad92bdc22b1f48134da22e0e7c2c
a34de1251f0d9fe1e645927f19a896e83d0ac77c9d6d6f286920a794901e89cc
e030351871c69acc5b3a7dc2a6bbdc64
a34de1251f0d9fe1e645927f19a896e8564d42ce3fd1c4cdf6871c6dececde23最新教程b90dd5946f0946207856a8a37f441edffd273fcf5bcad3dfdad3c41bd81ad3e5
a34de1251f0d9fe1e645927f19a896e8d90c57af2b4807bc6f7900d53982e3cc837aaaf71591537aa0311ee0e08b8d9db90dd5946f0946207856a8a37f441edfd90c57af2b4807bc6f7900d53982e3ccb90dd5946f0946207856a8a37f441edfd90c57af2b4807bc6f7900d53982e3ccb90dd5946f0946207856a8a37f441edfd90c57af2b4807bc6f7900d53982e3ccb90dd5946f0946207856a8a37f441edffd273fcf5bcad3dfdad3c41bd81ad3e5
f16b1740fad44fb09bfe928bcc527e08b90dd5946f0946207856a8a37f441edf
53495428ccf9f1aae01f9469cf423213b90dd5946f0946207856a8a37f441edffd273fcf5bcad3dfdad3c41bd81ad3e5
f16b1740fad44fb09bfe928bcc527e08
以下是对应的CSS外部样式表:
#leftA{
width:660px;
height:200px;
}

#rightA{
width:220px;
height:200px;
}

#contentA{
width:660px;
height:170px;
}
.titleA{
width:66px;
height:25px;
font-weight:600;
font-size:16px;
color:#990066;
padding-left:35px;
background:url(../picture/xinzhi.jpg)
}

.hot{
width:165px;
height:120px; 
text-align:center;
}

.hot img{
width:140px;
height:100px;
border:#003366 1px solid;
}
插入hot1图片前,表格正常:

插入hot1图片后,无论图片缩放多小,表格都变形:


目前只学习了html及css,其他的还没有学。
请帮我看看怎么回事,哪里出问题了,谢谢!!!



回复讨论(解决方案)

<!DOCTYPE HTML><head><title>数据</title><meta characterset="utf-8" /><style type="text/css">	#leftA{width:660px;height:200px;}#rightA{width:220px;height:200px;}#contentA{width:660px;height:170px;}.titleA{width:66px;height:25px;font-weight:600;font-size:16px;color:#990066;padding-left:35px;background:url(../picture/xinzhi.jpg)}/********************************************************骚年,id的css选择器对应的是:"#";而你用的.hot对应的应该是class.		ID:          class:	#test{		background-color:red;	}				HTML:				<div id="test">abc</div>		class:		css:		.tes{		background-color:red;		}				HTML:				<div class="tes">abcdef</div>	每个页面只能有一个id,但是可以有多个class.****************************************************************/.hot{width:165px;height:120px; text-align:center;overflow: hidden;/*超出部分自动隐藏*/}.hot img{width:140px;height:100px;border:#003366 1px solid;overflow: hidden;/*超出部分自动隐藏*/}</style> </head><body><table cellpadding="0" cellspacing="0" border="1" align="center"><tr><td id="leftA"><table cellpadding="0" cellspacing="0" border="1" id="contentA"><tr><td class="titleA" colspan="4">最新教程</td></tr><tr><td class="hot"><img src="picture/hot1.jpg" /></td><td class="hot"></td><td class="hot"></td><td class="hot"></td></tr></table></td><td id="rightA"></td></tr></table></body></html>


你用错css选择器了,你看下,可以了

效果

老师说的太好了,还是自己不认真啊,哈哈……谢谢了!!!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn