forked from kengdoj/new-bookmarklets
-
Notifications
You must be signed in to change notification settings - Fork 1
/
background_images.html
69 lines (59 loc) · 3.1 KB
/
background_images.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Kathy's CSS Test Page</title>
<style>
body {padding:40px; font-family: Calibri, "Lucida Sans Unicode", "Lucida Grande", sans-serif;}
a {color: #6EAB23;}
p#footer {color: #999;}
div {
margin-bottom: 20px;
}
.one {
height: 180px;
background-image: url(images/kitten.jpg);
}
.one, .two {
background-color: #666;
color: #fff;
}
.two, .three {
height: 180px;
}
.four {
height: 100px;
background: #ddd url(images/brickwall.png);
}
.five {
padding-right: 25px;
background: url(images/minus.png) no-repeat top right;
}
.six {
background: #ffc;
}
.example:before {
content: 'This is text inserted before. ';
}
.example:after {
content: 'This is text inserted after. ';
}
</style>
</head>
<body>
<h1>Outline or remove CSS background images</h1>
<p>Credit: <a href="http://zomigi.com/blog/bookmarklets-for-accessibility-testing/">zomiga.com</a></p>
<p><a href="#" id="link-outline">Outline elements with background images</a> or use the bookmarklet: <a href="javascript:(function(){var tags=document.getElementsByTagName('*');var element;for(var i=0;i<tags.length;i++){element=tags[i];if(element.currentStyle){if(element.currentStyle['backgroundImage']!=='none')element.style.outline='2px solid #f00';}else if(window.getComputedStyle){if(document.defaultView.getComputedStyle(element,null).getPropertyValue('background-image')!=='none')element.style.outline='2px solid #f00';}}})();">Outline CSS Background Images</a></p>
<p><a href="#" id="link-remove">Remove background images</a> or use the bookmarklet: <a href="javascript:(function(){var tags=document.getElementsByTagName('*');var element;for(var i=0;i<tags.length;i++){element=tags[i];if(element.currentStyle){if(element.currentStyle['backgroundImage']!=='none')element.style.backgroundImage='none';}else if(window.getComputedStyle){if(document.defaultView.getComputedStyle(element,null).getPropertyValue('background-image')!=='none')element.style.backgroundImage='none';}}})();">Remove CSS Background Images</a></p>
<p id="footer"><a href="http://zomigi.com/blog/bookmarklets-for-accessibility-testing/">Read the article</a> that this test page is related to.</p>
<div class="one">This div has a background image</div>
<div class="two" style="background-image:url(images/kitten.jpg)">This div has an inline background image</div>
<div class="three">This div has a foreground image<img src="images/kitten.jpg" alt="kitten" width="300" height="180"></div>
<p class="four">This paragraph has a background image, <a href="#" class="five">link with background image</a>, and <a href="#">link with foreground image <img src="images/plus.png" width="20" height="19" alt="plus"></a></p>
<p class="six">This paragraph just has a background color.</p>
<script type="text/javascript" src="scripts/jquery-1.10.2.min.js"></script><!-- jQuery only used on in-page demo links, not bookmarklet links -->
<script type="text/javascript" src="scripts/bg-imgs_remove_outline.js"></script>
<h1>CSS Content before, after</h1>
<div class=example>Here is some text.</div>
</body>
</html>