Personalized Design Incorporating Sections and Sidebars

I need the aside to be positioned on the right side and the section on the left side, both centered in the space.

Feel free to check out this link

<!DOCTYPE html>
<html>
<head>
<style>
#main {
 width: 800px;
  margin: 0 auto; 
}

.righttt{
  position: relative;
  right: 0px;
  width: 200px;

}

section {

overflow: left;

}


</style>
</head>
<body>

    <header>
    <h1>City Gallery</h1>
    </header>

    <div id="main">
        <section>
        <h1>London</h1>
        <p>
        London is the capital city of England. It is the most populous city in the United Kingdom,
        with a metropolitan area of over 13 million inhabitants.
        </p>
        <p>
        Standing on the River Thames, London has been a major settlement for two millennia,
        its history going back to its founding by the Romans, who named it Londinium.
        </p>
        </section>

        <section>
        <h1>London</h1>
        <p>
        London is the capital city of England. It is the most populous city in the United Kingdom,
        with a metropolitan area of over 13 million inhabitants.
        </p>
        <p>
        Standing on the River Thames, London has been a major settlement for two millennia,
        its history going back to its founding by the Romans, who named it Londinium.
        </p>
        </section>

        <aside class="righttt">
        <h1>London</h1>
        <p>
        London is the capital city of England. It is the most populous city in the United Kingdom,
        with a metropolitan area of over 13 million inhabitants.
        </p>
        <p>
        Standing on the River Thames, London has been a major settlement for two millennia,
        its history going back to its founding by the Romans, who named it Londinium.
        </p>
        </aside>    
    </div>

    <footer>
    Copyright © W3Schools.com
    </footer>

</body>
</html>

Answer №1

#wrapper {
    width: 100%;
    height: 100%;
}

#header {
    width: 100%;
    height: 50px;
    background-color: green;
}

#nav {
    width: 100%;
    height: 50px;
    background-color: red;
}

#section {
    width: 50%;
    height: 100px;
    background-color: yellow;
    float: left;
}

#aside {
    float: right;
    width: 50%;
    height: 200px;
    background-color: green;
}

#article {
    float: left;
    width: 50%;
    height: 100px;
    background-color: orange;
}

#footer {
    width: 100%;
    height: 50px;
    display: inline-block;
    background-color: blue;
}
<div id="wrapper">
    <div id="header">
        Welcome Header    
    </div>
    <div id="nav">
       Navigation Menu
    </div>
    <div id="section">
        Main Section
    </div>
    <div id="aside">
        Aside Section
    </div>
    <div id="article">
        Article Content
    </div>
    <div id="footer">
        Page Footer
    </div>
</div>

Answer №2

<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - Unique Demo Page</title>  
<script type="text/javascript" src="/js/lib/custom.js"></script>  
<link rel="stylesheet" type="text/css" href="/css/custom.css">  
<style type="text/css">
#main {
  width: 100%;
  margin: 0 auto;
 text-align: center;
}
section {
  overflow: left;
  float: left;
  width: 75%;
}

 .righttt {
    position: relative;
    right: 0px;
    width: 25%;
    float: right;
  }

</style>
</head>
<body>
<header>
<h1>Unique Gallery</h1>
</header>
<div id="main">
    <section>
    <h1>Paris</h1>
    <p>
    Paris is the capital city of France. It is known for its art, fashion, gastronomy,
    and culture.
    </p>
    <p>
    Often referred to as the City of Light, Paris has been a global center for art,
    fashion, and high culture for centuries.
    </p>
    </section><aside class="righttt">
    <h1>Paris</h1>
    <p>
    Paris is the capital city of France. It is known for its art, fashion, gastronomy,
    and culture.
    </p>
    <p>
    Often referred to as the City of Light, Paris has been a global center for art,
    fashion, and high culture for centuries.
    </p>
    </aside>

    <section>
    <h1>Tokyo</h1>
    <p>
    Tokyo is the capital city of Japan. It is one of the most populous urban areas in the world,
    with over 37 million residents.
    </p>
    <p>
    Known for its modern technology and traditional culture, Tokyo is a vibrant city that
    offers something for everyone.
    </p>
    </section>


</div>
<div style="width: 100%;float: left;  text-align: center;"><footer>
Copyright © UniqueWebsite.com
</footer></div>
</body></html>

Check out this unique code snippet here:

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

Preserve text input from a multi-line textarea

Having an issue with a form that includes a <textarea>....</textarea> field. When saving the text, it displays the result in another form but as one continuous line within a paragraph <p>...</p>. The problem arises when trying to e ...

Laravel does not have the capability to provide a genuine json response

I am facing an issue with my Laravel controller. The code is straightforward: class MyController extends Controller { public function list() { return response()->json(['a' => 'hello']); } } When I access the ...

