Positioning elements within a DIV using CSS

After using Position: Absolute for a while, I have realized that it's not working for my needs. I want my application to have a fluid layout that can adapt to different resolutions.

My goal is to achieve the following:

The left side features 3 calendar controls stacked on top of each other, which I've successfully implemented.

The middle section includes a DayPilot Calendar control, with an input field below to enter notes, both of which I've managed to include.

On the right side, I need a panel where users can add labels, dropdown menus, and more related to the calendar, but I'm struggling to position this correctly.

Below is a snippet of my CSS code:

#body {
height: 540px;  
}

#dashboardinformataion { 
height: 481px;
width: 80%;
margin: 0 auto 0;
display: flexbox;
display: -ms-flexbox;
}

#txt_headernotes { 
width: 100%;
text-align: center;
}

#txt_displayinformation { 
width: 100%;
height: 12.5%;
}

#middlesection { 
height: 481px;
}

#calender_control { 
width: 700px !important;
}

Here is the corresponding HTML code:


    <div id="body">
        <div id="dashboardinformataion>
            <DayPilot:DayPilotNavigator ID="DayPilotNavigator1" runat="server"
                BoundDayPilotID="calendar_control"
                SelectMode="Month"
                ShowMonths="3"
                SkipMonths="3"
                DataStartField="start"
                DataEndField="end"
                VisibleRangeChangedHandling="CallBack"
                OnVisibleRangeChanged="DayPilotNavigator1_VisibleRangeChanged">
            </DayPilot:DayPilotNavigator>

            <div id="middlesection">
                <DayPilot:DayPilotMonth CssClassPrefix="bsimplexcalendar" OnCommand="calendar_control_Command" ContextMenuID="menu" EventRightClickHandling="ContextMenu" EventRightClickJavaScript="select(e)" BubbleID="DayPilotBubble1" ClientObjectName="dpm" runat="server" ID="calendar_control" Theme="bsimplexcalendar" HeightSpec="Auto" Height="0" MinCellHeight="63" DataStartField="start" DataEndField="end" DataTextField="name" DataValueField="id" OnBeforeEventRender="calendar_control_BeforeEventRender" />
                <input runat="server" id="txt_headernotes" placeholder="Notes" />
                <input runat="server" id="txt_displayinformation" />
            </div>

            <asp:Panel ID="Panel1" runat="server" BackColor="Black"></asp:Panel>
       </div>

Am I positioning elements correctly? How do I place a panel on the right-hand side with a width of 140px?

EDIT: Here's the link to my CodePen: www.codepen.io/anon/pen/snJAc Thank you in advance!

Answer №1

<div class="container">
max-width:500px; margin: 0 auto;

<div class="left-column">
height: 500px;
width:100px;

</div>

<div class="middle-section">
float:left;

<div id="middle1">
height: 250px;
width: 300px;
</div>

<div id="middle2">
height: 50px;
width: 300px;
</div>

<div id="middle3">
height: 200px;
width: 300px;
</div>

</div> <!-- end middle-section -->

<div class="right-column">
width: 100px;
height: 500px;
float:left;
</div>

</div> <!-- end .container -->

Here are the classes and just add the corresponding CSS to them.

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

Evaluate the row of a gridview using the column name as a parameter instead of the index

