Trouble with Divs and Element Placement

I am struggling to recreate this layout example. I attempted to make it align correctly, but I am having trouble looping the comment box under the review score. Can someone provide an example or guide me on how to achieve this design?

Example image:

https://i.stack.imgur.com/lt0sv.png

This is what I have created so far, using a background color to highlight the div box.

https://i.stack.imgur.com/B5aOI.png

Below is the code snippet:

* {
  box-sizing: border-box;
}

body {
  background-image: url("background.png");
  font-family: Tahoma;
  font-size: 8px;
}

.banner {
  margin-left: auto;
  margin-right: auto;
  background-image: url("bannerbackground.png");
  background-repeat: repeat;
}

H1 {
  font-family: Tahoma;
  font-size: 24px;
  text-align: center;
}

DL {
  width: 100%;
  overflow: hidden;
  background: #ff0;
  padding: 0;
  margin: 0
}

DT {
  float: left;
  width: 50%;
  background: #cc0;
  padding: 0;
  margin: 0
}

DD {
  float: left;
  width: 50%; //background: #dd0
  padding: 0;
  margin: 0
}

.overview {
  display: table;
  margin: 0 auto;
  float: right;
  background-color: red;
}

.everything review {
  border-style: solid;
  border-width: 4px;
  border-color: grey;
}

