Utilizing the Skeleton Boilerplate to vertically center the container

I'm struggling to vertically center my container in the Skeleton boilerplate. I've tried a few things, but it just won't align properly. Any tips or tricks would be greatly appreciated!

HTML:

<div class="container">
      <div class="sixteen columns">
         <h1 class="remove-bottom"></h1>
      </div>
         <div class="one-third column">
           <div class="middle-wrapper">
           </div><br>
         </div>
         <div class="one-third column">
           <div class="middle-wrapper">
           </div><br>
         </div><br>
         <div class="one-third column">
           <div class="middle-wrapper">
           </div><br>
         </div>
     </div>

CSS:

/* Base 960 Grid */

.container                                  { position: relative; width: 960px; margin: 0 auto; padding: 0; }
.container .column,
.container .columns                         { float: left; display: inline; margin-left: 10px; margin-right: 10px; }
.row                                        { margin-bottom: 20px; }

Answer №1

Many web browsers prefer using 'margin: 0px auto'.

Try updating your margin from 'margin: 0 auto' to 'margin: 0px auto;'

Answer №2

Give this a shot.
    This won't work for the skeleton framework, though. For example, it's best not to override container and column classes directly. Instead, create new classes for them and then override those.

<div class="container top">
   <div class="between"
      <div class="sixteen columns middle">
         <h1 class="remove-bottom"></h1>
      </div>
         <div class="one-third column">
           <div class="middle-wrapper">
           </div>

         </div>
         <div class="one-third column">
           <div class="middle-wrapper">
           </div>

         </div>

         <div class="one-third column">
           <div class="middle-wrapper">
           </div>
          </div>
         </div>
     </div>

CSS

.top{
    display: table;
    position: absolute;
    height: 100%;
    width: 100%;
}

.between {
    display: table-cell;
    vertical-align: middle;
}

.middle {
    margin: 10px auto;
    width: 960px;
}

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

CSS padding not behaving as expected

Hey there, I have a question regarding adjusting text inside a div using padding. I tried applying the padding command, but it doesn't seem to have any effect. You can find the relevant part of my code here <html> <head> <meta ch ...

Is there anyone available to assist me with troubleshooting a login session that is not functioning properly

I'm a beginner in php and I'm facing an issue with logging in as a different user in a project. After logging out and returning to the browser, the previous user's window keeps opening. Below is the code for index.php: <?php if ( ...

Utilizing CSS specificity to tailor custom classes according to Bootstrap grid breakpoints

My goal is to create custom width classes that leverage Bootstrap's grid breakpoints. These classes, such as w-10, w-20, would represent widths of 10% and 20% respectively. Alternatively, classes like w-sm-10, w-sm-20 would specify widths of 10% & 20% ...

What is the best way to utilize clip() in html canvas when using text as a path?

I have written the code below, which is close to what I am trying to achieve but doesn't quite get there. My goal is to fill text in multiple colors, currently it is only in #FF00FF. Check out the Playground I suspect the issue lies in my lack of kn ...

The hovering over a table data element results in a superior transformation

I recently created a table with an interesting structure where the first <tr> contains two <td> elements (the first one having a rowspan), while the second <tr> only has one <td>. My goal is to have hovering over the <td> in t ...

Guide to connecting a different HTML page to a thumbnail image using jQuery

let newColumnBlock = $('<div class="col-md-2">'); let newImagePoster = $('<img>'); let newSelectButton = $('<a href="secondPage.html"><button class="selectButton"></button></a>'); let movie ...

Alignment of images in a grid layout using Bootstrap 4

I am currently working on constructing an image grid with Bootstrap 4. The grid is contained within the class "showcase." In the first row, there are two landscape photos, and in the second row, there are three portrait photos. My challenge is to align the ...

Alter the hue of the div

Having trouble with this code snippet: function red(opt) { var sqr; sqr="r"+parseInt(opt); hilight_css = {"background-color":"#f00"}; $(#sqr).css(hilight_css); } I am calling the function like so: red(questions); The variable question ...

What are the steps to create a navbar positioned below an image?

I have my navbar on another page, but I would like to center it directly under the logo or image. My align-items property doesn't seem to work, so I've had to set the height in the .logo class. Is there any other method I can use to achieve this? ...

unnecessary shading effect on SVG text

My SVG text suddenly has a strange drop shadow that I can't seem to get rid of. Despite checking the reference guide I purchased on Amazon, I still haven't found any solutions. There are no filters applied and the markup seems to align with examp ...

Adjusting the width of tabs dynamically using jQuery

It's important to note that this question doesn't mirror the one found here. I am utilizing the jQuery UI Tab feature on my page and aiming for the tabs to occupy the entire width of the page. However, the number of tabs can vary between 0, 1, 2, ...

Tips for maintaining the original height of an image within an <img> element using HTML and CSS

I am facing an issue with a grid where I add grid-items, and then use the thumbnail class to provide dimensions to the thumbnail. When I insert an image into the <img> tag, it alters the height dimension, which is not desirable. I want the thumbnail ...

App builder shows raw HTML code instead of generating a dynamic table

I am currently working on an application that requires gathering data in a csv format from Google Sheets and importing it into App Inventor. Additionally, I need to include HTML code to display the table in a more visually appealing way. Here is what the ...

Guidelines for creating a dynamic Bootstrap 4 accordion with Jquery

I need help adding a new Bootstrap 4 accordion when a button is clicked. Can someone assist me with implementing this feature in jQuery? I'm not sure if it's possible to add accordions dynamically using jQuery. <script> $(document).re ...

Prevent parent element from changing color when child element is clicked

Check out my HTML: .imageURL:active .image_submit_div { background-color: #ccc; } .image_submit_div:active { background-color: #e6e6e6; } <div class="image_div"> <label for="id_image" class="image_submit_div"> <h3>+ add ...

Set the background image width to 75% of the screen size

I want to use this image https://i.sstatic.net/gt30c.jpg as a background for a section on my page. My preference is to have the white part cover only 75% of the screen, stopping before reaching the content in the left grid. Is it possible to achieve this ...

Executing HTML code upon reaching the index.php page

I am facing an issue with running a specific code on my website. Here is the code I need to run: <font size='3'><b> <li class="icon-home"> <a href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN na ...

Export the Excel file with hyperlinks to HTML format so that they can be easily opened in a file explorer instead of a web browser

I've got an excel spreadsheet that contains links to local folders. In order to optimize its compatibility with various devices, I convert it to HTML format. Everything seems to be working smoothly, except for one minor issue - when clicking on the li ...

What is the best way to convert this PHP string into an image?

Is there a way to replace the string "Overview" with an image instead? If it's possible, how can I achieve this? if (empty($lang) || !is_array($lang)) { $lang = array(); } $lang = array_merge($lang, array( 'UCP_MAIN' => 'Ov ...

Ensure YouTube iframe remains visible above all other elements on mobile devices at all times

Currently, my method involves utilizing YouTube for embedding videos and incorporating certain elements that should display on top of the video when clicked on. Regrettably, this functionality operates flawlessly on desktop browsers but encounters issues ...