diff --git src/wp-includes/media.php src/wp-includes/media.php
index 3e3e38fe31..3fa536e8b3 100644
--- src/wp-includes/media.php
+++ src/wp-includes/media.php
@@ -1578,7 +1578,7 @@ function img_caption_shortcode( $attr, $content = null ) {
 
 	$style = '';
 	if ( $caption_width ) {
-		$style = 'style="width: ' . (int) $caption_width . 'px" ';
+		$style = 'style="max-width: ' . (int) $caption_width . 'px" ';
 	}
 
 	if ( $html5 ) {
diff --git tests/phpunit/tests/media.php tests/phpunit/tests/media.php
index 392c039fdb..eb4746a4a2 100644
--- tests/phpunit/tests/media.php
+++ tests/phpunit/tests/media.php
@@ -61,9 +61,9 @@ CAP;
 		$this->assertEquals( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) );
 
 		if ( current_theme_supports( 'html5', 'caption' ) ) {
-			$this->assertEquals( 1, preg_match_all( "/width: 20/", $result, $_r ) );
+			$this->assertEquals( 1, preg_match_all( "/max-width: 20/", $result, $_r ) );
 		} else {
-			$this->assertEquals( 1, preg_match_all( "/width: 30/", $result, $_r ) );
+			$this->assertEquals( 1, preg_match_all( "/max-width: 30/", $result, $_r ) );
 		}
 	}
 
