Positioning buttons in a grid using CSS - Tips and tricks

Help needed! Seeking professional advice.

I have a few issues that I can't seem to solve on my own. Firstly, regarding the second menu - should I use padding to position it correctly? Secondly, although I managed to make the navigation bar visually similar, when I added images they turned out low resolution and also stopped turning blue when active. Additionally, I believe using an arrow as an improvised shape with hidden overflow is incorrect because I want the entire design to be responsive on mobile devices. Unfortunately, it's not responsive at all. For example, resizing the button affects the size of the top left logo. I've been struggling with this supposedly simple page for 2-3 days now. Should I consider starting over?

.html{
height: auto;
}
.uk-container
{
display: flex;
margin: 0 0 0 0;
padding: 0 0 0 0;
height:auto;

}
.box-1
{
width:100%;
height:auto;
margin: 0;
padding: 0;
}
#card{
margin: 0;
padding: 0;
height: 100%;
width: auto;
display:block;
}
box-2
{
display: inline-block;
}
...
<ul {
position: relative; ... }
ul li {...}
...
<!DOCTYPE html>
<html>
<head>
 ...
</head>
<body>
<div class= "uk-container">
<div id="card" ...
...
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script type="text/javascript">
$(document).on('click','ul li', function(){
...
})
</script>
<div class="contactdiv">
...
</div>
...
</button>
...
</div>
</div>
</div>
</div>
</body>
</body>
</html>

Intended design: Current appearance:

I was supposed to finish this (and two more tasks) by Wednesday, which has already passed. I have been stuck on this particular issue for 4 days now.

Answer №1

.html{height: auto;}
.uk-container {
display: flex;
margin: 0 0 0 0;
padding: 0 0 0 0;
height:auto;
}
.box-1 {
width:100%;
height:auto;
margin: 0;
padding: 0;
}
#card{
margin: 0;
padding: 0;
height: 100%;
width: auto;
display:block;
}
.box-2 {
display: inline-block;
}
.ul {
position: relative;;
padding: 0;
}
ul li {
background-repeat: none; background-position-x:200px;
border:0;
line-height: 15px;
margin:0%;
padding: 9px;
text-align: left;
position: relative;
height:100%;
list-style: none;
margin-bottom: 5px;
background-color: #eeeeee;
}
ul li.active:after {
content: "";
width: 0;
height: 0;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 20px solid #0092ff;
position:absolute;
top: 20%;
right:-15px;
}
ul li a {
display:block;
padding:10px 10px 10px 20px;
text-decoration: uppercase;
color:#555353;
font-weight: bold;
overflow: hidden;
}
ul li.active a {
background:#0092ff ;
color:white ;
}
ul li.active:hover a {
color:white;
}
ul li:hover a {
text-decoration: none;
color: rgb(149, 147, 147);
}
.contactdiv {
display: flex;
position: center;
justify-content: center;
}
#contact {
background-color: #555353;
color: #eeeeee;
border-radius: 4px;
margin: 4%;
}
.button {
border: none;
color: white;
padding: 100px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
}
.buttn {
border:0;
padding: 75px;
border-radius: 5px;
cursor: pointer;} 
<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.3/css/uikit.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.3/js/uikit.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.3/js/uikit-icons.min.js"></script>
<script src="js.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<title>Gerege EasyPay</title>
</head>
<body>
<div class= "uk-container">
<div id="card" class="uk-card uk-card-horizontal uk-card-default uk-card-body">
<div class="uk-card-media-top">
<img src="1/gerege.png" alt="Something Went Wrong...">
</div>
<div class="box-1">
</div>
<div class="uk-width-auto"> <!--270 px height 170 px width-->
<ul> <!--starting to understand why bootstrap,uikit was made-->
...
</button>

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

Is there a way to organize an array of elements into three columns using PHP?

My array of menu items is being displayed on the screen in 3 columns, but I want them to appear differently without altering the HTML structure. Currently, they are listed like this: 1 2 3 4 5 6 7 8 9 I would like them to display as follows: 1 4 7 ...

I am unable to retrieve images using the querySelector method

Trying to target all images using JavaScript, here is the code: HTML : <div class="container"> <img src="Coca.jpg" class="imgg"> <img src="Water.jpg" class="imgg"> <img src="Tree.jpg" class="imgg"> <img src="Alien.jpg" class=" ...

A guide on updating the SQL order value through a select option using PHP and jQuery

To modify the arrangement of SQL data according to the chosen select option, I am looking to adjust the ORDER value. Within my action.php file, I retrieve values from the database and aim to incorporate a sorting select option that allows for changing the ...

