The height of this particular HTML/CSS div is distinct from all others

My header is giving me trouble as there always seems to be a missing piece.

Here's the issue:

https://i.sstatic.net/bl6Px.jpg

This is my HTML structure:

<div id="wrapper">
        <div id="header">
            <div id="header-col-left">
                <p class="site-title">@Html.ActionLink("Immo QR", "Index", "Home")</p>          
            </div>
            <div id="header-col-right">
                <div id="login">
                    @Html.Partial("_LoginPartial")
                </div>
                <div id="main-menu">
                    <ul id="menu">
                        <li>@Html.ActionLink("Home", "Index", "Home")</li>
                        <li>@Html.ActionLink("Who are we", "WhoAreWe", "Home")</li>
                        <li>@Html.ActionLink("What do we do", "WhatDoWeDo", "Home")</li>
                        <li>@Html.ActionLink("Contact us", "ContactUs", "Home")</li>
                    </ul>
                </div>
            </div>
        </div>
        <div id="body">
            <div id="user-menu">
                @if (Request.IsAuthenticated)
                { 
                    <ul id="account-menu">
                        <li>@Html.ActionLink("My profile", "MyProfile", "Profile")</li>
                        <li>@Html.ActionLink("Links", "Links", "Profile")</li>
                        <li>@Html.ActionLink("History", "History", "Profile")</li>
                        <li>@Html.ActionLink("Credits", "Credits", "Profile")</li>
                        <li>@Html.ActionLink("Settings", "Manage", "Account")</li>
                    </ul>  
                }
            </div>
            <div id="content">
                @RenderBody()
            </div>
        </div>
        <div id="footer">
            <p>&copy; @DateTime.Now.Year</p>
        </div>
    </div>

CSS Styles:

#body 
{
    margin: 0 auto;
    max-width: 960px;
    padding-top: 5%;
}

#user-menu 
{
    float: left;
    width: 15%;
}

#content 
{
    float: left;
    width: 85%;
    margin-top: 15px;
}

#header 
{

}

#header-col-left p
{
    float: left;
    display: block;
    width: 50%;
    background-color: orange;
    text-align: center;
    font-size: 30pt;
    color: white;       
}

#header-col-left a
{
    color: lightgray;
}

#header-col-right 
{
    float: left;
    display: block;
    width: 50%;
    background-color: orange;
}

I suspect the issue lies within the body section, though I've attempted some fixes with no luck. Any suggestions would be greatly appreciated.

Regards,

Answer №1

To change the background-color to orange for the #header element, ensure it is not applied to both #header-col-right and header-col-left p.

The issue arises from the discrepancy in height between the right and left portions of the header. This difference is due to the varying amounts of content present in each section.

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

Move your cursor over a specific element to change the div located before it, rather than the one after

Is it possible to have <div> B affect <div> A on hover, instead of the other way around? I've only seen code for the reverse using (+) in CSS. #b:hover + #a { background: #ccc } <div id="a">Div A</div> <div id="b"> ...

The <img> element is able to fill an entire div while maintaining its original aspect ratio

I am currently facing a challenge with implementing a responsive gallery slider in Bootstrap. In order to achieve responsiveness, I need to use properties like max-height. The issue arises from the fact that the images in the gallery can vary in size and ...

Two hyperlinks are not visible

I've added 2 links in my header component, but for some reason, they are not displaying. It's strange because everything appears to be correct. These 2 links are part of a list within a ul element. <nav class="navbar navbar-expand-lg navbar-d ...

Issue with HTML::link() function on Laravel 5

Within one of my Controller functions, I am utilizing the code echo HTML::link('/public', 'Insert New Record');. It looks like this in the following snippet: namespace App\Http\Controllers; use App\model\Report; use ...

Maximizing the power of CSS within Visual Studio

After conducting extensive research in this area, I have not come across any remarkable information regarding the use of CSS in Visual Studio. While many people discuss it, specifics seem to be lacking. I am interested in learning about simple methods for ...

