HTML if image is not found

后端 未结 16 2039
温柔的废话
温柔的废话 2020-12-07 13:46

I have an image in a HTML page:

\"Smiley

If the image is not found o

16条回答
  •  甜味超标
    2020-12-07 14:06

    If you want an alternative image instead of a text, you can as well use php:

    $file="smiley.gif";
    $alt_file="alt.gif";
    if(file_exist($file)){
         echo "";
    }else if($alt_file){
         // the alternative file too might not exist not exist
         echo "";
    }else{
      echo "smily face";
    }
    

提交回复
热议问题