Play around with my design

I'm having trouble with my styling and need some assistance. Specifically, I want to make sure that my page_content_div appears under my header instead of below the right and left carousel controls. I tried using float:left on the page_content_div, but it didn't work. I also shared the code on jsfiddle, and the outcome was still the same.

I think it might be a simple mistake on my part. Can anyone point out any errors in my header or container_div CSS?

Below is a screenshot of my current index.html code:

Here's my index.html:

    <!DOCTYPE html>
<html>

<head>
   <meta charset='utf-8'>
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1">

   <link rel="stylesheet" href="stylesheets/public.css">

   <!-- <link rel="stylesheet" href="stylesheets/bootstrap.css"> -->

   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

   <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.6.0/build/reset-fonts-grids/reset-fonts-grids.css&2.6.0/build/base/base-min.css">

   <link href="stylesheets/carouseltwo.css" rel="stylesheet" type="text/css">

    <!-- Bootstrap Core CSS -->
    <link href="stylesheets/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="stylesheets/modern-business.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="font-awesome-4.1.0/stylesheets/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

   <title>Welcome</title>

</head>

... (remaining contents unchanged)

Here's my public.css:

    ... (CSS styles remain unchanged) 

Here's my modern-business.css:

    ... (CSS styles remain unchanged) 

Thank you for your help.

Answer №1

Great progress has been made in the right direction. There is still some tidying up to do, but now your divs are no longer overlapping and are displaying one after the other. I hope this improvement helps.

Click here to view the updated code on JSFiddle

In addition to other adjustments, I have centered your page_content_div on the page by setting a margin left/right: auto and defining a width for it (if you wish for it to span the entire page, simply adjust the width to 100%). Moreover, I have included a clear:both property.

.page_content_div {
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
  background-color: #FFCC00;
  width: 800px;
  clear: both;
}

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

Center a Bootstrap 4 card both vertically and horizontally without overflowing the screen

I am facing an issue with a single page layout where I have a centrally positioned card containing a form and text. Once the form is submitted, a list is displayed. However, sometimes the list is lengthy causing the card to cut off at the top with no scrol ...

What is the best way to center align and add an icon to the header in Ionic?

How can I center align an "ion-ios-arrow-up" icon in the header of my Ionic app, similar to the concept shown below? This is my HTML template: <ion-view cache-view="false" view-title="Historical HPP"> <ion-nav-bar class="nav-title-slide-ios7 ...

Get the adhesive substance to no longer have a sticky texture

I am in the process of creating a portfolio for my upcoming exam. As part of the portfolio, I am required to write several articles. To showcase these articles, I have designed a homepage that displays the different subjects I have covered. When a user cli ...

What is the best way to gradually transform a continuously shifting text color into a single, consistent hue?

Hey there, wonderful people of StackOverflow! I am absolutely stumped and cannot figure out how to smoothly transition this color-changing text from its current state into a different solid color when the submit button is clicked. Is there a skilled indiv ...

Looking for a vertical scrollbar solution for your idangerous vertical swiper?

Incorporating idangerous vertical swiper with two slides in a mobile app through jquery mobile has proven challenging. Specifically, I am struggling to implement a vertical scroll bar in the second slide due to its fixed height and the potential collision ...

Styling is lost in FancyBox popup when loading Partial View

I've been attempting to incorporate a partial view into my MVC project using fancybox. It seems to be loading the content correctly, mostly anyway, as it tends to cut off part of the page and loses all styling from the view upon loading. Even after i ...

When viewing my website on a mobile device, all elements that are supposed to be hidden on the desktop version are displayed properly. However, when I resize the

I have implemented code in my css file to hide specific items from the topbar on my website. When I view the site on my desktop and inspect it with mobile view, the hidden items appear correctly concealed. However, when I access the website on my phone, ...

Mobile Safari on iOS devices is known for its capability to overlay HTML5 <video> on top of everything

Although a similar question was asked 6 years ago without any answers, I am currently facing the same issue. Problem: The <video> tag in my Angular/Ionic application overlaps my image and two buttons in iOS Mobile Safari - no matter what I try! It ...

Internet Explorer 9 (IE9) causing CSS dropdown menu to be truncated due

My issue is very similar to the problem described in this post: CSS Flyout menu gets cut off by borders of its container in IE9 The difference in my case is that I need to set the z-index (and position) on the container. You can view my JSFiddle here: h ...

What is the best way to prevent an element from reaching the border of the screen?

As a JavaScript beginner, I am working on creating a simple game. My objective is to prevent the player (20px x 20px) box from causing the screen to scroll. I want a fixed screen where the player cannot go beyond the edges of the screen. Below are my previ ...

Aligning content in CSS for cross-browser compatibility with Internet Explorer and Chrome

My CSS grid has grid items that can easily be centered in Chrome by using the justify-items:center property, creating a magical effect. However, this solution does not work in Internet Explorer as the items remain stuck to the left side. For reference: ht ...

What is the best way to place text side by side with an image?

How can I align text below a picture like this? https://i.stack.imgur.com/WcNRa.jpg Here is the code snippet: https://jsfiddle.net/vzjj9eLy/ HTML: <span class="test"> <img src="http://cdn.sstatic.net/Sites/stackoverflow/img/<a href="/cd ...

Placing one image over another to create a layered effect

I'm having some difficulty overlaying a logo on top of a background image. In my HTML code, the background image is continuously refreshed to appear like a video stream. The image, dublin-rememberance-floor2, is retrieved from a database using JavaScr ...

"Troubleshooting a dropdown navigation bar problem in CSS

I am currently working on creating a CSS navbar dropdown, but I am encountering some issues. I am not very experienced with CSS, so any assistance would be greatly appreciated. The text within the "Products" box is not changing color like it should, and yo ...

Background image in Bootstrap not covering entire web page

I am facing an issue where the background image is confined within the constraints of the login panel, and I'm unsure why. My goal is for the image to span the full width and height of the browser window. Any assistance on this matter would be greatly ...

How to Alter the Color of a Hyperlink in HTML

I've been working on an angular2 application and I'm using a hyperlink to trigger a method that opens a small popup window. I've tried different methods to change the color of the link when it's clicked, but so far none have worked. Th ...

How can I display a button (hyperlink) on a new line using CSS or jQuery?

I am looking to create a new line after the last input of my form. On this new line, I want to add a "remove-link". This is my HTML: <div class="subform dynamic-form"> <label for="id_delivery_set-0-price"> Price: </label> <inp ...

Exciting animation in sidebar links text during toggle transition animation running

As the sidebar collapses, the text adjusts to its width in a choppy transition I'm seeking a way to display the text only when it fits perfectly within the sidebar without breaking into two lines I want the text to appear only after the collapse tra ...

Radio button selection with table layout

I am designing a quiz template with radio buttons. However, I would like them to be stacked vertically instead of side by side. Why doesn't the <br/> tag work? I'm having trouble understanding it. Can someone assist me? Here is my code: ...

Adding a 'dot' to the progress bar in Bootstrap enhances its visual appeal

I am currently working on a progress bar and I would like it to look similar to this: https://i.sstatic.net/TSDEy.png However, my current output looks like this: https://i.sstatic.net/rQhYc.png I'm puzzled as to why the tooltip is floating there, ...