What is preventing me from positioning the .panel pricing section in the middle of the webpage?

I'm facing a few challenges that I need help with:

  1. The issue with the .panel class is puzzling. Although my CSS should affect the entire panel, it's not centered on the screen despite some styling applying correctly (line 153, 235).

  2. When I change the class name of the section in HTML and then update it in the CSS, the styles no longer work as intended (line 235).

  3. My priority right now is to make the website responsive and ensure the panel is perfectly centered. Currently, scrolling sideways is needed to view the whole page. Any quick tips on sizing would be greatly appreciated.

/* * {
  
} */

#title1 {
    color: #ffffff;
    text-align: center;
    font-weight: 700;
    font-style: oblique;
    text-decoration: #D8E2DC;
    font-size: 40px;
    display: flex;
    position: relative;
    bottom: 50px;
    left: 100px;
    font-family: 'Abril Fatface', cursive;
}

#title2 {
    color: black;
    text-align: center;
    font-weight: 700;
    font-style: oblique;
    text-decoration: #000000;
    font-size: 80px;
    display: flex;
...

        </section>

        <section id=flexpractice>
            <div style="background-color: #80ffdb"></div>
            <div style="background-color: #64dfdf"></div>
            <div style="background-color: #48bfe3"></div>
            <div style="background-color: #5390d9"></div>
            <div style="background-color: #6930c3"></div>
        </section>


    </main>

</body>

</html>

Answer №1

  • To center the panel, simply add margin:auto; to its class.
  • Avoid using position: relative; on navigation tags - explore alternative methods.
  • Delete any padding set on the panel's class name.

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

Will the fancy box images in links load even if they are not clicked on?

I have implemented fancybox on my website to display secondary images when desired by the user. The images are stored inside fancybox links, as shown below: <a class="fancybox" title="Click to see more detail" href="media/more-detailed-image.jpg">&l ...

Could you suggest an alternative method for retrieving the image from the database and displaying it in the Dynamic Carousel?

Many people have asked the same question, but none of their solutions have worked for me. I used bootstrap to create a Dynamic Carousel that fetches images from the database folder path (uploadimages/news/) and used a foreach loop to iterate over arrays. H ...

Learn the process of showcasing database content on a webpage with an interactive feature that enables users to choose and access additional details

Apologies if this question has been asked before, I have searched for a solution but my web development knowledge is limited. To better understand my issue, you can visit the site at 000freewebhost by following this link: In summary, I am trying to select ...

In Django templates, when you break a line in the code it results in a space being

Looking for a solution in a simple template {% with var1="super" var2="man" %} <p> {{ var1 }} {{ var2 }} </p> {% endwith %} The code currently outputs super man, but I need it to be superman. Using {% spaceless %} d ...

using CSS to create page division

My webpage is structured into three sections: left, center, and right. Elements that should be displayed in the center have the attribute class="center", while those intended for the right are marked with class="right". However, I am encountering an issue ...

Steps for creating a dynamic website that automatically updates as you make changes

I am currently working on a web project that involves real-time updates where any changes made to the website will automatically reflect for all viewers. I have been considering using AJAX, but I am unsure if there are simpler tools or methods available to ...

Overflow causes flexbox to become unreactive

Implementing the overflow style on a flexbox element appears to negatively impact its responsiveness. Here is the corresponding code snippet: .projects-wrapper{ display: flex; flex-wrap: wrap; justify-content: center; text-align: center; width ...

Positioning Issue: Z-index Functionality Failing

I've been struggling to find a solution to my issue regarding a search function. Whenever I type, the search function dropdown gets hidden behind the menu bar, even after adjusting the z-index values. I've heard that z-index doesn't always ...

How come my transform command is not functioning on both axes as intended?

My transform: translate(10px 10px) isn't functioning as expected. When I only provide a value for the x-axis, it works fine. Using translateX and translateY separately works as well, but using both at the same time doesn't work. This means I can ...

Unable to make changes to the recently inserted rows

I'm having trouble editing newly added rows in my table. I've assigned a class to the newly added row, but when I click the edit button, nothing happens. Furthermore, once I do manage to edit a row, the edit button stops working altogether. It se ...

Steps for redirecting to the homepage after a successful login in a ReactJS single-page application

Issue: I am facing a problem where, after clicking the login button, my page does not redirect to the home page. Even though I have successfully logged in as per the Application, I need to refresh (F5) the page to get everything back to normal after loggin ...

Having trouble sending messages on the server?

Programmer Seeking Help with Adding Data on the Server using JavaScript Stack I am encountering an issue with my javascript code as I am attempting to use the post method to add data on the server-side, but it seems to not be posting successfully. Can ...

Delay the occurrence of a hover effect until the previous effect has finished executing

As I hover over an element, the desired animation is displayed while hiding other elements on the page. The challenge I'm encountering is that if I quickly hover over many divs, the animations queue up and hide the divs sequentially. I want only one ...

Set the background to be transparent while keeping the text opaque

Is there a way to make only my div transparent using the opacity property while keeping the font normal? I cannot assign a separate class or id to the content as it is dynamically generated. Also, using background: rgba(); is not an option for me. {opacit ...

Can the script be loaded into a TypeScript file?

I'm currently in the process of integrating this script tag into my Angular 2 project, but I'm searching for a way to incorporate it into the typescript file so that I can access its methods within the .ts file. <script type="text/javascript" ...

Can multiple shadow hosts utilize a common shadow DOM?

As I navigate the world of Web Components, I find myself still grappling with a full understanding of its capabilities. One thing that stands out to me is the numerous advantages it offers. A burning question in my mind is whether it's feasible to sh ...

Change the URL to eliminate the `.html` file extension

I have been struggling to remove the .html extension from my website's URL with no success. <Website>. I created a .htaccess file and added the following code: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1 ...

unable to pre-select default option

My dynamic options select is functioning correctly, adding the selected attribute to a specific option with an id value. However, I am encountering an issue where even with an option that has the selected attribute, the first option is always displayed as ...

"Safari is not displaying the element's height correctly when set to 100

I am facing an issue where I have a child div vertically centered under a parent div with a specific height. The child div is assigned the height:100% property, but it seems to be not working correctly on Safari only. To see more about this problem, you ca ...

Arranging div elements side by side in a way that they slightly overlap each other

I'm trying to create a unique layout for a table of elements (pictures) where they are arranged horizontally and partially overlap to save space. I've been experimenting with CSS to achieve this effect. Here's the code I've come up wit ...