• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Resizing an image dynamically with CSS as the browser width/height changes?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Resizing an image dynamically with CSS as the browser width/height changes?

This topic is: not resolved

Tagged: resizing an image dynamically with CSS

  • This topic has 4 replies, 2 voices, and was last updated 11 years, 8 months ago by Doug.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • December 23, 2014 at 12:46 pm #135190
    Doug
    Member

    12.23.2014

    Hello, Community!

    Does anyone know how can I resize an image dynamically with CSS as the browser width/height changes?

    Is this possible? I tried this code modification and it didn't work for me for this website: http://nct-archive.org


    http://stackoverflow.com/questions/4684304/how-can-i-resize-an-image-dynamically-with-css-as-the-browser-width-height-chang

    Thank you,
    Doug Arnold

    http://nct-archive.org
    December 23, 2014 at 1:10 pm #135194
    anotherusername
    Participant

    Which image are you trying to change?

    Be sure that you don't have width and height declared inline in your image tags.

    December 23, 2014 at 5:27 pm #135215
    Doug
    Member

    Hi!

    I am trying to change http://www.nct-archive.org/nct-archive-content/uploads/2014/12/Smithsonian1.jpg and http://www.nct-archive.org/nct-archive-content/uploads/2014/12/Smithsonian2.jpg

    Do you see any inline code that I've missed? The images are on the home page.

    Thank you,
    Doug

    P.S. If you strip out the width and height inline, how do you control the size so it's not larger than one wants?

    December 23, 2014 at 8:18 pm #135223
    anotherusername
    Participant

    You appear to be calling that first image with this code:

    <img class="alignleft wp-image-4174" src="http://www.nct-archive.org/nct-archive-content/uploads/2014/12/Smithsonian1.jpg" alt="Bandbox from the Kendall Collection" width="250" height="200" />

    So that is going to prevent your image from resizing.

    P.S. If you strip out the width and height inline, how do you control the size so it’s not larger than one wants?

    One thing you can do is use the max-width css tags. You can use either a pixel value or a percentage value (and then the image would be related to the size of its parent element).

    I would suggest reading up on the difference in CSS between width, min-width, and max-width, but in short, when you say, width="250", it is telling the image to be EXACTLY 250px ALL THE TIME, and not to be larger nor smaller.

    December 24, 2014 at 2:05 pm #135277
    Doug
    Member

    Thank you, anotherusername.

    I greatly appreciate your help.

    As a test, I stripped out the inline width and height values from the Bandbox image and added to the img selector the max-width of 100% and a height of auto.

    Doug

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble