Bootstrap allows for multiple items to be displayed on the same line, creating

I am currently utilizing Bootstrap framework and have a total of four items. However, the last item is displaying beneath the other three items instead of being on the same line. The current code snippet is as follows:

<div class="text-center linksblok">
    <p><strong>Looking for specific information about a treatment or your hospital?</strong></p>

    <div class="container">
    <div class="row">
<div class="col-xs-12 col-ms-12 col-sm-offset-1">


        <div class="linkblok hidden-xs col-md-3 col-sm-4">
          <a href="http://www.sfg.nl">Visit the site of &gt;</a>
        </div>


        <div class="img-responsive col-md-3 col-sm-4">
          <a href="http://www.sfg.nl"><img src="{channel.link('/designs/SFVG/SFG logo.png')}"  alt="logo sfg"/></a>
        </div>

        <div class="linkblok hidden-xs col-md-3 col-sm-4">
          <a href="http://www.sfg.nl">Visit the site of &gt;</a>
        </div> 

        <div class="img-responsive col-md-3 col-sm-4">
          <a href="https://www.vlietlandziekenhuis.nl/"><img src="{channel.link('/designs/SFVG/Vlietland logo.png')}" alt="logo vlietland"/></a>
        </div>
</div>
</div>
</div>
</div>

Upon inspection, it has resulted in the issue illustrated in the provided screenshot. The final logo item needs to be aligned on the same line as the other three items.

Thank you https://i.stack.imgur.com/zreno.png

The corresponding CSS style is outlined below:

(CSS code here)

When I add this styling rule:

.linksblok div {
    display:inline-block;   
}

The layout appears like this:

https://i.stack.imgur.com/xGtcU.png

Answer №1

It appears that there is excess margin on your elements:

.linksblok div {
  margin: 20px;
  display: inline-block;
}

Consider removing the excess margin or converting it to padding, for example.

@vivekkupadhyay: The grid layout is accurate with 12 columns instead of 16.

Answer №2

After running your code, I discovered that the issue lies with the .linksblok div where you included margin: 20px;.

I ran the code without the margin and it functioned correctly. To resolve this issue, please make the following adjustment:

.linksblok div {
display:inline-block;   
}

According to bootstrap's guidelines (here), ensure that your setup aligns with their recommendations. You are currently using 16 when you should only be using 12. This discrepancy arises from having four div's each set to col-md-4, totaling 16.

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

transferring background-image in html between elements

Imagine having a three-level hierarchy HTML code structured like this: <section> <div id="outer"> <div id="inner"> </div> </div> </section> If we set background-image:someImage.jpg to the section, and backg ...

Navigating through each segment

I'm currently working on a website with sections that are set to be 100% height of the window, but at least 800px tall. My goal is to implement a smooth scrolling functionality where one scroll moves the view from section to section. However, if the ...

Shifting the position of an HTML page to one direction

I'm currently working on adding a sidebar to my Twitter Bootstrap 3 project. The goal is to have a fixed positioned nav nav-pills nav-stacked show up on the left side of the page when a button is clicked. I've set its z-index to 1000 so it appear ...

What's the deal with z-index not functioning properly?

Below is my simple HTML and CSS code: HTML: <div class="header"> <div class="tip"></div> </div> CSS: .header { display: block; width: 260px; min-height: 222px; background-color: #252525; position: relati ...

Place the child DIV at the bottom of its parent DIV

I've searched through open questions but couldn't find a solution. The code snippet in question looks like this: ... <div style="some height"> <div style="some width"> .......and so on.. .. < ...

Two interdependent select fields

I am currently working on creating two select fields where, upon selecting an option in the first field, some options in the second field should be hidden. I have almost achieved this, but my script is unable to locate certain options in the first select f ...

Utilize ngModel in conjunction with the contenteditable attribute

I am trying to bind a model with a tag that has contenteditable=true However, it seems like ngModel only functions with input, textarea or select elements: https://docs.angularjs.org/api/ng/directive/ngModel This is why the following code does not work ...

VSCODE's intellisense feature seems to be ignoring CSS code within JSX files

I've been puzzling over why Visual Studio Code isn't recognizing CSS syntax inside JSX files. While I'm typing, CSS IntelliSense doesn't provide suggestions for CSS - only Emmet suggestions.https://i.stack.imgur.com/FegYO.png Despite t ...

Utilize jQuery to hide and then show elements based on text input

Recently, I came across a useful jQuery filter example that sparked my interest. To test it out, I created my live example and shared the code on CodePen (or you can check out the Fiddle if you prefer). One issue I encountered was that after entering text ...

Modifying jQuery CSS causes certain CSS rules from a file to be deleted

When using jQuery to change the css of an element, I've noticed that it can remove some previously specified css rules for that element. For example, .className, .className2, etc... { background-color: black; color : silver; } .className: ...

Send data-bound text from Angular to the title attribute of a Bootstrap Tooltip

Utilizing Bootstrap tooltips on my webpage has been a challenge as I attempt to insert dynamic text into the title attribute using {{ }}, only to discover it's not functioning properly. Here is an example of my HTML: <a class="questionIcon" data-t ...

Expansive menu that stretches the full height of the webpage

I'm having difficulty making my side spry menu extend the full length of the webpage. I tried using this code: $("nav").css({ "height" : $("nav").height() }); but it still isn't working as expected. I just want the grey color, like ...

Tips for organizing the contents of nested items in alignment

Here's a layout I've created, you can view it on CodePen. .parent { display: flex; justify-content: space-between; } .left { flex-grow: 1; flex-basis: 0; background-color: blue; } .right { background-color: red; flex-grow ...

CrossBrowser - Obtain CSS color information

I'm attempting to retrieve the background color of an element: var bgcolor = $('.myclass').first().css('background-color') and then convert it to hex function rgbhex(color) { return "#" + $.map(color.match(/\b(\d+ ...

What is the best way to apply custom styles in reactJs to toggle the visibility of Google Maps?

There are three radio buttons that correspond to school, restaurant, and store. Clicking on each button should display nearby locations of the selected type. Displaying Google Map and nearby places individually works fine without any issues. class Propert ...

Text area with a set height and expandable max-height - scrollable overflow

http://codepen.io/africanmatt/pen/IcGpa .text { max-height: 0; overflow-y: auto; transition: all .45s ease-in-out; } .text-active { max-height: 50%; } I am looking for a way to resize the .text component's max-height so that it adjusts prop ...

CSS to resolve HTML alignment problems

I am new to HTML and CSS, trying to practice formulating a few things but my efforts are proving futile. Below is the code and images for your reference. I would appreciate your opinion. .container { display: block; width: 200px; height: 120px; } ...

Animate the background of a table cell (td) in React whenever a prop is updated

I have a dynamic table that receives data from props. I would like the background animation of each cell (td) to change every time it receives new props. I've tried creating an animation for the background to indicate when a cell is updated, but it on ...

The Super Sub menu is failing to display correctly as intended

I encountered an issue while trying to create a Super sub-menu. The problem is that the super sub-menu appears when I hover over the main menus, instead of the sub-menus. I suspect there may be something wrong with the display: none; attribute, but I' ...

Can the bottom border on an input textfield be removed specifically under the new character?

This is the new visual design I received: https://i.stack.imgur.com/kiQGe.png The label CLG is represented as a label, with the line being an input type=tel. Disregard the purple overlay... The designer has requested that I remove the border when a user ...