Просмотр исходного кода

Auto scale images to the size of the div

sh4nks 9 лет назад
Родитель
Сommit
21ca879846

+ 6 - 0
flaskbb/themes/aurora/src/flaskbb.scss

@@ -268,6 +268,12 @@ body {
             padding-left: 0.5em;
             padding-right: 0.5em;
             padding-top: 0.5em;
+
+            // scale larger (than the div) images to the size of the div
+            img {
+                max-width:100%;
+                max-height:100%;
+            }
         }
 
         .post-signature {

+ 3 - 0
flaskbb/themes/aurora/static/css/flaskbb.css

@@ -135,6 +135,9 @@ body {
     padding-left: 0.5em;
     padding-right: 0.5em;
     padding-top: 0.5em; }
+    .topic-body .post-box .post-content img {
+      max-width: 100%;
+      max-height: 100%; }
   .topic-body .post-box .post-signature {
     margin-top: 2em; }
     .topic-body .post-box .post-signature hr {

+ 1 - 1
flaskbb/themes/aurora/templates/forum/topic.html

@@ -86,7 +86,7 @@
                         </div>
                     </div>
 
-                    <div class="post-content post_body clearfix" id="pid{{ post.id }}">
+                    <div class="post-content clearfix" id="pid{{ post.id }}">
                         {{ post.content|markup|safe }}
                         <!-- Signature Begin -->
                         {% if flaskbb_config["SIGNATURE_ENABLED"] and post.user_id and user.signature %}

+ 1 - 1
flaskbb/themes/aurora/templates/forum/topic_horizontal.html

@@ -87,7 +87,7 @@
                         </div>
                     </div>
 
-                    <div class="post-content post_body clearfix" id="pid{{ post.id }}">
+                    <div class="post-content clearfix" id="pid{{ post.id }}">
                         {{ post.content|markup|safe }}
                         <!-- Signature Begin -->
                         {% if flaskbb_config["SIGNATURE_ENABLED"] and post.user_id and user.signature %}