Identify the different variations of connections in jQuery

On my website, I have a div named "links" containing various links to websites and PDF files. I want to use jQuery to ensure that only the PDF links are displayed when a specific button is clicked. As a beginner in jQuery, I am seeking guidance on implem ...

Dompdf is unable to process data exceeding two pages

Having 85 rows in a table with dompdf is functioning properly, but when exceeding 85 rows, they are not displaying on the 3rd page; instead, they are overlapping on the 2nd page. Incorporating dompdf with codeigniter, I've attempted removing all styl ...

Can you explain the distinction between using .hover and :hover?

Recently, I came across some CSS code that was written by someone else and it contained the following: li.hover, li:hover { } This made me curious - is there a distinction between .hover and :hover in CSS? Could it be possible that certain browsers inte ...

Is it considered best practice to utilize iframes for the implementation of a header or navbar on a

Is it considered a best practice to utilize iframes for implementing a header/navbar? My website consists of approximately 5 thousand pages, all of which are static HTML (without the use of any content management system, PHP, etc). I am currently in the ...

Combining ng-repeat with the float property set to left

I am attempting to create two rows of divs using ng-repeat. Each div is styled with a float: left attribute, and at the end, I add a clearing div with clear: both. <div class="interval" ng-repeat="interval in intervals"> <div class="text-cen ...

Maintaining constant value by utilizing the span attribute within HTML

Below is the code snippet with a span element: <span style="padding-right:20px">Reference No.<?php echo $ref_number; ?></span> The issue I am facing is that the text "Reference No." remains fixed, but depending on the length of the valu ...

Emphasizing specific terms by changing them (but only within p tags)

After spending about 8 hours searching for a solution yesterday on various platforms, I almost gave up. But then I realized I should turn to this community for some much-needed help. So here is my first question - a big thank you to everyone who has helped ...

Can HTML variables be accessed in lines of code before they are declared in HTML?

In line 1 of my code, I am trying to access the rowData variable which is declared in the second HTML line. However, I keep getting the error message "Property 'rowData' does not exist on type 'AppComponent'" for that line. Strangely, t ...

Phonegap's JavaScript canvas feature is experiencing issues

Recently, I came across a JavaScript bouncing ball animation that works perfectly on the Chrome browser when used on a PC. However, when I tried running it using Phonegap Eclipse Android emulator, I encountered an issue where the canvas appeared blank and ...

What is the best way to showcase five products in a row instead of four on the "featured" section of the homepage?

Seeking help with administration: Looking to display five equal columns in Twitter Bootstrap. The solution provided does not work for me because I cannot simply duplicate it 5 times. It seems that the OpenCart "featured" module operates using a loop, but I ...

Using CSS/HTML5 with either the :target or :active selector can allow for the display of different text content when a

Is it possible to change the text displayed on a website without reloading the page when a link is clicked? For instance, if I have an "About" or "Contact" link on my personal website, can the text in the body of the page be switched dynamically? In the i ...

Max-height is disregarding the CSS transition

My goal is to implement a CSS transition that triggers when a button is clicked, causing it to fade out and disappear while another element simultaneously takes its place. I have almost achieved the desired effect, but there's an issue. When I add th ...

ToggleButton4 Framework is a user-friendly tool for creating interactive

I am currently working with Bootstrap 4 to design a toggle button; however, when I click the button, the checkbox does not update, despite the fact that the active class is being applied. Even when I use $('.btn-group-toggle').button('toggl ...

Different Approaches to Concatenating Strings in JavaScript

I may be asking a rookie question, but I've been unable to locate an answer online. <script> var1 = ""; someFuntion(); var2 = ""; </script> Suppose I have a script like this and I can manipulate the value of var1 by input ...

Implementing a full-width search bar within the Bootstrap navbar

I'm trying to create a navbar using Bootstrap 3.7.7 with a logo on the left, links on the right in two rows, and a large search bar in the center. I've managed to align the logo and links correctly, but I'm struggling with sizing the search ...