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

How to position slides in the center using react-slick

I'm having difficulty achieving vertical centering for an image in a react-slick carousel implementation. The issue can be seen here. https://codesandbox.io/s/react-slick-playground-o7dhn Here are the problems identified: Images are not centered: ...

Pattern for identifying Google Earth links with regular expressions

I'm attempting to create a regular expression that can validate whether the URL entered by a user in a form is a valid Google Earth URL. For example: https://earth.google.com/web/@18.2209311,-63.06963893,-0.67163554a,2356.53661597d,34.99999967y,358.13 ...

Hide all the div elements on the web page and only display one when a button is clicked

I have successfully set up a few buttons that can show and hide divs on click. However, I am wondering if it is possible to hide all other divs when one is showing, and also have "divone" show up on load. Buttons: <button class="btn btn-outline-primar ...

Bringing together embedded chat and stream seamlessly with CSS styling

I'm in the process of integrating a chat feature with my Twitch stream on a Xenforo forum page. I aim for the stream to be displayed in 16:9 aspect ratio to ensure high definition quality, and I want it to adapt to the user's screen resolution. B ...

How to Emphasize Html Select Element on Mobile Devices?

Is there a way to make the HTML select element on Android appear more distinguishable as a dropdown list, rather than just looking like plain text? Any suggestions for highlighting it so users can easily identify and select an option from this element? Up ...

Difficulty understanding JavaScript sum calculations

I am currently working on a website project. Seeking assistance to enable an increment of one when clicked. Also need guidance on calculating the total price of items collected in a designated section under "number of items selected". Goal is to display ...

Effortlessly Transition to Full Screen with Div Expansion on Click

I'm currently working on creating a smooth transition for a div to expand fullscreen when clicked. My goal is to achieve a similar effect as the case studies on this website: Although my code can make the div go fullscreen, there's an issue with ...

Animating several elements by toggling their classes

I'm struggling to implement smooth animations on this box. I've tried using 'switchClass' but can't seem to keep everything together. Any help would be greatly appreciated. Here is the code snippet for reference: <script src=" ...

Using HTML5 datetime-local to only accept dates in the format Y-m-d

I am currently working on a form that includes a datetime-local input field. <input type="datetime-local" id="datetime" /> After clicking on the today button, the date is automatically set to today's date like this: 2018-11-05 --:-- However ...

Unable to alter the css of a jQuery object

I have been attempting to modify the CSS of two child elements of a specific element using Backbone and jQuery. However, my code does not seem to be working as expected. I suspect that the issue lies in distinguishing between a DOM element and a jQuery obj ...

"Utilizing social links in web design for a seamless user experience

I'm currently exploring ways to repair the design of social media links. The GitHub and Spotify icons are displaying at different sizes, and it seems like the Blogger icon is not aligning correctly: Referring to How To Create Social Media Buttons - ...

Tips for shifting nested div containers to the left as the content expands

I have a div containing a dropdown menu, label, and button as shown below: <div class="container "> <div id="User"> <div id="BtnUser"> <div id="dropMe"> <div class="dropdown"> <a onclick="User ...

There is a lack of definition for an HTML form element in JavaScript

Encountering an issue with a HTML form that has 4 text inputs, where submitting it to a Javascript function results in the first 3 inputs working correctly, but the fourth being undefined. Highlighted code snippet: The HTML section: <form action="inse ...

Passing a value from an HTML template to a method within an Angular 4 component

Encountering an issue with Angular 4. HTML template markup includes a button: <td><a class="btn btn-danger" (click)="delete()"><i class="fa fa-trash"></i></a></td> Data is assigned to each td from a *ngFor, like {{ da ...

Having difficulties in dynamically swapping audio sources using JavaScript?

It seems like I'm overlooking something simple here. The issue I'm facing involves creating a series of buttons with different audio sources as titles. When a user clicks on a button, the corresponding source should update in the audio player. T ...

Add to the end just before the final element when generating dynamically

var creatediv = document.createElement("div"); var text1 = '<input id="attribute1" type="text" placeholder="Attribute" /> $(creatediv).append(text1); var text3 = '<input id="attribute3" type="text" placeholder="Attribu ...

Combining D3.js tooltip positioning with CSS overflow styling

I am encountering an issue with displaying tooltips in D3 when combined with CSS overflow. Is there a solution available for this particular problem? CSS code: #chart1 { overflow-x: auto; overflow-y: hidden; max-width: 800px; max-height: 22 ...

What methods can be used to cloak JavaScript functions from the end user?

Looking to utilize jQuery AJAX calls? Here's an example: function addNewTeacher(){ $.ajax({ type: "POST", url: "/actions/dboss/newteacher.php", data: "uname=" + $("#newteacheruname").val() + "&upass=" + $("#new ...

Enhance your Zara shopping experience with the dynamic image zoom-in

I am currently exploring ways to replicate the image zoom-in feature seen on Zara's product pages. To see this effect in action, visit their site: Upon clicking on the image, it opens up in a popup window where it is enlarged to fit the entire screen ...

Finding a jQuery DOM element without using a loop

Can the element in variable d be identified directly instead of looping through each function? Take a look at the DOM below: <!DOCTYPE html> <html lang="en"> <head> <title></title> <script src="../jquery-ui ...