Use max width and max height. It will keep the aspect ratio
#container img { max-width: 250px; max-height: 250px; }
Related Posts:
- How to vertically align an image inside a div
- Change color of PNG image via CSS?
- How to fade an image with CSS without opacity?
- Define an ‘s src attribute in CSS [duplicate]
- How to place Text and an Image next to each other in HTML?
- Adding a blurred border in CSS
- CSS force image resize and keep aspect ratio
- How can I fill a div with an image while keeping it proportional?
- Removing whitespace between HTML elements when using line breaks
- How to get multiple images to auto resize and stay centered within a div
- Adding border to SVG image
- React.js inline style best practices [closed]
- Gradient borders
- Applying Comic Sans Ms font style
- Bootstrap 4 images thumbnail classes
- How do I rotate text in css?
- how to offset a CSS border up and left
- CSS centred header image
- Responsive Bootstrap Jumbotron Background Image
- SVG Fill Color Not Working
- How to change an input button image using CSS
- How to apply multiple transforms in CSS?
- Is it possible to center an inline-block element and if so, how?
- Rainbow gradient on text in CSS
- CSS3 opacity gradient?
- use multiple css filters at the same time?
- How can I make my header image properly responsive?
- CSS fixed width in a span
- Adding border to CSS triangle [duplicate]
- Remove wp_add_inline_style
- WordPress Register Style Called Incorrectly
- Duplicate and alter sidebar for Twenty Eleven
- How to dequeue styles coming from plugins?
- How to exclude certain code from style.css? [closed]
- Need Help Figuring Out Admin Menu Hover Styling Class
- whats happening with my index page?
- How do I add an indicator to my .menu-item if it contains a .sub-menu?
- Change via CSS the color of social menu icons
- Header’s CSS doesn’t work in Chrome and Opera – any ideas how to fix it?
- @media in bluehost is being commented out [closed]
- Twenty Fifteen : Wider right column for the content
- Moving button on Online Consulting theme
- css file status 403
- How can I get the search form to be selected automatically?
- Adding Custom css file
- Using transient for dynamic css , how to name it?
- Is there a way to add additional CSS styles to the styles css file dynamically?
- Change CSS on a wordpress post
- Unstable handling of CSS under WordPress/Elementor
- Trying to hide a button on a specific WordPress Page ID
- How to add animation the featured image?
- get_template_directory_uri() generates wrong path
- How to change the settings of a video? [closed]
- Change text color dynamically in WordPress [closed]
- First element/selector of enqueued CSS file breaks
- Different background for different page
- calling an additional css and js links for a custom page template
- Styling last item in ul [closed]
- How to change color of some items through css [closed]
- Remove custom css made by the custom theme
- Font styling in embedded Twitter feed
- WordPress backend is loading as a list
- Is there any way we can restore the “Additional CSS” after being erased?
- sidebar with hovering mouse effect
- Default paragraph block styles just for pages NOT for posts?
- Embed widget from external source (Zendesk)
- Loading a stylesheet conditionally & verifying CSS
- Dequeue styles with query doesn’t work
- Dynamically populated scss values or how to change styles by user choice
- WordPress login using a completely custom page and no plugins?
- Modifications on css file are not visible
- Gutenberg CSS Issue
- When changing theme’s font, why does font-size attribute not work? [duplicate]
- Hide BBPress create topic on one page
- Dropdown contents hidden behind content [closed]
- About copy and paste content and formatting
- How to display a background image in a page body area? [closed]
- Menu reduce space between words
- add css to only body text
- Vertical aligning CSS pushes column to left [closed]
- Specific text not affected by CSS style [closed]
- Import HTML code that loads css and javascript into specific page
- checkbox function not working for dropdown menu
- How to change hover color on bulk-action-selector-top and bottom on wordpress admin?
- Exclude parts of default css import
- Replacing parent theme’s IE-specific CSS
- modify stylesheet of a particular page inside wp-admin
- Having Trouble Styling a Table in a WordPress Post
- Bootstrap 4 Optimization
- Hide certain div/ class only at front page
- How to remove post view count
- WordPress toolset css struggle
- site-description css is overriden [closed]
- How can I use Advanced Custom Field Option page in CSS WordPress
- Narrow paragraph block aligned to left of “wrapper”
- Transparent Overlay for Gravity Forms Ajax Spinner
- Remove the main title, but only from the main page
- aos properties ‘invalid’ and not recognised when included as a css class [closed]
- ACF Extended : Disable styles in front [closed]
- How to remove automatically added custom style tag?