Navigation buttons are stuck in place and unresponsive

I need to create a page header with large text at the top and subtext below it, all positioned on the left side of the page. On the right side, I want a group of buttons for a menu that can be easily moved to a specific location. Currently, I am struggling to move these buttons effectively. Here is my current code snippet:

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"/>
<script src="script.js"></script>

<style>
.button1, .button2, .button3 {display:block;}
.row {
  padding: 10%;
}
.button-group {
position: relative;
float: right;
margin:-340px auto;
}

.button1 {
height: 25px;
width: 80px;
position: absolute;
top: 50px;
left: 120px;
}

.button2 {
height: 25px;
width: 80px;
z-index: 1;
float: right;
top: 50px;
left: 180px;
}

.button3 {
height: 25px;
width: 80px;
z-index: -1;
float: right;
top: 50px;
left: 20px;
}
</style>
<style>
table {
border-collapse: collapse;
width: 100%;


}
tr.border_bottom td {
border-bottom:1pt solid black;
}

th, td {
padding: 10px;
text-align: left;
border-bottom: 3px solid #ddd;
border-top: 3px solid #ddd;
}
</style>
<style>
body {
background-color: darkblue;
}
</style>
<style>
h2 {
font-size: 20px;
}

p {
font-size: 14px;
}
</style>

<style>
body {
color: white;
}

h1 {
color: white;
}

p {
color: darkgrey;
}
</style>
<style>
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
</style>
<style type="text/css">
    a.nounderline {text-decoration: none; }
</style>
<style type="text/css">
    a.nounderline {text-decoration: none; }
</style>
</head>
<body>
<div class="container">
    <div style="padding-left:60px">
    <h2 size="6" style="font-family:sans-serif"><b>Python Code</b> 
</h2>
    <p>Make use of this database of Python code to improve your current projects</p>
</div
<div class="row button-group">
    <button class="btn btn-primary button2"><a 
href="/movielist">BUTTON 1</button>
    <button class="btn btn-primary button2"><a 
href="/python_forum">BUTTON 2</button>
    <button class="btn btn-primary button3">BUTTON 3</button>
</div>
</div>
<br/>
<table width="90%">
 {% for x in pythonforum:  %}
  <tr>
    <td width=20%> {{ x[2] }} </td>
    <td width=20%> {{ x[1] }} </td>
   </tr>
 {% endfor %}
</table><br/>
</body>
</html>

I am aiming to achieve a button group similar to the one found on this site: . Any assistance in achieving this would be highly appreciated.

Answer №1

I have made some adjustments to your code in hopes that it will be beneficial for you. Thank you

body {
background-color: darkblue;
color: white;
font-family: Arial, Helvetica, sans-serif;
margin: 0;
}

a.nounderline {
text-decoration: none;
}

h2 {
font-size: 20px;
margin: 0;
}

p {
font-size: 14px;
color: darkgrey;
margin: 0;
}

table {
border-collapse: collapse;
width: 100%;
}
tr.border_bottom td {
border-bottom:1pt solid black;
}

th, td {
padding: 10px;
text-align: left;
border-bottom: 3px solid #ddd;
border-top: 3px solid #ddd;
}

.container {
display: flex;
justify-content: space-between;
padding: 10px;
}

.nav-link {
display: flex;
align-items: center;
}

.nav-link ul {
background-color: #000;
margin: 0;
padding: 0 0 3px;
list-style: none;
display: flex;
}

.nav-link li a {
    color: #eee;
font-size: 10px;
text-decoration: none;
padding: 0 15px;
  white-space: nowrap;
}

.nav-link li + li a {
border-left: 1px dotted #666;
}
<div class="container">
    <div>
        <h2 size="6" style="font-family:sans-serif"><b>Python Code</b></h2>
        <p>Make use of this database of Python code to improve your current projects</p>
    </div>
<div class="nav-link">
<ul>
<li><a href="/movielist">BUTTON 1</a></li>
<li><a href="/movielist">BUTTON 2</a></li>
<li><a href="/movielist">BUTTON 3</a></li>
</ul>
</div>
</div>
<br/>
<table width="90%">
 {% for x in pythonforum:  %}
  <tr>
    <td width=20%> {{ x[2] }} </td>
    <td width=20%> {{ x[1] }} </td>
   </tr>
 {% endfor %}
</table><br/>

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

The optimal method for selecting a button from a group of buttons on a calculator using pure JavaScript

I have developed an HTML/CSS code inspired by the Mac/Apple calculator design. It features buttons organized in 5 rows using flexbox. You can view my code on this codepen: <div class="wrapper"> <div class="calheader"> ...

Applying class to target specific screen size in Bootstrap

