Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

flexbox- I cant figure out what's causing this div to have a blocked out space in flexbox

if anybody could help me solve what’s causing this purple blocked-out box in my #header-content it would be greatly appreciated.

I don’t know it won’t let me post it wants some more information

why does it keep asking for more information

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

come on i shouldn’t have to type this much stuff

enter image description here

#header {
    background-color: #343c63;
    height: 400px;
   
}

.main-nav {
    display: flex;
    padding: 0px 100px 0px 100px;
    list-style: none;
}


.main-nav li:first-child {
    margin-right: auto;
}

.main-nav a {
    margin: 10px;
    color: white;
    text-decoration: none;
}

#header-content {
   display: flex;
  
   padding-top: 100px;
   padding-left: 100px;
   padding-right: 100px;
}

#image-1 {
 margin-right: 100px;
  
}
<html>
    <head>
        <title>top-flex-box</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="index.css">
    </head>
   
    <body>
        
        <div id="header">
        <nav>
            <ul class="main-nav">
                <li><a href="#" class="logo">Header Logo</a></li>
                
                <li><a href="#">Link One</a></li>
                <li><a href="#">Link Two</a></li>
                <li><a href="#">Link Three</a></li>
                
            </ul>
        </nav>
            
            <div id="header-content">
                <div>
                <h1>This website is awesome</h1>
                <p>This website has some subtext that goes here under the main title. It's smaller font and the color is lower contrast.</p>
                </div>
                
                <div id='image-1'>
                    <p>this is a placeholder for an image</p>
                </div>
            </div>
            
        </div>
        
        
        
    </body>
</html>

>Solution :

please attached your html too.

but is assumed this happened because your div container #header-content as parrent didn’t have width with fixed value,

#header-content {
   display: flex;
   width: 100vw;
   padding-top: 100px;
   padding-left: 100px;
   padding-right: 100px;
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading