What value is used as the default for justify content?

MDN states that the default value of justify-content is normal, even though it's not listed in the accepted values.

What exactly does a normal value mean?

normal
This means that items are packed in their default position as if no justify-content value was set. It acts like stretch in both grid and flex containers.

I've come across other sources claiming it should be flex-start. What truly is the default value?

Upon examining the specification, I may have found the answer:

In all other cases, normal behaves like start.

Answer №1

It is crucial to pay attention to the definition of justify-content as it differs across two specifications, making it a tricky concept to grasp.

The first specification can be found at: https://drafts.csswg.org/css-align-3/#propdef-justify-content, and serves the purpose of providing a unified approach to aligning various elements using consistent properties. This draft aims to establish a common box alignment model within CSS.

Within this specification, justify-content offers a value known as normal, which behaves differently based on its application context.

In the realm of flexbox and CSS grid, justify-content operates in specific ways:

For both flexbox and CSS grid, normal essentially functions as stretch.

With flexbox, justify-content applies along the main axis, where stretch is interpreted as flex-start due to flex's control over stretching behavior.


Despite being part of a draft, the values described here lack support. To find authoritative values for justify-content, one must refer directly to the Flexbox or CSS grid specifications.

In the Flexbox specification, there is no presence of such a value:

Name: justify-content

Value: flex-start | flex-end | center | space-between | space-around

Initial: flex-start

Usage of the normal value may either result in an invalid input leading back to the initial value, or be recognized as valid falling back to flex-start by default.

In the CSS grid specification, reference is made to the draft version with all values available; however, caution is advised regarding browser support for certain values.


The MDN page combines information from multiple specifications, potentially causing confusion among readers.

Future iterations of justify-content will encompass the following values:

normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]

<content-distribution> = space-between | space-around | space-evenly | stretch

<overflow-position> = unsafe | safe

<content-position> = center | start | end | flex-start | flex-end

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

Can the arrangement of icons/buttons on the JW Player control bar be customized?

I am trying to customize the skin of my JWplayer like this: This is my current progress: I have been researching how to rearrange the order of icon / button on the controlbar. According to the jwplayer documentation, the buttons on the controlbar are div ...

Navigate back to a previous page on a PHP website

I am working on a PHP program and need help figuring out how to go from page 2 back to page 1 using a button. I tried creating a button on the second page with a value of 1, but it resulted in an error for the user. Can someone guide me on how to achieve ...

Tips for showcasing the latter portion of text within an HTML select dropdown menu

I have a select drop-down list with a fixed width of 80px, as shown in the image below: <select id="dd_country_code_2" name="dd_country_code_2" style="width: 120px; height: 23px;"> <option value="SEL">(Country code)</option> & ...

The overlay only covers a portion of the page

I'm currently working on a new webpage and have found the perfect background image. However, I would like to add an overlay to darken the image. Unfortunately, the overlay doesn't cover the entire page! Despite my attempts, I haven't been s ...

Attempting to store the output of a function in a variable

My current script is designed to verify if the value of a selected element matches the span id. While the function itself functions correctly (verifying object.id via alert), I am encountering issues with variable assignment. When attempting to alert the ...

Stop the duplication of the HTML content to ensure only one copy is saved

Recently, I have been coding a feature that saves the HTML of the currently displayed page to another file upon pressing a button. However, I encountered an issue where if the button is pressed multiple times quickly, the saved file contains incorrect HTML ...

Select a hyperlink to access the corresponding tab

I've been playing around with bootstrap and AngularJS. I placed nav-tabs inside a modal-window and have it open when clicking on a link. However, I want the appropriate tab to open directly upon click. For example, if I click on "travel", I want the t ...

Python: encountered an issue when attempting to retrieve the complete text within every <span> tag using BeautifulSoup

I have been searching through various sources but have not yet found a solution that works for me. Below is the HTML file I am trying to work with: ......<span ><span class='pl'>Director </span>: <span class='attrs&apos ...

Adjust the dropdown width on a bootstrap form to match the size of the textbox

In order to maintain a combined width of 450px, I have two textboxes. One textbox includes a dropdown menu while the other does not. Both textboxes are part of an input group. The dropdown can switch between either textbox at any time. I need the width ...

Decimal error causing Bootstrap grid column division issue

I've been attempting to divide the Bootstrap grid column into 20 grids using the code below: <div style="width: 4.999999998%; margin-top: -27.5px; margin-left: 25px;" class="col-md-.6 col-sm-6"> <div style="height: 32.5px; ...

Unusual behavior exhibited by MUI Grid in the presence of spacing

I am working on a code snippet that looks like this: <Box sx={{height:'100vh', background: '#f5f7fc', overflow:'auto'}}> <Grid container justifyContent={'center'} padding={2}> <Grid item ...

Using Jquery Chosen Plugin to Dynamically Populate One Chosen Selection Based on Another

Good evening to all, please excuse any errors in my English. I have successfully integrated a jQuery Chosen plugin with my 'estado' field (or province). My goal is to populate another jQuery Chosen plugin with the cities corresponding to that s ...

Executing a snippet of Bootstrap 5 code under specific circumstances

I need to execute different code blocks based on the window width. When the width is 500px or more, I want to run a specific block of code, and when it's 499px or less, I need another block of code to run. How can I achieve this? For widths of 500px ...

What is the best way to eliminate the space between two columns of a row in Bootstrap 5 grid system?

In my quest to achieve the grid layout illustrated in the image below https://i.sstatic.net/4hsjw.jpg .col_1{ background-color: bisque !important; height: 500px; } .col_2 { width: 300px; height: 287px; background-position: cent ...

New HTML5 feature enables users to upload images onto canvas, enabling them to drag, rotate, and even

I'm a beginner in Html5 and I'm having trouble with uploading an image to the canvas. When I provide the direct source of the image, it works fine. I referred to this link for help javascript: upload image file and draw it into a canvas. Let me s ...

Use PHP to dynamically adjust the number of form instances and then save them all as CSV files

Currently, I am developing a PHP script that will allow users to open an existing CSV file (referred to as the template) on a webpage. Users can then populate editable text fields with its data anywhere between 1 and 50 times, depending on their needs. Onc ...

JavaScript - Reveal a div when a grid item is clicked

I have created a grid with a 5x7 layout using divs. I am trying to achieve a feature similar to the Netflix interface where, upon clicking on a div, a larger div will appear beneath it. This larger div should expand to 100% width of the parent container, p ...

The art of jQuery: Effortlessly animate the deletion of a CSS property

When using jQuery, I often "collapse" certain DOM elements by decreasing their width to 0px and fading them out. Here is an example: $(".slideoutmenu").animate({ width: 0, opacity: 0}, function() { $(this).hide(); }); The widths of these elements can var ...

Utilize ngModel within the <p> element in Angular 8

Here is some HTML code for displaying card information: <div class="col-md-4" *ngFor="let card of allCards"> <p class="card-text">Card Color: {{card.color}}</p> <button type="button" class=" ...

What is the best way to make the div inside the table cells expand to fill the available space?

I'm having trouble making the inner divs within table cell divs expand and fit their parent div without overlapping the next cell below it. Check out the sandbox for reference I've outlined the areas in grey where I want the cells to be filled. ...