Creating a mockup for a website design project in my class, utilizing HTML and CSS. Encountering issues with the CSS not displaying correctly, unsure of the root cause of the problem

Check out this wireframe design I created: https://i.stack.imgur.com/Ro3dl.png

I'm working on translating this into HTML and CSS so that I can further develop it.

The HTML Code:

<!doctype html>
<html> 
<head> 
<title> Trinity FC </title> 

<style type="text/css" media="all"> 
@import "trinityfc.css"; 
</style> 

</head>


<body> 
<div id="container"> 

    <div id="header">
    <h1>Main Heading And Logo </h1>
    </div>

    <div id="Column1">


        <div id="side">



                <div id="menu"
                <p>menu sample text sample text sample text sample text sample text sample text sample text sample text</p>
                </div>

                <div id="table"
                <p>table sample text sample text sample text sample text sample text sample text sample text sample text</p>
                </div>

        </div>

    </div>



    <div id="Column2">

        <div id="news">

                <div id="newspic">
                <p>News Picture sample text sample text sample text sample text sample text sample text sample text sample text</p>
                </div>

                <div id="newstext">
                <p>News Text sample text sample text sample text sample text sample text sample text sample text sample text</p>
                </div>
        </div>

        <div id="footer"
        <p>Footer and Copyright Information</p>
        </div>


    </div>

</div> 

</body> 

To explain the div tags, "Column1" contains "side" which includes "menu" and "table".

"menu" represents the green menu box in the wireframe image.

"table" corresponds to the red league table box in the wireframe image.

"Column2" includes "news" (having "newspic" and "newstext"), along with "footer".

"newspic" reflects the yellow news image - headline box in the wireframe image.

"newstext" matches the orange news text preview box in the wireframe image.

"footer" aligns with the grey footer box in the wireframe image.

CSS Content:


body{
background: #F3F2E8;
color: #51463D;
font: normal 100%/1#5 "Lucida Grande", "Lucida sans"; 
padding: 1em;
}

h1  {
    color: #A14141;
    font: normal 1#5em Georgia, serif;
    margin: 0;
}

em  {
    font-family: Palatino, Georgia, Times, serif;
}

img     {
    max-width: 100%;
}

#container 
{ 
background-color:#F0F5F3
}

#header {  
background-color:blue; 
width: 100%

}

#column1 {  
width:22.5%;
float:left;

}

#side { 
background-color:white; 
width:100%;
height:100%;

}
    #menu {  
    background-color:green; 
    width:95%;
    height:45%;
    }

    #table { 
    background-color:red; 
    width:95%;
    height:45%;
    }



#column2 {  
width:72.5%;
height:85%;
float:left;
}

    #news { 
    background-color:black; 
    width: 100%;
    }
        #newspic { 
        background-color:yellow; 
        width:100%;
        height:70%;
        }

        #newstext { 
        background-color:#FF6600; 
        width:100%;
        height:30%;     
        }

    #footer { 
    background-color:grey; 

    }

This is how the page will appear: https://i.stack.imgur.com/VcTlU.png

I presented this to my tutor during a recent class, but they couldn't identify the issue right away. I promised to revisit and inspect the code thoroughly, yet I'm still unable to figure it out. Can anyone easily spot the problem?

Answer №1

Just before I provide my response, let me mention that your tutor might not be very skilled if he failed to identify these issues.

  1. There is a lack of consistency in capitalization between your HTML classes and CSS.

  2. Your CSS needs some tidying up - including adding relative positioning where necessary, defining dimensions, specifying display types, and addressing other elements as well.

  3. Is the column2 class missing?

  4. I have made only minor adjustments. The rest will require your attention for cleanup.

  5. You may want to consider finding a new web development instructor.

I'm currently at work, but feel free to ask any more questions and I'll respond when possible.

http://jsfiddle.net/ru4kej1t/

New CSS:

body{
background: #F3F2E8;
color: #51463D;
font: normal 100%/1#5 "Lucida Grande", "Lucida sans"; 
padding: 1em;
}

h1  {
    color: #A14141;
    font: normal 1#5em Georgia, serif;
    margin: 0;
}

em  {
    font-family: Palatino, Georgia, Times, serif;
}

img     {
    max-width: 100%;
}

#container 
{ 
background-color:#F0F5F3
        position:relative;
}

#header {  
background-color:blue; 
width: 100%
position:relative;
}

#column1 {  
width:22.5%;
float:left;
height:500px;
position:relative;
background:red;
display:block;
}
#column2 {  
width:77%;
height:500px;
position:relative;
background:yellow;
display:inline-block;
}
<body> 
<div id="container"> 

    <div id="header">
    <h1>Main Heading And Logo </h1>
    </div>

    <div id="column1">


        <div id="side">



                <div id="menu"
                <p>menu sample text sample text sample text sample text sample text sample text sample text sample text</p>
                </div>

                <div id="table"
                <p>table sample text sample text sample text sample text sample text sample text sample text sample text</p>
                </div>

        </div>

    </div>



    <div id="column2">

        <div id="news">

                <div id="newspic">
                <p>News Picture sample text sample text sample text sample text sample text sample text sample text sample text</p>
                </div>

                <div id="newstext">
                <p>News Text sample text sample text sample text sample text sample text sample text sample text sample text</p>
                </div>
        </div>

        <div id="footer"
        <p>Footer and Copyright Information</p>
        </div>


    </div>

