I am new to CSS and encountered a strange problem. After removing the float, I cannot see the background image, and the span element cannot be found on firebug. What is the reason?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>文本框中的事件应用</title> <style type="text/css"> .spnInit{width:179px;height:40px;line-height:40px;float:right;background: url('Images/pic_Email_ok.gif') no-repeat;} </style></head><body> <span id="spnTip" class="spnInit"></span></body></html>
In addition, if the float attribute is not used, how to display the background image?
Isn’t this okay?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>文本框中的事件应用</title> <style type="text/css"> .spnInit{width:179px;height:40px;line-height:40px;background: url('Images/pic_Email_ok.gif') no-repeat;} </style></head><body> <span id="spnTip" class="spnInit"><pre class="brush:php;toolbar:false">dfasdfasdssssssssssssssssssssssssssssdfasdfsdfasdfasdfasdfas