有没有办法为alt设计风格?用javascript?有伪属性?像这样:
<img src="foo.jpg" alt="<h1>This is the caption</h1><p>This is some text</p><p>Another text</p>" />
Run Code Online (Sandbox Code Playgroud)
??
和javascript(我使用JQuery框架)做这样的事情?
Get value of <alt> from <img>
make value between <h1></h1> css font-size:22px; color:green;
make value between <p></p> css font-size:14px; color:black;
Run Code Online (Sandbox Code Playgroud)
BTW:javascript读取图像的alt-tag并在屏幕上显示..所以这个alt文本不仅会显示如果img没有加载.