My CSS div seems to be ignoring the max-width property I've set

Update: I believe my code is correct, the skew just caused a slight distortion haha. Apologies for any confusion.

I usually consider myself proficient in CSS, but this particular challenge has me questioning that...

.creative-container {
    background: red;
    display: flex;
    flex-flow: column nowrap;
    transform: skew(-12deg);
    width: 100%;
    margin: 0 auto;
}

.creative-container .header-section {
    display: flex;
    flex-flow: row nowrap;
    height: 260px;
}

.creative-container .header-section .brand-square {
    width: 350px;
    min-width: 350px;
    max-width: 350px;
    background: yellow;
}

.creative-container .header-section .header-text {
    padding-left: 60px;
    text-align: left;
    color: white;
    transform: skew(12deg);
}

.creative-container .header-section .header-text h1 { 
    font-weight: 900;
    font-size: 4em;
}

.creative-container .header-section .header-text h2 {
    font-family: Lora,serif!important;
    font-size: 1.2em;
    font-weight: 400;
}
<div class="creative-container">
      <div class="header-section">
        <div class="brand-square"></div>
        <div class="header-text">
          <h1>Our Work</h1>
          <div class="brand-line-break"></div>
          <h2>Creativity fuels our projects, each one crafted with passion and expertise to deliver exceptional results.</h2>
        </div>
      </div>
      <div class="projects"></div>
    </div>

The colors are temporary placeholders, but can anyone explain why my yellow square (`.brand-square`) is not adhering to the maximum width attributes? Upon inspecting the element, I can't identify anything interfering with the styles.

My assumption is that somehow flexbox is influencing those values, but I'm struggling to pinpoint how.

Any insights would be greatly appreciated. Thank you!

Answer №1

Remove the width:350px declaration from the

.our-work-container .header-section .brand-square
class

Check out the live example here

http://jsfiddle.net/15xLs49j/2/

However, it's recommended to avoid setting fixed heights in your CSS for better responsiveness, as static values can disrupt the layout on different screen sizes.

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

Change the order of numbering in ordered lists

I am seeking a way to change the ordering of an ordered list to be in descending order. You can view a live example here. Instead of having the counter span multiple ol elements, I would like the counter to reset after each ol. For the live demo, the des ...

Managing class values with Selenium - Manipulating and updating classes

In the program I'm working on, there is a need to toggle which element receives the class value of "selected". <div class="countryValues"> <div data-val="" >USA and Canada</div> <div data-val="US" >USA - All< ...

Vue 3's Paged.js does not respond to requests for page breaks

Currently, I'm working on implementing page breaks in Vue.js 3. Despite my efforts and utilization of the specified CSS code, I am facing challenges with the ".page-break" class parameter. While I can successfully modify other elements like titlePage ...

Drop down menu alignment issue: unable to center menu on the page

My dropdown menu is misaligned and not centering on the page, even after multiple attempts to fix it using HTML and CSS only. I have refrained from using JavaScript or JQuery for this issue. CSS Code: <style type="text/css"> /* STYLING FOR DROPDOWN ...

How can I use Jquery to loop through each combobox on the page and delete those with a specific class name?

I am currently dealing with a page that contains multiple combo-boxes. Each combo-box has a default option set as empty, which is given the class name 'hide'. This functionality seems to work perfectly in Chrome and Firefox, as the hidden options ...

The Tailwind Typography plugin simply maintains the default font size of heading tags without altering their style

I've been working on parsing an MDX file and converting it into React components. My tech stack includes TailwindCSS, Next.js, and React. Following the Tailwind documentation, I have installed the tailwind/typography plugin. In my tailwind.config.js ...

Header media query in CSS3 not functioning as expected

Currently, I have two separate style sheets for mobile and desktop versions. My intention is to default to the mobile style sheet. Upon examining my header, I have included the following: <link rel='stylesheet' media='all' href=&ap ...

Error: Timthumb is redirecting to a 404 page when trying to load image

Timthumb has been working perfectly on my live site, but suddenly stopped working on localhost. The image source is written as follows... Although the image opens when I click and open in a new tab, it does not display on the current page... <img src= ...

Relocate the Bootstrap selector box form to align with the left side of the page

I have included the Bootstrap CDN in my project, and I am encountering an issue with a form that contains a dropdown box. The problem is that the legend tag is properly aligned to the left of the page, but the selector box is slightly indented towards th ...

Ensure that only one button can be selected at a time for non-radio button elements in the

This is the code snippet I am working with $(document).ready(function(){ $("a.btn1").click(function() { $(this).find("i").toggleClass("fa-thumbs-o-up fa-thumbs-o-down"); }); $("a.btn2").click(function(){ $(this).fi ...

Set the text to be centered and aligned to the left margin in an HTML document

After creating a bullet-point list in HTML, I centered the text and bullet points. However, when I center the text, the bullet points become staggered. Is there a way to keep the text in a straight line on the left while still centering it? https://i.ssta ...

jQuery toggle functioning in one scenario, but failing in another

My experience with JS/Jquery is limited which might explain why I'm struggling with this. I am attempting to hide some text on a page and then make it visible again by clicking on a toggle link. The JavaScript code below is what I have been using. The ...

Customizing the styling of an anchor tag using CSS in Bootstrap

I want my active link to appear red: nav class="navbar navbar-inverse"> <div class="container col-1 col-sm-12"> <ul class="nav"> <li class="<%= 'active' if current_page?(squad_path) %> ...

What impact will splitting a single file into multiple files have on the overall performance of the website?

Imagine having an index.php file that includes multiple other files: Contents of index.php --------------------------- include('header.php'); include('footer.php'); --------------------------- Contents of header.php ------------------ ...

Identifying when the mouse cursor changes on a website

Is there a way to detect when the mouse cursor changes as it hovers over different page elements? An event similar to this would be ideal: window.onmousecursorchange = function(e) { // e would provide information about the cursor // for example, ...

Placing the child element behind the parent element's parent does not seem to be affected by the `z-index`

Please help! I've been struggling to get the <span> to appear behind the #sideBar using z-index: -3, but it's not working as expected.</p> body { margin: 0px; font-family: "Signika Negative", sans-serif; background-color: #25 ...

Reset input fields upon jQuery removal

Currently, I am working on a form that includes a remove function. The function is functioning correctly, but I am facing an issue where I want the field values to be cleared when the remove function is triggered. This is necessary as I am sending input va ...

JQuery does not allow variables to be passed

As a newcomer to jQuery, I am facing an issue with transferring form variables from an HTML page to a PHP page. Despite my attempts, the method I used doesn't seem to work as expected. Feeling quite puzzled about this, I would greatly appreciate any a ...

Behind every radio button lies a vertical line

Among a set of 7 radio buttons, I am looking to highlight the one in the center (id=q1val6) with a short vertical line running behind it to signify the zero point on a likert scale. <form name="form1" action="#" onsubmit="jsPsych.finishTrial()" method= ...

How do I align the content of table cells to the top of a row using Tailwind CSS?

I'm currently exploring ways to position the contents of a table cell at the top of the row. <tr className="flex-1 items-center align-top"> <td className=" py-1 pl-1 pr-1 text-sm sm:pl-6"> <div classNam ...