Problem regarding the CSS attribute float

I have included the following codes in my project: http://jsfiddle.net/VaKSG/

.brs_top_bar{
    width: 900px;
    height: 40px;
    background: rgb(27, 124, 124);
    border-bottom: 1px solid rgb(20, 92, 92);
    color: white;
}
.brs_top_search{
    width: 201px;
    height: 40px;
    background: rgb(22, 105, 105);
    display: inline-block;
}
.brs_top_show_hide{
    height: 40px;
    width: 10px;
    background: rgb(78, 218, 218);
    display: inline-block;
}
.brs_top_pages_info{
    color: white;
    font-weight: bold;
    display: inline-block;
    line-height: 30px;
    vertical-align: top;
}
.brs_top_pages_but{
    text-decoration: none;
    color: white;
    font-weight: bold;
    line-height: 28px;
    text-align: center;
    height: 28px;
    width: 28px;
    background: rgb(35, 156, 156);
    border: 1px solid rgb(31, 139, 139);
    display: inline-block;
 }
 .brs_top_pages{
    margin: 5px;
    height: 30px;
    display: inline-block;
    vertical-align: top;
 }
.floating{
    float: right;
    position: relative;
 }

<div class="brs_top_bar">
    <div class="brs_top_search"></div>
    <div class="brs_top_show_hide"></div>
    <div class="brs_top_pages floating">
        <div class="brs_top_pages_info">1 - 10 of 300</div>
        <a href="" title="" class="brs_top_pages_but"><</a><a href="" class="brs_top_pages_but" title="">></a>
    </div>
</div>

While it works fine in the provided link, I am facing an issue with the floated element overlapping other elements in my local environment as shown in the attached image:

Despite trying various solutions, I have been unable to resolve this issue. I am using Google Chrome for testing.

Answer №1

To implement the desired CSS layout, you can utilize the following code snippet. Simply include float:left within both class definitions.

.brs_top_search{
    width: 201px;
    height: 40px;
    background: rgb(22, 105, 105);
    display: inline-block;
    float: left;
}
.brs_top_show_hide{
    height: 40px;
    width: 10px;
    background: rgb(78, 218, 218);
    display: inline-block;
    float: left;
}

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

What is the best way to format a string to display the second value in the string?

I have successfully combined the currency and value columns into one column displaying USD 20000. Now I am looking to format the value string to appear as USD 20,000. However, I am unsure of how to incorporate property.DisplayFormatString into the second s ...

What sets apart :first-child from :first-of-type?

I need help understanding the distinction between element:first-child and element:first-of-type Let's consider a scenario where you have a div element div:first-child → Refers to all <div> elements that are the first child of their parent. ...

PHP persistent forms dropdowns and checkbox selection

I am currently working on a PHP form and I am facing an issue with the drop-down boxes and checkboxes. I want them to stay filled even if I don't select something, maintaining the previously entered details while leaving the unfilled parts empty. I ha ...

How can I conceal the upload button and still display the names of the files?

I created a user-friendly drag and drop zone for uploading multiple files. Users can simply drag their files into the designated drop area and see the file names displayed there. However, I encountered an issue where hiding the standard "Choose file" butto ...

My navbar used to be perfectly centered, but now it seems to have shifted off to the

My Bootstrap 4 navbar used to look great, but now it seems like I've messed it up somehow without even realizing it... Previously, all the links were evenly spaced across the page, but now they're all aligned to the left. Can anyone spot what I ...

I am experiencing an issue where the CSS file in the wwwroot directory does not update when I make changes to the code in ASP.NET MVC

Here is a link to my CSS file: Click here for image description This is how the file looks when built (no changes): Click here for image description Occasionally, running "clean-solution" and "build-solution" fixes the issue, but it's not working no ...

What is the best way to generate HTML tags dynamically for all language and region variations on a webpage's header?

I am interested in incorporating <link rel="alternate" hreflang="lang_code"... > elements into the headers of my pages to indicate all language and region variations of a page. For instance, here is an example for the homepage he ...

The data-toggle function is not functioning properly with the code provided

Could someone shed some light on why my tabs and navigation bar dropdown button are not functioning properly? <div class="col-12"> <h2>Corporate Leadership</h2> <ul class = "nav nav-tabs&q ...

Retrieve the id of an element and a standard element using JavaScript

I have a CSS selector #menu li {background-color: red;}. I'm trying to retrieve its properties using JavaScript. It's crucial for me to access both the #menu and li elements separately as they have distinct attributes. Unfortunately, methods lik ...

Detecting the scroll events of elements with the overflow:hidden property

Looking to synchronize scrolling between two different panels or divs? In one element, there's an overflow: auto while the other has overflow: hidden (trying to mimic a grid with frozen columns). I've managed to sync the scroll when it occurs w ...

Issue: Unable to locate a change supporting element '[object Object]' of the type 'object - Angular 7'

An angular service has been created for the specified purpose: CheckTicket(barcode, codEspec, diaHoraEspec):Observable<Ticket[]>{ //read ticket return this.http.get<Ticket[]>(`${this.checkticket_url}${barcode}?token=${this.token}&a ...

React's useState function does not update the FileReader

I've been working on extracting values from an XML file using the code below. However, I'm encountering an issue where the console always outputs 'undefined'. Can anyone help me identify where I might be going wrong? This is my JavaSc ...

Arrange the divs in numerical order based on the number of downloads

I wrote a basic code to organize parent divs based on their titles. However, when I attempted to do the same for download counts, nothing happened - no errors or actions from the code. There are two functions in total, both of which are triggered by butto ...

I am looking to use AngularJS to refresh a div tag when an image is clicked

I need help refreshing the pie chart div when I click on the image using AngularJS div with the image: <div class="col-md-3 col-sm-12 col-xs-12"> <div class="panel panel-primary text-center no-boder blue"> ...

Is there a way to configure my sidebar to display on the left side of the content instead of appearing stacked on top of it?

How can I make the sidebar appear on the left side of the content without stacking on top of each other? Here is the HTML I am currently using for styling: <div class="bg-gray-600 flex flex-col max-h-min"> <div> <app-c ...

Encountering a problem while verifying pattern using regular expressions

I'm facing an issue when manually checking if my inputs match the specified patterns. Below is the function I am using for this check: if (!$element.attr("pattern")) return true; let pattern = $element.attr("pattern"); le ...

What is the best way to create a clickable anchor tag that is nested within a paragraph tag?

Here is the string I am working with: String txtLink = "<p>Apply directly in our <a href=\"https://theorem.applytojob.com/apply/TyJy6YCsOs/Experienced- Backend-Engineer-Ruby?source=GitHub+Jobs\">careers page</a></p>"; ...

How to update data in FullCalendar using Bootstrap modal

While using a FullCalendar within a modal, I encountered an issue where the information for a user would not refresh when opening another modal. Despite trying various solutions from Stackoverflow, none seemed to work. The only time it did function properl ...

What is the best way to customize the link style for individual data links within a Highcharts network graph?

I am currently working on creating a Network Graph that visualizes relationships between devices and individuals in an Internet of Things environment. The data for the graph is extracted from a database, including information about the sender and receiver ...

Is there a way to ensure that my background color extends across the entire webpage background?

I'm curious about how to make sure that the background color of sections 1 and 2 fills the entire webpage, similar to this example. Currently, the background color only covers half of the webpage, but I want it to extend across the entire background o ...