Include an additional Div tag in the existing row

I've been attempting to include an additional div, but it consistently appears as the second row.. I want all of them to be on the same row and aligned with each other.

Here is the HTML code:

        
<div class="content-grids">
  <div class="wrap">
    <div class="content-grid">

      <div class="content-grid-info">
        <h3>All inclusive Packages</h3>
        <p>Airfares + Accommodation (ocean View) + 3 Meals daily + House Beverages + Activities (incl Kids Club)</p>

      <div class="content-grid-info">
        <h3>4 nights $1,299</h3>
      </div>

      <div class="content-grid-info">
          <h3>7 nights $1,189</h3>
      </div>

    </div>

  </div>
</div>

This is the CSS:


.content-grids {
  padding: 3.5em 0 3.7em 0;
  margin: 0 0 40px 0px;
}
.content-grid-info p{
    font-size: 0.875em;
    padding: 5px 0 5px 0;
    line-height: 1.5em;
}
.content-grid-info h3{
    font-size: 1.8em;
    font-weight: 400;

Despite making updates and changes in the style sheet, the issue persists.

Answer №1

there was an issue in the HTML code, as some div tags were missing.

Here is the corrected code that should work properly:

HTML

<div class="content-grids">
    <div class="wrap">
        <div class="content-grid">
            <div class="content-grid-info">
                <h3>All inclusive Packages</h3>
                <p>Airfares + Accommodation (Ocean View) + 3 Meals daily + House Beverages + Activities (incl Kids Club)</p>
            </div>
            <div class="content-grid-info">
                <h3>4 nights $1,299</h3>
            </div>
            <div class="content-grid-info">
                <h3>7 nights $1,189</h3>
            </div>
        </div>
        <div class="content-grid">
            <div class="content-grid-info">
                <h3>All inclusive Packages</h3>
                <p>Airfares + Accommodation (Ocean View) + 3 Meals daily + House Beverages + Activities (incl Kids Club)</p>
            </div>
            <div class="content-grid-info">
                <h3>4 nights $1,299</h3>
            </div>
            <div class="content-grid-info">
                <h3>7 nights $1,189</h3>
            </div>
        </div>
    </div>
</div>

You can view this code in action on this fiddle https://jsfiddle.net/yudi/yvpfxg8h/

Answer №2

Take a look at this code snippet:

  <div class="content-grids">
    <div class="wrap">
        <div class="content-grid float-left">
            <h3 class="content-grid-info float-left">Exclusive Vacation Packages</h3>
            <p class="float-left">Includes Airfare + Ocean View Accommodation + 3 Daily Meals + House Beverages + Activities (including Kids Club)</p>

            <div class="content-grid-info float-left">
                <h3 class="float-left">4 nights for $1,299</h3>
            </div>

            <div class="content-grid-info float-left">
                <h3 class="float-left">7 nights for $1,189</h3>
            </div>
        </div>
    </div>
</div>

For more information, visit: http://codepen.io/anon/pen/pyrraw

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

Import JSON Data into Angular-nvD3 Chart (AngularJS)

I am seeking help to load encoded JSON Data retrieved from a database via queries into an Angular-nvD3 graph. I am unsure about the best approach to achieve this task. The encoded JSON data is fetched using API queries from a database table called PRODUCT ...

The webpage is displaying an error stating that "<function> is not defined."

I recently duplicated a functional web page into a new file on my site. However, after adding a new function and removing some HTML code, the JavaScript function no longer runs when clicking one of the two buttons. Instead, I receive the error message "Beg ...

Encountering a predicament when attempting to retrieve an image from an alternative

[index.jsp][5] style.css [problem][6] [folder hierarchy][7] Although everything runs smoothly when the file is located in the css directory, it fails to show any images if placed in the images folder. Kindly provide assistance. ...

Adjusting the height of a Vue component to 100% triggers a change in height whenever a re-render occurs

In my Vue component, there is a class called "tab-body-wrapper" that serves the purpose of displaying the "slot" for the active tab. However, I encountered an issue while troubleshooting where the height of the ".tab-body-wrapper" component reduces during ...

Achieving consistent image column heights that decrease evenly

I am trying to create a grid-like layout where each column in a row has the same height and contains an image while maintaining its proportions. Currently, I am using the flex-grow property to adjust the ratio of the images. Although this works, it often ...

Utilizing getElementsByClassName for web scraping: encountering inaccurate outcomes

I am attempting to extract the inner text from all classes with the className = "disabled" within the provided snippet of HTML Code: HTML code In my effort to achieve this task using MS Access (VBA), the code I have implemented is as follows: Set IE = C ...

Begin counting starting from 1 all the way up to 24, then feel free

I've developed a counter that increments from 0 to 24, and once it reaches 24: setInterval(function(){DayAndNight()}, 1000); var iState = 12; function DayAndNight() { //console.log('test'); switch(iState) ...

Unlimited scrolling feature in Ionic using JSON endpoint

Trying to create an Ionic list using data from a JSON URL. JSON Code: [{"id":"1","firstName":"John", "lastName":"Doe"}, {"id":"2","firstName":"Anna", "lastName":"Smith"}, {"id":"3","firstName":"Peter", "lastName":"Jones"},{......................}] app.j ...

New design for UI grid: eliminate sorting menu and right-align column headers

I came across a question similar to this one My goal is to eliminate the dropdown menu from the column headers and align the text of the headers to the right. .ui-grid-header-cell { text-align: right; } However, my current attempts result in the disap ...

What is the method for generating a popover in HTML when a user hovers over a button?

In this scenario, I have implemented two status buttons with different colors. The green button corresponds to "RUNNING" and the red button indicates "TERMINATED", which are fetched from JASON data. Upon hovering over the green status button, the text "RU ...

What is causing the fluctuation in the width?

I am struggling to understand this portion of CSS code. When I resize the page, one button sometimes overlaps with the edit box. While debugging in Firebug, I noticed that the width is displayed as 0 for a container. Adding some width brings the button bac ...

Can you provide me with a comprehensive list of all the colors available in Twitter Bootstrap 3?

I've integrated the twitter bootstrap sass 3.0.3.0 gem, which is supposed to be the latest version of twitter bootstrap 3.0.3. I'm trying to customize the colors using the 'customize' section of the LESS variables, but I can't seem ...

Keeping the header in place: fixed positioning

This particular situation is quite challenging for me. I have a webpage that requires horizontal scrolling. There is a menu at the top of the page that needs to remain centered on the page at all times. Even with the use of jQuery, I am uncertain how to ac ...

Having difficulty displaying this code accurately on Google Chrome

I managed to create a hover effect over a series of images that displays additional information when hovered over. Below is the code I used: HTML <ul class="photo-grid"> <li> <a href="https://www.abglobal.com/" target="_blank"& ...

Combining two HTML tables in PHP: A step-by-step guide

I have two HTML tables that each contain three rows and one column. I am looking to combine them programmatically in order to create a single table with two columns and three rows. Is there a specific function or workaround that can help me achieve this? ...

Guidelines for automating button click using selenium in Python

<div class="wrapper"> <button class="w-full h-14 pt-2 pb-1 px-3 bg-accent text-dark-1 rounded-full md:rounded select-none cursor-pointer md:hover:shadow-big focus:outline-none md:focus:bg-accent-2 md:focus:shadow-small "> ...

Prevent users from selecting elements on the mobile site

Hey there! I'm currently working on preventing users from selecting items on my mobile site. While I've been successful in doing so on a regular website using the CSS class below .unselectable { -moz-user-select: -moz-none; -khtml-user-s ...

reverting the effects of a javascript animation

I am expanding the size of a carousel on a specific pane by adjusting its height and position. Here is how I achieve this: if(currentPane==2) { $("#carousel").animate({height:320},1000); $("#carousel").animate({top:411},1000); $("#dropShadow") ...

Stylish date picker in CSS

Here is a design mockup along with my current solution. The issue arises when two numbers are adjacent to each other (either horizontally or vertically) as they should merge, illustrated in the mockup below. For example, when selecting numbers 48-49-50, t ...

Updating the style of a CSS element using Python Selenium

Is it possible to change the css element style using Python Selenium during automation to increase the height of the page? The structure of the element in the HTML is as shown below: <div style="overflow-y:scroll;overflow-x:hidden;height:150px;&quo ...