Why does my code appear unique in Safari?

My code is displaying strangely in different browsers. In Chrome, it looks correct like this:

https://i.sstatic.net/PpKW7.png

However, when I run it in Safari, the settings button shifts position.

https://i.sstatic.net/Dxkzj.png

I suspect there may be a missing prefix causing this issue and would appreciate any guidance on that :)

Below is the snippet of my code:

/* NOT ACTUALLY NEEDED */
body {
  background-color: rgb(10, 10, 10);
  font-family: Lato;
}

/* ACTUAL STYLES */
:root {
  --border-radius: 5px;
  --text-color: rgb(207, 207, 207);
  --background-color: rgb(97, 97, 97);
  --background-hover-color: rgb(131, 131, 131);
  --font-size: 10pt;
}


#sectionTitle {
  background-color: rgb(78, 78, 78);
  border-top-left-radius: var(--border-radius);  
  border-top-right-radius: var(--border-radius);
  display: flex;
  height: auto;
  justify-content: space-between;
  padding: 10px 5px;
  position: relative;
}
#sectionTitle > div {
  display: inline-block;
  font-size: 11pt;
}

#timeSpan {
  color: var(--text-color);
  height: 30px;
  line-height: 30px;
  vertical-align: middle;
}

#controls {
  text-align: right;
  width: auto;
  margin-right: 10px;
}

#controls > div {
  display: inline-block;
}

#sectionBody {
  background-color: rgb(78, 78, 78);
  border-bottom-left-radius:  var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  height: 200px;
}


.wrapperOrContainer {
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  height: 30px;
  overflow: hidden;
}

.control_buttonOrInput {
  background-color: transparent;
  border: none;
  color: var(--text-color);
  font-size: 10pt;
  height: 100%;
  margin: 0;
  outline: none;
  padding: 0 10px;
  text-align: center;
  transition: background-color .3s;
}
.control_buttonOrInput:hover {
  background-color: var(--background-hover-color);
}

#dateSelect_container > input { 
  width: 70px;
  padding: 0 3px;
}

#settings_button_wrapper { width: 30px; }
#settings_button_wrapper > button {
  height: 100%;
  position: relative;
  width: 100%;
}
#settings_button_wrapper > button > img {
  bottom: 0;
  height: 20px;
  left: 0;
  margin: auto;
  position: absolute;
  right: 0;
  top: 0;
}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8>
    <title>Document</title>
    <link rel="stylesheet" href="./index.css">
    <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
  </head>
  <body>
    <div id="section">
      <div id="sectionTitle">
        <div id="timeSpan">KW 3 - Jan 2019</div>
        <div id="controls">
          <div id="timeSpanSelect_wrapper" class="wrapperOrContainer">
            <button class="control_buttonOrInput">Woche</button>
          </div>
          <div id="today_button_wrapper" class="wrapperOrContainer">>
            <button class="control_buttonOrInput">Heute</button>
          </div>
          <div id="dateSelect_container" class="wrapperOrContainer">
            <button class="control_buttonOrInput">◀</button><!--
            --><input type="text" value="21.01.2019" class="control_buttonOrInput"><!--
            --><button class="control_buttonOrInput">▶</button>
          </div>
          <div id="settings_button_wrapper" class="wrapperOrContainer">
            <button class="control_buttonOrInput"><img src="./settings.png" alt=""></button>
          </div>
        </div>
      </div>
      <div id="sectionBody"></div>
    </div>
  </body>
</html>

Answer №1

By setting the display property of the divs within the controls div to inline-block, you have the ability to utilize the vertical-align attribute for positioning them specifically in Safari.

#controls > div {
    display: inline-block;
    vertical-align: top;
}

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

Tips for incorporating basic code into an android app

I find myself puzzled about the placement of regular Java code in an Android application. Using the Eclipse SDK, when you create an application, it automatically generates a .java file with an OnCreate() method. Should I insert my code within this method? ...

Developed a basic HTML form using PHP, however encountering issue where email is not being posted and instead opening a blank page

After creating HTML and PHP documents, I encountered an issue where upon submitting the form, I ended up with a blank page and didn't receive the expected email containing the form information. As someone relatively new to this, I would greatly apprec ...

Guide to expanding the sidebar width

As I delve into the world of CSS, I find myself puzzled by the issue of expanding the sidebar to ensure that the "Gestion des utilisateurs" section appears on a single line. https://i.stack.imgur.com/xzFEA.png To provide context, I have included an illus ...

Styling div elements within other div elements using CSS

