Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #50909, comment 14


Ignore:
Timestamp:
08/12/2020 02:38:21 PM (6 years ago)
Author:
jeslen

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #50909, comment 14

    v1 v2  
    2424
    2525=== TL;DR
    26 Add it to the the very top, or very bottom of your stylesheet (if the top doesn't work). Alternatively, search to find the last instance of the `img` selector in your CSS, and add it there. 
     26Add it to the the very top, or very bottom of your stylesheet (if the top doesn't work). Alternatively, search to find the last instance of the `img` selector in your CSS, and add it there.
    2727
    2828=== The Explanation:
    2929
    30 CSS, a Cascading StyleSheet, is read by the browser top to bottom. If there are identical selectors in the same or other CSS files, which ever one is at the bottom will take priority. Stylesheets added to a page one after another will be treated as if they were just added on to the end of the first.
     30CSS, a Cascading StyleSheet, is read by the browser top to bottom. If there are identical selectors in the same or other CSS files, whichever one is at the bottom will take priority. Stylesheets added to a page one after another will be treated as if they were just added on to the end of the first.
    3131
    3232For example, if a style sheet has `img { max-width: 100%; height:auto; }` and then the same sheet later has `img { height: 100%; }` (''notice the heights are different''), the browser will render all images with `max-width: 100%` and `height: 100%`.