Skip to content

Commit 9ddd3d3

Browse files
committed
Merge pull request openlayers#769 from tonio/noimportant
Avoid !important when not needed. img.olTileImage is precise enough to override boostrap’s rule.
2 parents eef879c + 862a53d commit 9ddd3d3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

examples/bootstrap.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,29 @@ <h4>OpenLayers and Bootstrap</h4>
5353
Note that the OpenLayers stylesheet is loaded before
5454
Bootstrap. The Bootstrap CSS sets the maximum width for
5555
images to be 100% (of their containing element).
56+
</p>
5657
<pre><code>img {
5758
max-width: 100%;
5859
}
5960
</code></pre>
61+
<p>
6062
This causes problems for images that you might want to be
6163
bigger than their containing element (e.g. big tile in small
6264
map viewport). To overcome this, the OpenLayers CSS
6365
overrides this <code>max-width</code> setting. If you are
6466
not loading the OpenLayers default CSS or are having trouble
6567
with tile sizing and Bootstrap, add the following to your
6668
markup:
67-
<pre><code>&lt;style>
68-
max-width: none !important;
69-
&lt;/style><code></pre>
7069
</p>
70+
<pre><code>&lt;style>
71+
img.olTileImage {
72+
max-width: none;
73+
}
74+
&lt;/style></code></pre>
7175
</div>
7276
</div>
7377
</div>
7478
<script src="../lib/OpenLayers.js"></script>
7579
<script src="bootstrap.js"></script>
7680
</body>
77-
</html>
81+
</html>

theme/default/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,5 +485,5 @@ a.olControlZoomOut {
485485

486486
/* override any max-width image settings (e.g. bootstrap.css) */
487487
img.olTileImage {
488-
max-width: none !important;
488+
max-width: none;
489489
}

0 commit comments

Comments
 (0)