I am currently working on creating a layout with three divs, each containing an image. The challenge is to set the height of the first div (top) to 10% of the screen size, the second (middle) to 60%, and the third (bottom) to 30%. I want these divs to main ...

Looking for an HTML tag in BeautifulSoup that contains exactly one attribute

I am working on a website in HTML and need to extract specific data from it. The HTML structure is as follows: <p class="provice hidden-xs"> <span class="provice-mobile">NEW YORK</span> witespace <span class="provice-mobile" style="co ...

Ways to customize the font style, size, and height of Mui TextField

I am struggling to modify the font family of the label within the Mui component TextField. It seems that the sx property does not properly change the font family, although it works for adjusting the width. I also attempted to use the rows property for he ...

Once the "Get Route" button is pressed, I want to save my JavaScript variable into a database

I am seeking to automatically extract data from the Google Maps API and store it in my MySQL database. Specifically, I want details such as source address, destination address, distance, and duration for all available routes to be inserted into my database ...

Styling the body element in Material UI: A guide to customizing the

I'm having trouble figuring out how to target the root elements using the ThemeProvider in Material UI. const theme = createMuiTheme({ palette: { background: { default: "#00000", backgroundColor : 'black', b ...

Creating a custom breakpoint in Bootstrap for adding unique CSS styles

Consider this scenario <div class="col-md-my"> </div> .xx { color: black; } .yy { color: red; } Similar to how Bootstrap adjusts width at different breakpoints. Create a new class called col-md-my When the width exceeds the ...

Is there a way to switch my image buttons to a different image when clicked?

In order to create interactive buttons for a website, I designed four unique .PNG images using Photoshop. Two of these images are intended to serve as default buttons, while the other two are meant to be used as "post-click" buttons. For the default butto ...

Effortlessly glide to a specific div ID upon page load using the URL address

One way to implement smooth scrolling to an anchor on page load is by using jQuery. Here's an example code snippet: $(function(){ $('html, body').animate({ scrollTop: $( $('#anchor1').attr('href') ).offset(). ...

Eliminate billing information from the Woocommerce order management page on the backend

Is there a way to modify the text "Paid on" in the backend order details page of WooCommerce? I have already implemented this for BACS and local pickup payment methods. Replace a specific word for BACS payment method in Woocommerce order edit pages I am ...

Tips for automatically displaying the scroll bar continuously on iOS 15 without requiring user interaction

We have a Web Application that displays a scroll bar for users to navigate through the content. The scroll bar functions correctly on desktop browsers and Android browsers, but not on Apple devices running iOS 15 (Safari Browser). Current Behavior : In ...

Perform an SQL function to select and update data

I need to run this code, but I'm missing one key variable that I can't seem to locate. Here's my current code snippet: SELECT CODE = 'P1R2G1' and CATEGORY = '20M' IF RANK op1 = '1' THEN UPDATE tourneyeventga ...

Creating movement in three distinct divisions

I am seeking a way to have three divs flying in upon click. The first DIV is positioned at the top, followed by one on the left and one on the right (both being below the top one). I wish for them to fly in from their respective directions - the top div fr ...

Using the HTML <span> and svg elements together does not allow them to be inline with each other

In my current scenario, I have a fieldset that is inline with another one on the page. The specific fieldset in question contains an SVG circle and some text. My objective is to have both elements inline with each other, while allowing the fieldset to adj ...

Customize the default dropdown (select) style for mobile devices

Is there a way to customize the default appearance of a select element on mobile devices? I noticed that the styling differs when viewing it on Chrome compared to how it appears on my Galaxy S6. How can I override this discrepancy? Browser view: https:// ...

How can I use Laravel to showcase a CSS class named 'products' in a 3x3 grid layout, along with fetching product data from the database?

Currently, I am utilizing Laravel to showcase information regarding products being sold on the homepage. Each product includes a small image and various attributes. However, as of now, each product is displayed in a single row format, making it challengi ...

Problem encountered when a relative path in an HTML file within a subdirectory attempts to access libraries located in separate directories

I'm currently facing an issue with defining the path for libraries and models used in an HTML file that employs WebGL. The specific HTML file can be accessed here, serving as a sample code snippet from a WebGL2 book. Locally, on my computer, the HTML ...

Interactive Canvas Feature: Drag and Drop Across Various Objects in HTML 5

I have developed a custom code that enables the creation and rendering of objects on an HTML5 canvas. class Rectangle extends Shape { constructor(options, canvas, type = 'rectangle') { super(...); // inherited from the super class thi ...