HTML: img with center alignment and bootstrap styling

When I expand the screen, the img-thumbnail is not centering. I'm confused about why this happens because I don't fully understand how img-thumbnail works and how to resolve it. I have tried adding classes like "img-thumnail img-responsive center-block", but it only partially solves my issue as I also want the caption to be included in the thumbnail.

Here is my HTML code:

<div class="container-fluid">
      <div class="well outline">
      <h1 class="text-center">Ernest Miller Hemingway</h1>
      <h2 class="text-center">The man who made Pamplona famous</h2>
      <div class="img-thumbnail">
        <image src="http://www.ernesthemingwaycollection.com/_themes/hemingway/img/about-hemingway/galleries/02-20141010225753.jpg" alt="Hemingway with a cow" class="img-responsive">
        <div class="caption text-center">
          Ernest Hemingway laying down next to a cow that is used by bull fighters for training.       </div>
       </div>
      <div>
        <h3>Here is a timeline of Ernest Hemingway</h3>
        <div>
          <ul> 
            <li><b>1899</b> - Born in Oak Park, Illinois</li>
            // more list items...
          </ul>
          <p>"Courage is grace under pressure."</p>
          <p>- Ernest Hemingway</p>
        <div>
        <p>If you want to know more about Ernest Hemingway take a look at his <a href="#">wikipedia entry</a>.</p>
      </div>

        <!-- Figure out how to add the line that crosses tha page on bootstrap -->

      <p> Coded by Manuel Martin</p>

      </div>
    </div>

And here is my CSS code:


h1 {
  font-size: 60px;
}

h2{
  font-size: 33px;
}

.outline{
  margin: 70px 70px;
}

Answer №1

Success! Apply the img-responsive and center-block classes to the image element. Verify by clicking here. Check it out!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Displaying checkbox values with JavaScript

How can I display multiple checkbox values when checked in HTML code? Whenever I check a checkbox, I want its value to be shown alongside the previously checked values. Right now, my code only displays one value at a time. Any suggestions on how to achie ...

Is there a way to select text using XPath based on the content of a preceding element

<div class="profile-details"> <div class="profile-info"> <h4 class="">Contact Number</h4> </div> <div class="profile-info"> <p class="">0207 289 2981</p> ...

What causes the Top Navbar in Twitter Bootstrap to exceed the container when fixed?

While working with the default fixed-top navbar in Bootstrap, I encountered an issue where it spans the full width of the viewport. In order to contain it within a specific container div, I tried applying a CSS override for the left side: .navbar-fixed-to ...

Removing an appended value in jQuery: A step-by-step guide

Here is my code that successfully appends the first item: After clicking the "show count" button, a pop-up dialog box will display the count. However, to remove the appended item or refresh the page, additional steps are required. function showcount() { ...

IE9: Enforce the browser and document modes of IE9

Currently in IE9, my webpage is rendering with the Browser Mode set to 'IE9 Compat View' and Document Mode as 'IE standards', causing issues with all canvas elements on the page. I have already ensured that I have included '' ...

Relocate the Bootstrap selector box form to align with the left side of the page

I have included the Bootstrap CDN in my project, and I am encountering an issue with a form that contains a dropdown box. The problem is that the legend tag is properly aligned to the left of the page, but the selector box is slightly indented towards th ...

Disregarding boundaries set by divisions

Trying to keep things concise here. I have a division called "the box" with a fixed width of 1200px that contains various other divisions. One of these divisions is a links bar, known as the "pink bar", which has a width of 100% and a height of 25px. My is ...

Can the background image of a div be cropped using CSS/JavaScript techniques?

I have a div with a background image of a world map that I need to clip at two precise points. Clipping from the left side is straightforward. In my CSS: .le-map { background-image: url('../img/le-map-of-le-world.mlg'); background-size: 100% ...

The HTMLEditor from ASP.NET AJAX Control Toolkit is not appearing correctly on the page

My experience with the ASP.NET AJAX Control Toolkit HTMLEditor has been less than satisfactory. The toolbar layout is not being displayed correctly, with what should be a 3-line toolbar appearing stretched out to 9 lines. ...

What is the best way to ensure that two div elements within a list element fully utilize the available width on a webpage?

I am looking to create a 'settings' div that adjusts its width based on the available space on a page. This could range from 1000px to 600px, and I want the div to always be next to the 'title' div without wrapping onto the next line. F ...

Firefox hovers with a height of 0 effect activated

Hey there, I'm experiencing an issue in Firefox. When I attempt to use a hover effect on a div to change the height to 0, it's behaving strangely. Is there a way to make it function like it does in Chrome? Here is the code snippet: CSS : #squa ...

Styling select tags in Rails with options_from_collection_for_select using CSS

I need help with a form_tag in Rails. Here is the code snippet: <%= form_tag(listings_path, method: :get) do %> What <%= text_field_tag :title, "",class: 'form-control' %> Category <%= select_tag(:cat ...

What is the best way to trigger multiple functions within an action?

I am currently encountering an issue with calling multiple functions using AJAX. My objective is to call different functions through AJAX, in such a way that when I make these calls, they should send a request and receive the returned values of those fun ...

Detecting the existence of a scrollbar within the document object model using JavaScript - a guide

Could someone provide a JavaScript syntax for detecting the presence of a scrollbar in the DOM by measuring the body height and window height? ...

What is the best way to animate a "game over" image zooming onto the screen with HTML and JavaScript?

In my current programming project, I am working on developing an HTML game for a class. One of the features I want to include is a "game over" screen that will show an image and provide information about the player's score before they lose the game. ...

Organize elements with precision using html and css properties

I am struggling to get the buttons on the card to align properly. I have set a minimum height to ensure they are consistent in size regardless of content, but the alignment of the buttons is off. Take a look at the photo attached for reference - I want the ...

The form action now triggers the download of the PHP file instead of simply loading

I'm encountering an issue with the form on my website: <div class="searchBar"> <form action="searchDB.php" method="get"> <input type="text" class="searchBarInput" bdo dir="rtl" name="k"> <input type="image" cl ...

What could be causing the lack of responsiveness in my font size when adjusting to different screen sizes?

My understanding was that using font-size: 4em; would result in a relative size, but I am facing an issue where the font size remains constant regardless of window size. This causes overlap and makes the text look unattractive. Specifically, the text in qu ...

Issue with if statement when checking element.checked

Hey everyone, I'm currently working on a calculator app and running into an issue. I have set up 3 radio buttons and I would like to check them using an 'if statement' in my JS file. However, the problem is that the 'main' element ...

Maintaining the initial value of a textbox in jQuery across various focusin events

Struggling to accurately explain the process, so feel free to check out this helpful fiddle. In my form, there are several text input fields and a single submit button. The submit button becomes enabled once any of the form fields have been altered. If a ...