.review p {
  float: left;
  display: block;
  background-color: blue;
  margin: 0px 10px 0px 0px;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">

  <HEAD>
    <TITLE>TMNT - Rancid Tomatoes</TITLE>
    <META content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
    <LINK rel="stylesheet" type="text/css" href="movie.css">
  </HEAD>

  <BODY>
    <DIV class="banner">
      <IMG alt="Rancid Tomatoes" src="images/banner.png" align="middle">
    </DIV>
    <H1>TMNT (2007)</H1>
    <DIV class="everything" align="center">
      <DIV class="overview">
        <IMG alt="general overview" src="images/generaloverview.png">
        <DL>
          <DT>STARRING</DT>
          <DD>Mako
            <BR> Sarah Michelle Gellar</DD>
          <DT>DIRECTOR</DT>
          <DD>Kevin Munroe</DD>
          <DT>RATING</DT>
          <DD>PG</DD>
          <DT>THEATRICAL RELEASE</DT>
          <DD>Mar 23, 2007</DD>
          <DT>MOVIE SYNOPSIS</DT>
          <DD>After the defeat of their old arch nemesis, The Shredder, the Turtles have grown apart as a family.</DD>
          <DT>MPAA RATING</DT>
          <DD>PG, for animated action violence, some scary cartoon images and mild language
          </DD>
          <DT>RELEASE COMPANY</DT>
          <DD>Warner Bros.</DD>
          <DT>GENRE</DT>
          <DD>Action/Adventure, Comedies, Childrens, Martial Arts, Superheroes, Ninjas, Animated Characters</DD>
          <DT>OFFICIAL MOVIE SITE</DT>
          <DD>
            <A href="http://www.tmnt.com/">The Official TMNT Site</A>
          </DD>
        </DL>
      </DIV>
      <DIV class="review">
        <DIV>
          <IMG alt="Rotten" src="images/rottenbig.png"> 32% (88 reviews total) </DIV>
        <P>
          <IMG alt="Rotten" src="images/rotten.gif">
          <Q>Ditching the cheeky, 
self-aware wink that helped to excuse the concept's inherent corniness, the 
movie attempts to look polished and 'cool,' but the been-there animation can't 
compete with the then-cutting-edge puppetry of the 1990 live-action 
movie.</Q>
        </P>
        <P>
          <IMG alt="Critic" src="images/critic.gif"> Peter Debruge
          <BR> Variety </P>
        <P>
          <IMG alt="Fresh" src="images/fresh.gif">
          <Q>TMNT is a fun, 
action-filled adventure that will satisfy longtime fans and generate a legion of 
new ones.</Q>
        </P>
        <!-- Additional reviewer info here -->
      </DIV>
    </DIV>
    <DIV>
      <A href="http://validator.w3.org/check/referer">
        <IMG alt="Valid XHTML 1.1" src="images/w3c-xhtml.png">
      </A>
      <BR>
      <A href="http://jigsaw.w3.org/css-validator/check/referer">
        <IMG alt="Valid CSS!" src="images/w3c-css.png">
      </A>
    </DIV>
  </BODY>

</HTML>

Answer №1

If you're looking to improve the layout, consider switching from using divs to a table structure. This will allow you to create a cleaner and more organized design. Here's an example:

<table id="theentiretable">
<tr>
  <td class="topleftgreen">information here</td>
  <td class="toprightblack">information here</td>
</tr>
<tr>
  <td class="textandquotes">information here</td>
  <td class="posterimg">information here</td>
</tr>
<tr>
  <td>any other information here</td>
</tr>
</table>

By utilizing a table, you can easily customize the styles of each cell while keeping everything neatly organized in one central location. You can also wrap the entire table with a div for background and effects as needed. Alternatively, you could use two smaller tables to better suit your specific requirements.

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

Deploying static files with Django in a production environment

My Django application is functioning properly on Ubuntu 14.04 with nginx 1.10, Django 1.10.2, and uWSGI 2.0.14. It is able to load static files such as JavaScript, CSS, and images, but the CSS files are not being applied to my website. Below is the configu ...

Specifying file types in an HTML upload form

Is there a way to restrict my form so that it only allows jpeg files? Currently, it is displaying all types of files. <input name="image" type="file" /> Also, are there any JavaScript functions available for showing progress? ...

Discover the seamless method of transferring data from an HTML5 form to a PHP page for processing without the need to refresh the page or manually navigate to the PHP file

When creating a website, I encountered an issue with a form that requires the user to select three options from select elements and then click a search button to search the database. The problem is that PHP does not retrieve the form data unless the button ...

Adjusting the amount of rows and columns in a fluid manner with CSS grid (updated)

After conducting my research, it seems that the most effective way to set the final value of a CSS grid is either by directly specifying it or by creating/manipulating the css :root value. A similar query was previously raised here, although the answers p ...

Setting various font sizes for a single element

I'm looking to enhance my text by incorporating an embedded font in addition to Arial as a backup option. However, the embedded font requires a larger font size compared to Arial. Is there a way to ensure that when displaying the same text element, A ...

What is the best way to position the publication date of an article at the bottom of the

I am looking to have the article publishing date (1/9/2016) positioned at the bottom inside the container. Right now, the date appears just below the text, but I want it to be aligned at the bottom of the container. The website in question is watchathletic ...

What types of events can be used to trigger the start of HTML5 audio playback in mobile Chrome?

When it comes to mobile browsers, Audio elements require user action before play can start. The click event usually satisfies this requirement, but touchstart doesn't seem to be an acceptable initiating event in Chrome on Android or iOS. (Refer below ...

Alert: A notification when navigating away from your site

Is there a way to notify users when they click on an external link that they are leaving your site? <div class="row"> <div class="col-lg-12"> <div class="form-group"> *If you need information on other applicable forms, you ...

react: implement custom context menu on videojs

Can someone assist me with adding a quality selector and disabling the right-click option in a webpage that uses videojs? I am unsure about using plugins, as there were no examples provided in react. Any guidance would be appreciated. VideoPlayer.js impor ...

Why isn't the show/hide feature in Jquery functioning properly?

I have a div that needs to be displayed after hovering over another element. These elements are not within the same div. The popup info should appear when an icon with the class .option_36_124 is hovered over. $(".option_36_124").hover(function(){ $(& ...

Using EJS Tags within an external CSS file

I have been working on refactoring a Node.js project, and I currently have my CSS code within my .ejs file. I need to incorporate some dynamic data into my CSS file. It works fine when the CSS is within the EJS file. However, when I move my CSS to an exte ...

Vertical centering menu adjustment

Can anyone help me with centering an image on my website? I've tried the following code: top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); You can see what's happening on my site here: ...

Encountering an "unexpected token" error while utilizing the JSOP API in a ReactJS application

I am facing an issue while fetching data from a JSON API, as it is throwing an "Unexpected token" error. Below is the code that I have tried so far. Any help in resolving this problem would be greatly appreciated. Below is the code snippet: var Demo = Re ...

When viewing Google maps in full screen mode, the image suddenly vanishes

I have a map with a logo positioned in the lower right corner near the controls. However, when I switch to full screen mode, the logo disappears. I can see the div (aggdata-info) in Firebug, but the image/logo is not visible. Any suggestions on how to fix ...

Steps to assign a value to an input element using the state in a React application

Hey there, I hope everything is going well for you! I have a question regarding setting the value of an input field based on the state received from props. I've tried to populate the input with data from the "profile" state using placeholders, but it ...

The issue I'm facing is that the ng-click functionality in Angular JS is not functioning properly when the

Upon loading the page, my JavaScript function creates a tree structure from JSON data and generates a list of anchor tags which look like this: <a ng-click="shareParent(4619)">Some data</a> Despite associating the ng-click directive with the ...

Positioning and resizing elements based on varying screen sizes and levels of zoom

I recently designed a basic webpage using HTML with two main elements - a chat window for user interaction and a chart.js plot. Here is a snippet of the HTML code: <!DOCTYPE html> <html lang="en"> <head> <meta charset= ...

Using CSS units such as vw, vh, or percentage to specify height is not possible

In my Ionic app, I am adjusting the width and height of a div based on the viewport dimensions. This setup functions correctly on the browser and Android 4.4 devices. However, it does not work as expected on Android 4.2 (the height is constrained to the te ...

The slider causing conflicts with widgets and content positioned below it in an HTML layout

When implementing a slider with a fade effect, there seems to be an issue with the placement of widgets on the homepage. The problem arises from the margin-top setting as when images change in the slider, the widgets clash with the slider. During the trans ...

Tips for adjusting the content direction of a Popover

I am currently working on a component that includes the following code: import { Popover, PopoverTrigger, PopoverContent, PopoverBody, Portal, Button, } from "@chakra-ui/react"; import { ReactNode } from "react"; import { Co ...