Displaying Images with Bootstrap

/* STYLING THE GLOBAL ELEMENTS */
body {
  background-color: #a6a6a6;
  padding-bottom: 40px;
  color: #5a5a5a;
}
.navbar-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
}
.navbar-wrapper > .container {
  padding-right: 15px;
  padding-left: 15px;
}
... (additional CSS code)

/* MAKING PORTFOLIO IMAGES HORIZONTAL */
.css-img div {
  display: inline-block;
}

@media (min-width: 768px) {
  /* Adjustments for larger viewports */
}

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  ...
</head>

<body>
  <div class="navbar-wrapper">
    ...
      <nav class="navbar navbar-inverse navbar-static-top">
        <div class="container">
          ...
        </div>
      </nav>

      <div class="css-img">
         ... (image display code)
      </div>

      <hr class="featurette-divider">

      <footer>
        ... (footer content)
      </footer>

      ... (Bootstrap JavaScript files)

</body>

</html>

In the process of creating a Wordpress theme using this template, I encountered an issue with displaying images in my portfolio page horizontally instead of vertically. By setting the image containers to "inline-block", I was able to achieve this layout. However, when adding text below the images, it disrupted the horizontal alignment. Any suggestions on how to resolve this issue and maintain the desired layout? Due to restrictions, certain parts of the Bootstrap code are excluded here but are present in the actual code environment.

Answer №1

It appears that you have been placing each col-md-* within its own row, causing the Bootstrap rows to be displayed vertically.

To correct this issue, make sure to place all of your col-md-* elements within a single row.

Answer №2

To rectify the issue, adjust the caption div to float:left and eliminate the inline-block from the .ccs-img div rule.

/* GLOBAL STYLES
-------------------------------------------------- */
/*NEW*/
img {
    float: left;
    padding-right: 5px;
}
/* Padding below the footer and lighter body text */

body {
  background-color: #a6a6a6;
  padding-bottom: 40px;
  color: #5a5a5a;
}

....(The rest of the code)....

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<!DOCTYPE html>
... (The rest of the code) ...
</html>

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

The UI-SELECT feature in angular-js does not seem to be displaying

I've added the necessary ui-select js and css files to my page : <link href="assets/plugins/ui-select/select.min.css" rel="stylesheet" type="text/css" <script src="assets/plugins/ui-select/select.min.js" tyle="text/javascript" </script> ...

What is the best way to customize a MaterialUI outlined input using a global theme overrides file?

I've been working on customizing my theme file with overrides, and I've encountered a strange bug while trying to style the outlined input. It seems like there are two borders appearing when these styles are implemented. https://i.stack.imgur.co ...

Create personalized static swagger documentation

My API documentation is stored in a swagger.yaml/.json file and I am looking to create a customized static file from it. My goal is to make more changes than just altering the color of a button, such as adjusting its placement or size. Ultimately, I aim to ...

Creating a fully responsive navigation bar for all screen sizes

Recently, I came across a helpful YouTube tutorial on creating a navigation menu using HTML and CSS. The main challenge I encountered was getting the width of my navigation bar to span 100% of the screen on all devices while maintaining a height of 30px. I ...

What is the best way to make sure that only one tab changes color when clicked?

I have been working on a function that changes the color of a tab to gold when clicked, which is working fine. However, I also want to toggle the active property of each tab so that it displays a nice white outline. The problem I'm facing is that the ...

Having trouble locating images and JavaScript files on GitHub Pages

Using a template from this source to create a react website with interactions involving smart contracts, I successfully got everything up and running smoothly on my localhost. All the features of the site were functioning correctly and images were displayi ...

Enhancing an Image Gallery using CSS

Currently in the process of building a website for an upcoming event, and naturally, I need to create an event calendar. For inspiration, I have been referencing this example for its gallery layout and hover effects. However, I am hoping to customize thi ...

When utilizing the data-target attribute, the Bootstrap dropdown becomes toggled

My Bootstrap dropdown is giving me trouble when I use it with data target. Removing data-target from the button makes it work, but then my website's dropdown only opens on the second click. So I tried using data-target to fix it, but now it won' ...

Maintain scroll position when updating the DOM in Vue.js

Currently, I am working on a chat application that loads recent chat messages and stores them in an array called messages. As users scroll through the history, previous chat messages are loaded and added to the beginning of the messages array. One challeng ...

Extract words with specified tags from HTML using Python and return them as a list

Is there a simple way to parse HTML, extract the text, and generate a list of tags associated with each word or snippet of text? For instance, in the given HTML code: <em>Blah blah blah</em> blah again <i>and then again</i> The de ...

Token Error in Angular App

I've encountered a sudden issue with my leaflet map. Every time I click on the map, a marker is added to the same coordinates despite my efforts to remove them using a function. Even though the markers-array is emptied, the markers remain visible on t ...

Ensure the div remains fixed in its position regardless of the page's height

I am seeking assistance with making two divs of equal height on my website. The left div contains dynamic content that may expand vertically with various inner divs. Meanwhile, the right div has a single inner div that should remain visible at the top ev ...

What are some strategies for sorting information from a list that is constantly changing?

I have been working on a web application built in asp.net that receives data from a web service in JSON format. The current task is to dynamically develop controls for this application. I achieved this by creating a list of labels with stored values using ...

Automating Web Form Completion with VBA and Selenium

I am experiencing an issue with filling out a form. I have attempted the following methods: driver.FindElementByXPath("//div[@id='s_dane_dokumentu-section?grid-1-grid?c_nr_lrn_komunikatu-control?xforms-input-1']").sendkeys "2112345 ...

Looking to display the view source of an HTML page, but it keeps redirecting to another site when I try. Anyone know how to diagnose and fix this issue?

Can anyone assist me in displaying the HTML source of a page without it redirecting to another site? Here is the URL: ...

Unlocking the AngularJS variable within the template script

My controller code: $scope.totals = totals; In the template, I am able to successfully inject HTML using this code: {{totals}} However, my goal is to access the totals variable in a script within the template. Here's what I attempted: <script& ...

I'm having trouble getting querySelector and addEventListener to function properly in an electron environment with

I've recently embarked on a desktop project using Electron. However, I've encountered an issue with my button not functioning, and there are no error messages displayed. Below is the HTML code snippet: <!DOCTYPE html> <html lang="en ...

The synchronization between Typescript and the HTML view breaks down

I am currently working on an application that retrieves user event posts from MongoDB and displays them in HTML. In the Event-post.ts file, inside the ngOnInit() function, I have written code to retrieve the posts using the postsService.getPosts() method. ...

Creating a stylish dotted line separator or infill using CSS

I am currently working on developing a restaurant's website. I have been tasked with incorporating a dotted line infill between each menu item and its corresponding price. Despite spending a considerable amount of time searching online and testing dif ...

Tips for positioning the overlay to match the icon list when hovering- JavaScript/Cascading Style Sheets (CSS)

My challenge involves a list of <li>'s accompanied by an icon that, when hovered over, displays an overlay containing information about the 'test'. The setup looks something like this: test1 test2 test3 and so forth.... Here' ...