开发者

CSS print preview - show image/link URLs

I'm creating a print stylesheet and I w开发者_如何学Pythonant to make the site as accessible as possible by displaying the link URL next to links, and images.

For simple links I found this solution:

http://davidwalsh.name/optimize-your-links-for-print-using-css-show-url

a:link:after, a:visited:after { content:" [" attr(href) "] "; }

And it works. But for image links, this will "float" the text from the content property next to the image and the entire layout messes up...

So is there a way to display the URL text above the image, in the top left corner? Or maybe below the image...


This really depends on your site layout. For instance if you set display:block to the images and the :after content the link url would appear under the image. Of course this may break your layout.

I suspect you may end up using lots of different declarations for specific areas. Since you can apply pretty much any style to the appended url (including positioning) you should be able to tackle this on a case by case basis.

If you find you need assistance with specific images/areas then please post up an example or image to help us along!

HTH :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