Masking of the Navigation Button

I designed a responsive navigation bar, but in mobile view, the menu icon is being hidden by the menu headings when displayed. Check out the scenario below with a provided CodePen link. I attempted to adjust padding and float properties without success. An ...

Can the name of the ngx-datatable-column be altered?

I recently started developing an angular2 web application that includes a ngx-datatable component. The header columns all have numeric names, but I would like to customize them in the view. Despite my efforts to research this issue, I haven't come ac ...

Displaying updated character counts in Angular directive based on various triggers

I am currently working on creating a characterCounter attribute directive specifically for input fields. My idea is to use 'ngModel' to access the length of the modelValue in ng-model, and to define a max-length within the directive's scope. ...

Passing parent form controls from an Angular 4 FormGroup to a child component

I have implemented Angular Reactive Forms FormGroup and FormArray in my project. The issue I am facing is related to splitting my form fields into child components and passing the parent form controls to them. I expected this to be a straightforward proces ...

What is causing me to have difficulty importing any of the images located in the public folder?

I'm currently tackling the NextJS framework, and I'm having trouble importing images that are stored in the public folder. Despite being able to navigate through folders, the images aren't displaying as expected. Here is the import line and ...

Am I making a mistake in my implementation of sending Socket.io messages to a designated room?

Upon a user joining, I alter their ID to a shortened random code. This change is made to utilize the id as a visible session ID on the front-end. I mention this to prevent confusion regarding non-standard socket IDs and their relation to potential issues. ...

Troubleshooting issues with Firebase integration in a Node.js environment

I am currently encountering difficulties implementing Firebase in my Node.js project. Below is the code snippet that I am attempting to execute on Node. var firebase = require("firebase"); var admin = require("firebase-admin"); var serviceAccount = requi ...

Exploring the Power of Asynchronous Operations with Await and Async in

I have a basic understanding of how to use await/async in Angular 2 with the following example: async getValueWithAsync() { const value = <number>await this.resolveAfter2Seconds(20); console.log(`async result: ${value}`); } In my Angular ...

Unusual behavior in sorting values with JavaScript

I have spent hours trying to figure this out, and the only conclusion I can come to is that when there are 14 elements to sort, it doesn't function properly, but with thirteen elements, it works perfectly. My goal is to sort DIV elements based on the ...

Discovering all instances of a particular name in JSON using incremented values: a guide

I am looking to automatically detect every occurrence of a specific name in my JSON data. { "servergenre": "Classic Rock", "servergenre2": "pop", "servergenre3": "rock", "servergenre4": "jazz", "servergenre5": "80s", "serverurl": "http://www.n ...

Modify the text color of all input elements with Tailwind

I have been using this code in multiple sections of the app: <label className="input text-neutral-content"> Name <input type="text" className="grow text-base-content"/> </label> While I understand that ...

Html content overlapping div rather than being stacked vertically

My goal is to arrange a group of divs inside another div in a vertical stack. However, I am facing an issue where the text from the last div is overlapping with the second div instead of following a proper vertical alignment where the text in the third div ...

Adaptable arrow-shaped progress bar featuring sleek transparent borders

I am currently working on creating a progress bar similar to those commonly found in checkout processes. One issue I have encountered is that the borders between the arrows appear transparent, and the entire design needs to be responsive. So far, I have m ...

Positioning the close button on the top right edge of a Material-UI Dialog: A step-by-step guide

https://i.sstatic.net/ARTtq.png How can I include a close icon in the top right corner of the header section? I'm using the Material UI Dialog and everything works well, but I need a close button in the top section. Can anyone assist me with this? ...

Can a client-side React component or application be hosted on a server-side Express route?

Currently, I have a Node/Express backend that utilizes Pug.js to render various server-side routes for a basic, static website. In React.js, I have developed an interactive "builder" component through CRA, enabling visitors to configure products interacti ...

Extract data with Python Selenium

Can someone help me figure out how to extract the value "document sent" from the HTML code below using Python's Selenium library? I've tried the code snippet provided, but it returns None. print(driver.find_element_by_id('errorMessage' ...

Next.js: Dealing with special characters in YouTube video API snippet titles

Trying to find the perfect video snippet title without any special characters. Accessing the API: https://www.googleapis.com/youtube/v3/search, along with specifying snippet. The current output for snippet.title is as follows: I&#39;M GONNA CARRY ...

How to Convert Irregular Timestamps in Node.js?

Currently, I am utilizing an API to retrieve information from Google News and proceed to save the data in Firestore. The challenge lies in the fact that the API delivers timestamps in various formats which are not uniform. For example: "1 Day Ago", "June ...