我已经提到了这个question,但它有助于我。我试图改变span标签高度和宽度内的图像标签,但它不工作,这是我的代码:无法更改图像标记内的跨度高度和宽度
HTML
<img class="profile_pic" alt="Sumanth Jois" src="file/someimage">
<span class="changePicture">HelloThere</span>
</img>
的CSS
//There are many spans so I am using the . operator to specify
span.changePicture{
width: 100px;
height:200px;
background-color:red;
margin-left: -150px;
color: white;
margin-top: -20px;
}
我我无法使用此代码更改宽度和高度。我知道我可以如何解决这个问题吗?
THANKYOU
可能重复[高度和宽度是否不适用于跨度?]( http://stackoverflow.com/questions/2491068/does-height-and-width-not-apply-to-span) –
''?必须是这样的'
'你不能在里面添加html –
winresh24
浏览器不会在'img'中嵌套'span',因为'img'不能是父类。浏览器会把它放在'img'下面,而忽略/删除'' – 4castle