I've been utilizing bootstrap for my project. My objective is to assign multiple classes based on screen size, such as sm-col and xs.col. For example, let's say I have a text id <div id="text" class="xs-format lg-format ..."></div> ...

Pictures glide within containers

Hey, I'm having an issue with my images. They're not floating like they should be, even though they are centered in the div. I really want them to float and be centered. Here's the code snippet I've been working with. HTML <div cla ...

The size of Bootstrap 3 columns adjusts dynamically based on the width of the window as the page is being

I am facing an issue with the layout of my bootstrap site when resizing the 3 horizontal columns based on the window size upon page load. Currently, I have a script that adjusts the height of each column to match the tallest one so they appear uniform whe ...

What are some ways to customize icons in a NextJs project?

Having trouble changing the color of the icon using this method. The image is being sourced from "next/image" <Image className={styles.icon} alt="arrow" src={ArrowIcon} /> module.css .icon { stroke: blanchedalmond; & path ...

HTML: Ensure that a user fills out a minimum of one text box before submission

<tr><td> First Name: </td><td><input type="text" name="FirstName" required></td> </tr> <tr><td> Last Name: </td><td><input type="text" name="LastName" required> </td></tr> ...

Looking for assistance in centering a DIV with absolute positioning horizontally?

I'm trying to center some elements with absolute positioning within a container. I've found a solution that works in most browsers, except for IE7. In IE7, the width of one of the elements shrinks to 0 even though it's specified in the CSS. ...

Create animated changes in height for a mdDialog as elements are shown or hidden

Utilizing Angular Material, I have implemented tabs within an md-dialog. The dialog smoothly adjusts its height based on the content of the active tab during navigation. However, when utilizing an ng-if directive to toggle visibility of content, there is n ...

Creating an HTML layout that consists of three image elements placed over a single background image with each image

In my HTML code, I am utilizing multiple div elements. Each div is designated to hold an image with dimensions of 1600*750. Within each div, there is a fixed image that repeats across all the divs by using a specified class. Here are the details for each f ...

The dropdown menu fails to appear overlapping the header

I'm having an issue with a dropdown menu item in my navigation bar. The dropdown is set to position:absolute, but it's getting cut off. How can I ensure the dropdown stays below the link? I've tried changing the position to fixed, but then ...

Incorporating a .png file for hover effects

I've been trying to set up a tooltip that displays a png image when I hover over a section of a CSS map. Unfortunately, my attempts thus far have been unsuccessful. Every time I try to insert the image, it either causes the tooltip to disappear entir ...

Strange occurrences within the realm of javascript animations

The slider works smoothly up until slide 20 and then it suddenly starts cycling through all the slides again before landing on the correct one. Any insights into why this is happening would be greatly appreciated. This issue is occurring with the wp-coda- ...

Expand a list item to full width based on the number of items present

Is there a way to make dynamically added list items in a footer stretch across the width of their container? The footer is created in WordPress and the list items are actually widgets. Here is an example: Fiddle I can't manually set the width for e ...

Where should the npm install command be executed?

I'm trying to incorporate a frosted glass effect into my project, but I'm unsure of where to place the npm install frosted-glass --save command. I use Atom as my code editor and already have Node.js installed, but I can't seem to figure out ...

What is the specified height for the AppBar and Toolbar components in Material-UI?

I'm trying to figure out the exact height being used in this scenario: <AppBar position="static"> <Toolbar> because I'll need that information for a calculation in another component. My current assumption is that it's 64px, b ...

Move images horizontally next to the height of an element

I am attempting to increase the top attribute in relation to the element it is currently adjacent to. The element should only scroll directly next to the other element and cease when it surpasses the height of that element. My Goal: I want the image to re ...

Utilizing Ajax to dynamically update the color of a button when it is clicked from a different device

Currently, I am developing a program for my own use within my local community theater. The setup will involve a computer in the control room (Sound Booth) and another computer backstage. My plan is to create a grid of around 10 interactive "buttons" on th ...

Styling an image with CSS at the top

image with 3 lines on itI am looking to create a color element that resembles a border but slightly overlaps the bottom part of the image - similar to the example shown in the linked picture. I attempted to use CSS borders, but it did not achieve the desi ...

Expanding iframe elements

I am having difficulty adjusting the size of the iframe content (within a fixed-sized iframe). Essentially, I would like the content to scale smaller or larger as if the browser's zoom function was being used. Through my CSS experiments, it seems achi ...

Using jQuery to define and apply style attributes

I'm currently working on a script that will add a left and right border to a button in a row of 3 buttons when that specific button is clicked. The goal is for the borders to remain while the button is active, and disappear once another button is clic ...