Tips for properly formatting quotes in JSON to activate a link

I am working with a JSON configuration file that looks like this: "type": "script", "label": "coreapps.archivesRoom.printSelected", "script": "emr.fragmentActionLink(${project.parent.artifactId},\"downloadPatientHistory\", &bs ...

Angular formly - Enhancing User Input Focus

I have created a field wrapper that converts normal text into an input when hovered over with the mouse. Additionally, I have a directive that sets focus on the field when it is activated. Now, I am looking for a solution where the field remains open as l ...

React is unable to access and retrieve data from a web API

Currently, I have a controller set up in web-api for my project. I am using React v18.2.0 and NextJS v13.3.0 to work with this setup: public List<ReturnDat> Get() { List<ReturnDat> lst = new List<ReturnDat>(); lst.Add(new ReturnD ...

Troubleshooting problem with sorting in Angular 4 material header

Using Angular 4 material for a table has presented me with two issues: 1. When sorting a table, it displays the description of the sorting order in the header. I would like to remove this. https://i.sstatic.net/5bHFO.png It displays "Sorted by ascending o ...

What causes the Vue.http configuration for vue-resource to be disregarded?

I am currently utilizing Vue.js 2.3.3, Vue Resource 1.3.3, and Vue Router 2.5.3 in my project while trying to configure Vue-Auth. Unfortunately, I keep encountering a console error message that reads auth.js?b7de:487 Error (@websanova/vue-auth): vue-resour ...

Having trouble hiding the hamburger menu depending on the screen width

I'm trying to figure out how to hide the hamburger menu when the screen width exceeds 400px. You can check out the site at damf.co Currently, the hamburger menu appears when the screen width is less than 400px. If you click on it and then expand the ...

Create a custom slider using jQuery that pulls in real-time data for a dynamic user

My goal is to implement a dynamic slider feature in my Django project by using jQuery and ajax. I have managed to create previous and next buttons for swiping through profiles with the help of others, but I am currently facing an issue with a NoReverseMatc ...

Validate the selection of an option field based on the value chosen in a radio field using PHP form validation

In my form, there's a radio field where selecting "yes" triggers the appearance of a new field to select a city. The dropdown options for cities start with "Choose from." I want the first option value, which is "Choose from," to be empty. This way, va ...

What is the best way to push a variable after employing the split function in JavaScript?

error: An unexpected TypeError occurred while trying to read property 'push'. The error was on this line: " this.name[i].push(arrayData[0]); " I'm confused because the console.log statement before that line shows "data is loaded:" alo ...

Determining if a webpage is actively processing an ajax request using jQuery

Is it feasible to create a function in Jquery that activates with each ajax request, such as displaying "loading..."? ...

IE9 encounters a setback with AJAX Jsonp request

Below is the code snippet I am working with: $.ajax({ type: 'POST', url: 'index.jsp', data: 'id=111', dataType: 'jsonp', success: function(data) { alert(data.result); }, error: f ...

Implement jquery styling to ajax response

Incorporating a jquery carousel to showcase images within a dynamically updated list has proven fruitful initially. However, once the content within the carousel container is replaced via ajax, all formatting seems to vanish. The root cause of this issue ...

If every single item in an array satisfies a specific condition

I am working with a structure that looks like this: { documentGroup: { Id: 000 Children: [ { Id: 000 Status: 1 }, { Id: 000 Status: 2 ...

Guide to choosing and unchoosing a div / button using angularJs

I am attempting to create a functionality where items are displayed in a div instead of a list. When an item is clicked, the background color of the div changes and the item is added to a column. Clicking on the item again will revert it back to its origin ...

The div is meant to be concealed, however, it remains visible

Having some difficulty with error messages while creating a login form. Trying to hide the 2nd div unless the form has been submitted and the password is valid. The following html code is not functioning as expected: <div class="form-input"> & ...

Tips for animating the box-shadow effect using jQuery

Can anyone provide insight on how to animate the box-shadow of multiple elements? I have reviewed previous threads such as this one, but found outdated and non-working solutions. Additionally, I came across the jquery box-animation plugin, which is limit ...

Are there any JS/jQuery plugins available for sliding animations that include slideLeft and slideRight functions, similar to the slideUp and slideDown functions?

Does anyone know of a jQuery/JS plugin that combines fading and sliding effects, specifically with slideLeft and slideRight functions similar to jQuery's slideUp and slideDown? I'm hoping to find something ready-made rather than having to build i ...