</div> 

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

Finding elements through their text representation

I am struggling to select an element using the text "SELECT PRODUCT" in the following HTML: <div style="font-family: franklin-gothic-urw; font-weight: 400; font-style: normal; font-size: 19px; opacity: 1; color: rgb(255, 255, 255);">SELECT&nbsp; ...

When consecutive DOM elements are hidden, a message saying "Hiding N elements" will be displayed

Provided a set of elements (number unknown) where some elements should remain hidden: <div id="root"> <div> 1</div> <div class="hide"> 2</div> <div class="hide"> 3</div> <div class="hide"&g ...

Creating an HTML page with R Markdown: Placing an image in the upper right corner and adjusting the position of the title

Looking to add a company logo image to the top right corner of my R markdown report, and then shift the title down by 3 or 4 cm for a letterhead-like appearance. Does anyone have suggestions on how I can achieve this in my .Rmd file? Appreciate any assist ...

The vertical drop-down menu is displaying and functioning incorrectly

My vertical submenu is positioned correctly, but the links are overlapping on top of each other. The submenu doesn't hide when hovering over the main menu, but it does hide when hovering outside the menu. I'm unsure of what changes or additions t ...

Extra space within table in Firefox

Experiencing an issue with excess whitespace in a table on Firefox. Visit the live example at The problem can also be seen on this jsFiddle: http://jsfiddle.net/DVbCC/ In Chrome and Safari, rows are neatly arranged with minimal spacing, but Firefox show ...

PHP persistent forms dropdowns and checkbox selection

I am currently working on a PHP form and I am facing an issue with the drop-down boxes and checkboxes. I want them to stay filled even if I don't select something, maintaining the previously entered details while leaving the unfilled parts empty. I ha ...

Bootstrap 4 collapsible navbar with a stacked design

I am struggling to create a collapsible navbar. Even though everything seems to be working, the nav items are not stacking vertically as they should be. Instead, they are appearing horizontally next to each other. Here is the code snippet: <nav class= ...

Is there a way to toggle or collapse a table row with a unique identifier using Angular and Bootstrap?

Currently handling Angular and Bootstrap in my work, but facing challenges with table manipulation and collapsing rows. I fetch data from a database and showcase it in a dynamically generated table using *ngFor and two rows within an ng-container. My goal ...

Is it possible to adjust the left property following the concealment of an element with JQuery?

My goal is to move an image element using the 'left' property after hiding a div. To achieve this, I am using JQuery's '.promise()' function. Here is my code: HTML code: <div id="outerContainer"> <div id=" ...

The $().bind function will not function properly unless the document is fully loaded

Do I need to include $(document).ready() with $().bind? Here is the HTML portion: <head> <script type="text/javascript" src="jquery-1.10.2.min.js"></script> <script type="text/javascript" src=&quo ...

Creating a design with multiple `<thead>` and `<tbody>` elements

Seeking advice on usability and design elements. I am currently utilizing JQuery to hide/show entire sections within a single large table structure. The layout consists of multiple thead sections, with the main header at the top, followed by sub-headers fo ...

What's the best way to prevent extra spacing when typing in a materialUI TextField?

Instructions for the user: Please input your first name without any spaces between characters. I attempted to implement the following code, however, it did not achieve the desired outcome. <TextField required id="name" label="First Name" ...

I am experiencing an issue with Safari where there is an unexpected rounded border appearing that

Upon inspecting the image, a slight border is visible behind the main border on Chrome and Firefox. However, Safari and iPhone display a rounded thin border instead. Can you help us understand why this discrepancy is happening and how we can remove it? P ...

Navigating to a precise element within a page in Angular with flawless redirection

I recently encountered an issue where I had to add a span element with a specific ID in my HTML code to ensure that clicking on the Reply button would navigate to it. However, this modification was only necessary for the last element on the page. While the ...

Harnessing the power of Selenium to locate an anchor tag containing HTML elements with specific classes

I have a specific element on my webpage that I need to extract the text "Add New Member" using Selenium. Here is the HTML code for the element: <a ng-if="userCanEdit" class="btn btn-primary ng-scope" ui-sref="orgs-add" href="#/orgs/add"> <i& ...

Prevent users from inputting multiple minus signs by setting the input type to number and disabling the

Is there a way to prevent the input type number from accepting "--" as input? I am looking for a solution to disable this behavior. Additionally, the input field seems to allow for various incorrect formats like: -12-12 -- -121- 23-323- ...

Unable to show inline form within a ul element

I had a ul list with regular text inside the li tag. When I attempted to show it inline, it worked perfectly. However, as soon as I replaced that text with a form, I could no longer get it to display inline. This was my HTML code: <ul class='tes ...

Title with lower border shorter than width

Looking to achieve an underline effect with a bottom border that is narrower than the width of the h2 title. Though I typically avoid uploading images, here is one to provide further clarification of my question: ...

A tutorial on how to create the appearance of disabled buttons that look the same as enabled buttons through the use

My button includes a text field that is constantly disabled. I would like for the text field to appear as bright as it does when the button is enabled. After disabling the button, they both appear dimmer compared to others and the text field follows suit ...

What could be causing my sticky positioning to not function properly when I scroll outside of the designated

My website is organized into sections, with each section corresponding to a hyperlink in the navigation menu. I've applied the CSS property position: sticky to my navbar, which works as expected within the section bounds. However, I want my red navbar ...