In my gridview, the OnRowDataBound event is associated with the following function: if (e.Row.RowType == DataControlRowType.DataRow) { ThisRow = e.Row.DataItem as MyObjectModel; if (ThisRow.Property1 == null) { e.Row.Cells[5].Text = "-"; } The c ...

Is it possible to incorporate a foreach loop while also implementing unique adjustments at specific locations within the code?

I have been searching for a solution to this problem on various forums, but I couldn't find one that fits my needs. My challenge is to create a foreach loop for 12 elements, with 3 of them having a different class applied to them. This is the code I ...

How to implement a ServiceStack client outside of the .NET framework?

My intention is to utilize the REST services provided by ServiceStack from platforms outside of .NET, such as Java and Obj-C. I anticipate that interacting with these services should be straightforward due to their RESTful nature. However, the documentatio ...

Nivo Slider experiencing issues with malfunctioning links

My website features a Nivo Slider slideshow with images enclosed in clickable links, but I am unable to click on them. You can view the slideshow by visiting this link: The slideshow is powered by the Nivo Slider Views module for Drupal. ...

Tips for resuming a video playback in HTML5 after pausing it for a brief moment

I am working with a video called introVid, and my goal is for it to pause for 2 seconds when it reaches the 1 second mark before resuming playback. Although I've attempted to achieve this using the code below, the video remains in a paused state after ...

Organizing table components solely using CSS

Can anyone help me center 3 spans in a list within a table? Currently, the alignment looks like this: spans not properly centered. However, I want it to appear like this: span properly centered. ul { text-align: center; list-style-position: inside; ...

What is the best method to set up separate column filters when using DataTables with serverSide enabled?

I am facing an issue with the search column in my datatable. The problem is that the search functionality doesn't work properly because I am retrieving data from the database in batches of 10 via AJAX when the user clicks on a page number. This means ...

How can one address the issue of undefined data within table cells?

I have encountered an issue while reading and displaying an XML file on a webpage using a JavaScript script. The problem arises when the page loads, and the information inside the cells of the table shows as "UNDEFINED". The intended display should include ...

Sending numerous variables through a JSP URL

I am attempting to send multiple values in a JSP page URL to another one. Below is the code I'm using: <form name="QuantityForm" onsubmit="return quantityValidation()" action='<%="basket.jsp?addItem="+product.PID%>' method="post"&g ...

The server is not functioning properly and is displaying an error message stating "Ensure that adequate permissions have been authorized." What steps can be taken to resolve this issue?

My computer is displaying an error message stating "Verify that sufficient permissions have been granted and Windows User Account Control (UAC) restrictions have been addressed" when trying to access the report server. How can I fix this issue? Here is t ...

Extracting Data from HTML Using VBA

I'm attempting to extract the value from the following HTML source code: K<sub>C</sub> [ksi&#8730in]:<br> <input class="test1" type="text" name="fKC" value=""> <br> However, the code I tried using does not seem to ...

How can you identify dynamically created elements within an AngularJS directive?

I have a directive where I need to target specific DOM elements, some of which are dynamically generated in an ng-repeat loop. If I try to select them directly, I only get the static elements. However, if I delay the selection by, let's say, 500ms, I ...

C# is the pattern utilized in ASP.NET Web API code

In my repository layer, I have the code snippet below. public class EmployeeDetailsRepository : IEmployeeDetailsRepository { private readonly IDataAccess _dataAccess; public ILogger Logger { get; set; } public EmployeeDetailsRepository(IDataA ...

Encountering a C# ASP.NET error while attempting to parse JSON data from a file using JObject

I'm attempting to run the following code: JObject settingsInfo = JObject.Parse(File.ReadAllText("settings.json")); const string ServerName = (string)settingsInfo["servername"]; Despite its apparent simplicity, I am consistently encountering the fol ...

Tips for replacing spaces with &nbsp; in a string using ReactJS and displaying it in HTML

<div className="mt-2 font-sidebar capitalize"> {item.title} </div> item.title can vary and be any string retrieved from the backend, such as "all products", "most liked", "featured items", etc. I am looking for a solution to subst ...

attempting to access a variable which was initialized within a function in different sections of the code base

My goal is to retrieve a variable created within a function that is nested in a resize event parameter in jQuery. This variable should be dynamically updated each time the user resizes the browser window. I intend to utilize this variable to set the width ...

Discovering uncategorized elements using javascript

Let's say I have a piece of HTML with some content that is not wrapped in any tags, like this: <html> <body> <p>text in a tag</p> other text outside any tag </body> </html> Is there a way to access the untagged el ...

Ways to Align an Item Horizontally within a Material-UI Typography Element

Struggling with centering the logo in an AppBar on extra small screens while using MUI V5 in a react project. The Typography component is nested inside a ToolBar within an AppBar that only displays on xs screens. Check out my code snippet below: <Box ...

What are some ways to utilize a Bootstrap modal button embedded within a clickable row?

Having a strange issue in my project. I am trying to incorporate a modal button inside a link-able row. However, when I click the button to trigger the modal id, it pops up and then redirects to the myexample.com page, which is expected behavior. While I ...

How can I create an HTML select dropdown menu with a maximum height of 100% and a dynamic size?

The dropdown menu I created using an HTML select tag contains a total of 152 options. However, the large number of options causes some of them to be out of view on most monitors when the size is set to 152. I attempted to limit the number of displayed opti ...