What steps should I take to eliminate the gap in my fixed bottom navbar?

I'm looking to revamp my menu layout by aligning the links with the social media icons and home button on the same line.

The links are nested inside a div within the main navbar class (streetworn-demos), while the social media icons and homepage button have their own floated divs. I attempted adjusting the width of the navbar class, expecting the links to fall into place, but it only altered their positioning.

How can I achieve having the links and social media icons inline and centered?

@import url(http://fonts.googleapis.com/css?family=Raleway:300,400,700);

*,
*:after,
*:before {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.clearfix:before,
.clearfix:after {
  content: '';
  display: table;
}

.clearfix:after {
  clear: both;
}

body {
  background: #333;
  color: #fff;
  font-size: 16px;
  font-family: 'Raleway', Arial, sans-serif;
}

a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  outline: none;
}


/* Link Colours */

.fade {
  background: #333;
}

.fade a {
  color: #fff;
}

a:hover,
a:focus {
  color: #333;
}

.social {
  float: left;

GET request from https://api.openai.com/v1/api/inputs:
Access-Control-Allow-Origin: *
Access-Control-Request-Headers: authorization,content-type
Connection: close
Content-Length: 119
Content-Type: application/json
Date: Fri, 19 Nov 2021 15:33:47 GMT
Server: CloudFront
Vary: Origin
X-Amz-Apigw-Id: D4GO7ELLIAMFS0A=
X-Amzn-Trace-Id: Root=1-619c6b28-3d95dbac11e68cafe81b5108;Sampled=0
X-Cache: Miss from cloudfront


#social {
  padding: 5px;
}
  
  /* Rest of the CSS code */
  
<div class="login">
  <a class="loginlink" href="#">Login / Signup</a>
</div>

<nav class="Streetworn-demos">
  <div class="navbar">
    <a class="brands" href="#">PALACE</a>
    <a class="brands" href="#">GOLFWANG</a>
    <a class="brands" href="#">SUPREME</a>
    <a class="brands" href="#">BILLIONAIRE'S BOYS CLUB</a>
    <a class="brands" href="#">STUSSY</a>
    <a class="brands" href="#">ANTISOCIAL SOCIAL CLUB</a>
  </div>
  <div class="homepage">
    <a class="home" href="index.html"><img id="home" alt="Return to the landing page" src="https://image.ibb.co/fnApE7/home2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/bwSEgn/homeicon.png'" onmouseout="this.src='https://image.ibb.co/fnApE7/home2.png'"></a>
  </div>
  <div class="social">
    <a href="http://www.facebook.com/"><img id="social" alt="Follow Streetworn on Facebook!" src="https://image.ibb.co/ftLBSS/fb2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/ktUS1n/fbicon.png'" onmouseout="this.src='https://image.ibb.co/ftLBSS/fb2.png'"></a>
    <a href="http://www.instagram.com/"><img id="social" alt="Follow Streetworn on Instagram!" src="https://image.ibb.co/fDPugn/ig2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/e5o9E7/igicon.png'" onmouseout="this.src='https://image.ibb.co/fDPugn/ig2.png'"></a>
    <a href="http://www.twitter.com/"><img id="social" alt="Follow Streetworn on Twitter!" src="https://image.ibb.co/cK5Zgn/twitter2.png" style="height: 36px; width: 36px" onmouseover="this.src='https://image.ibb.co/eGbJ7S/twi...
  </div>
</nav>

I would greatly appreciate any assistance!

Answer №1

If floats are used in the design, consider rearranging the order of the homepage and social divs to precede the navbar div. This will ensure that they float out of the way first, allowing the navbar to fill the space between them:

@import url(http://fonts.googleapis.com/css?family=Raleway:300,400,700);
*,
*:after,
*:before {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.clearfix:before,
.clearfix:after {
  content: '';
  display: table;
}

.clearfix:after {
  clear: both;
}

body {
  background: #333;
  color: #fff;
  font-size: 16px;
  font-family: 'Raleway', Arial, sans-serif;
}

a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  outline: none;
}


/* Link Colours */

.fade {
  background: #333;
}

.fade a {
  color: #fff;
}

a:hover,
a:focus {
  color: #333;
}

.social {
  float: left;
  clear: none;
}

#social {
  padding: 5px;
}
.
<!-- Rest of the CSS code is unchanged -->
    </div></answer1>
<exanswer1><div class="answer accepted" i="49908953" l="3.0" c="1524074509" a="ajA4Njkx" ai="616443">
<p>When utilizing floats, it's best to reorder the homepage and social divs before the navbar div so they can float out of the way first, allowing the navbar to occupy the space between them:</p>

<p><div>
<div>
<pre class="snippet-code-css lang-css"><code>@import url(http://fonts.googleapis.com/css?family=Raleway:300,400,700);
*,
*:after,
*:before {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.clearfix:before,
.clearfix:after {
  content: '';
  display: table;
}

.clearfix:after {
  clear: both;
}

/*Rest of the CSS code remains as is*/

Note: Ensure all IDs are unique

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

Hide jquery scroll bar

I am currently working on a WordPress plugin with the Twenty Thirteen theme. My goal is to display a modal when a div is clicked, and at that time I want to hide the scrollbar on the body of the page. Despite trying the following code snippet, it doesn&ap ...

Vanilla JS method for resetting Bootstrap 5 client-side validation when focused

I'm currently exploring Bootstrap 5's client-side validation feature. However, I've encountered a usability issue with the is-invalid class. After clicking the submit button, this class persists until the correct input is entered. I would li ...

Issues with the OnChange function not properly functioning in duplicate input fields

I've designed a form that allows for adding or deleting rows, effectively cloning input fields. One of the input fields utilizes Jquery Ajax to retrieve its value. However, upon adding an extra row by cloning the parent row to generate a child row, th ...

Issue with display of Favicon in Google Chrome browser

My favicon is not appearing on my Chrome tab, even though I've checked multiple articles and confirmed that the code is correct. It does show up in Firefox, so I'm confused as to why it's not working in Chrome. I've cleared my cache and ...

An issue occurred when retrieving the input value during a (change) event within a nested *ngFor loop in Angular

Within my table, I have implemented a nested loop using the *ngFor directive: <tbody> <tr *ngFor="let dept of salesTarget; let i = index"> <td>{{dept.dept}}</td> <td *ngFor="let month of monthList; ...

Creating consistent image sizes in Bootstrap

I'm currently using Bootstrap 4 to showcase multiple images on my website. I have attempted to apply the Grid system as per Bootstrap's guidelines, but the display of the images is not aesthetically pleasing due to their uneven sizes, which can b ...

CSS from the parent page is not being applied to AJAX-injected content

I recently added AJAX functionality to a new website to dynamically load and insert Wordpress page content using AJAX. However, I encountered an issue where some CSS styles that were supposed to be loaded in the page head were not being applied. This resu ...

How to send variables to a function when a value changes in TypeScript and Angular

As someone who is new to Angular and HTML, I am seeking assistance with the following code snippet: <mat-form-field> <mat-select (valueChange)="changeStatus(list.name, card.name)"> <mat-option *ngFor="let i of lists"> {{i.name}} ...

Assign a CSS class to a DIV depending on the vertical position of the cursor

The website I am currently developing is located at Within the site, there is a collection of project titles. When hovering over a project title, the featured image is displayed directly below it. I would like to change the positioning of these images to ...

Navigate to the editing page with Thymeleaf in the spring framework, where the model attribute is passed

My goal is to redirect the request to the edit page if the server response status is failed. The updated code below provides more clarity with changed variable names and IDs for security reasons. Controller: @Controller @RequestMapping("abc") public clas ...

Creating an HTML template in an Angular service and utilizing it as an HTMLTemplateRef

I'm currently working on a major project that has a specific requirement. As part of this project, I am utilizing a library which allows me to open dialog (modal) popups. In order to do so, I need to configure some options for the modal opening proce ...

Looking for a logo placed in the center with a top fixed navigation using Bootstrap

I am in need of a Centered Logo using Bootstrap fixed top navigation. The goal is to have the brand centered within the navigation. Check out my Sample Fiddle .LandPageNavLinks { list-style-type:none; margin:0; padding:0; } .LandPageNavLin ...

Is there a way for me to extract and showcase the initial 10 items bearing a particular class name from a different html document on my homepage?

I am looking to extract a list of movies from an HTML file titled "movies.html". The structure of the file is as follows: <div class="movie">Content 1</div> <div class="movie">Content 2</div> <div class=" ...

Updating the Position of an Element in ElectronJS (e.g. Button, Label, etc)

Is there a way to change the positioning of a button in a window using JavaScript and Electron? I am trying to create new input boxes next to existing ones, but they always appear below the last one created. Is it possible to specify x and y coordinates fo ...

The horizontal display of JqueryMobile radiobuttons is not appearing correctly

My aim is to dynamically generate a set of radio buttons using JQueryMobile. Everything seems to be working fine except for the data-type='horizontal' attribute: On looking at this fiddle, you'll notice that the "created-via-js" radio group ...

Accelerate blinking timer by utilizing CSS3 animations

I'm currently developing a quiz application that includes a timer counting down from 10 seconds to 0 seconds. As the timer reaches closer to 0 seconds, I am looking to implement a feature where my text blinks faster and faster. Additionally, I would l ...

Mastering the Material-UI Grid in SPAs: Conquering the Negative Margin Dilemma

While attempting to build a single page application (SPA), I've encountered an issue with using the Grid component from material-ui. Normally, I rely heavily on the Grid, but in this new project, something seems amiss. The current problem is evident ...

What orientation is best for the back arrow to take in a website written in Arabic?

Currently developing a website that supports Arabic language while considering security measures. The browser's back button will terminate the session, requiring users to utilize the on-page back button instead. When incorporating Arabic text, should ...

The :after pseudo-element in action with multi-line text

Can the styling of the :after pseudo-element be applied to every line of multi-line text? Here is the code I am currently using: .container { width: 50px; } .text { position: relative; } .text:after { content: ''; position: ...

A new ASP.NET MVC-5 web application is missing the class definition for "input-validation-error."

I recently created a new ASP.NET MVC-5 web application using Visual Studio 2013. When I attempted to use the built-in login form and left the required fields empty, I noticed that the fields were not highlighted in red as expected. After inspecting the ge ...