placing circular button beside pick component

I have created a code that retrieves json from a backend api and fills a select component in vue. I'm looking to include a reload button beside the select component,

 <!DOCTYPE html>
 <html lang="en">
 <title>Test page app</title>
 <meta charset="utf-8">
   <style>

   .round-button {
       width:3%; // controls the size of button
   }
   .round-button-circle {
      width: 100%;
      height:0;
      padding-bottom: 100%;
      border-radius: 50%;
      line-height:50px;
      border:1px solid #cfdcec;
      overflow:hidden;
      background: #4679BD;
      box-shadow: 0 0 5px gray;
   }
   .round-button-circle:hover {
      background:#30588e;
   }

   .round-button img {
      display: block;
      width: 90%; // control image size
      padding: 24%; // control image alignment
      padding-right: 50%;
      height: auto;
   }

   </style>

   <script src="static/vendor/vue.js"></script>
   <script src="static/vendor/axios.min.js"></script>
</head>
<body>
<div id="select">
   <form>
<select v-model="selected" v-on:change.once="executeLoader('tests', $event)"># v-bind:disabled="isRunning">
<option disabled selected>Please Select One</option>
   <option></option>
<option v-for="n in projects" :value="n">
{{n.id}} : {{ n.name }}
</option>
</select>
      <div class="round-button">
         <div class="round-button-circle">
      <a href="#" class="round-button">
<img src="images/leftarrow.png" alt="Reload" title="Reload" />
</a></div>
         </div>
<h3>Selected: {{ selected.name }} </h3>
      </form>

</div>

<script>
new Vue({
   el: "#select",
   data: {
      projects: [],
      selected: "Please Select One",
      isRunning: false
   },
   methods : {
      executeLoader: function(t, event){

      alert('Query "'+ this.selected.name +
         '" Dropdown: "' + t + '"');

         if (!this.selected){
            console.log("did not submitted");
         } else {
            this.isRunning = true;
            }
         }
      },
   mounted() {
   axios.get("projects.json")
   //axios.get("http://127.0.0.1:5050/api/images?filter=placeholder")
   .then(response => {
         this.projects = response.data.projects
      })
   }
});
</script>
    </body>
</html>

However, the image button I've inserted is being displayed on the next line instead of appearing alongside the div.

Answer №1

Consider implementing the following in your stylesheet:

.round-button {
  display: inline-block;
}

Updated snippet:

.round-button {
  display: inline-flex;
  vertical-align: middle;
}

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

Unable to find the designated ./uploads directory while attempting to upload a file in Express JS

I'm currently working on a project with the following structure: -app -uploads -client - dropzone.js -server.js My goal is to upload a file using dropzone js, Express JS, and React JS. However, whenever I try to drop a file in ...

Tips for showcasing elements individually in JavaScript when a button is clicked and halting on a random element

I have some names stored in h3 tags. I want to highlight one name at a time when I click a button, stopping at a random name. <div class="all-names"> <h3 class="name-one"><span class="line">Name ...

What is the reason behind TypeScript's lack of support for exporting with decorators?

The issue regarding this problem was addressed on https://github.com/tc39/proposal-decorators/issues/69. Despite this discussion, TypeScript does not currently support it. The following code demonstrates the lack of support: export @deco() class a {}; H ...

The console is displaying the array, but it is not being rendered in HTML format in AngularJS

Can you please review my App.js file and let me know if there are any mistakes? I have provided the necessary files index.html and founditemtemplate.html below. Although it is returning an array of objects in the console, it is not displaying them as inten ...

Invoking PHP function within a specific class using Ajax

I am currently utilizing Zend Framework. My PHP class is structured as follows: FileName : AdminController.php Path : /admin/AdminController.php Ajax Function : function exportToExcel() { $.ajax({ url: "/admin/AdminController/testFunction", ty ...

Challenges encountered when attempting to download a file using jQuery's GET method

I am working with an API Server that responds to requests in the following format: http://localhost:8080/slim3/public/api/v1/files/Test1.jpg http://localhost:8080/slim3/public/api/v1/files/Test2.txt ... When I enter such a URL into my browser, I receive ...

Encountering errors while running Angular 8's ng build prod command

After successfully migrating my project from Angular 7 to Angular 8, I encountered an issue when attempting to run 'ng build prod' which resulted in the following error: ERROR in Error during template compile of 'Ng2CompleterModule' Cou ...

When evaluating code with eval, properties of undefined cannot be set, but the process works seamlessly without

Currently, I am attempting to utilize the eval() function to dynamically update a variable that must be accessed by path in the format myArray[0][0[1][0].... Strangely enough, when I try this approach, I encounter the following error: Uncaught TypeError: ...

Obtaining data upon clicking a button within a Bootstrap modal

Implementing Google Map API to calculate the distance between departure and destination locations has been successful so far. However, I am encountering an issue with displaying the distance value in a Bootstrap modal after clicking on the Get the Distance ...

Changing Vue-router routes dynamically

Is it possible to dynamically update routes in Vue-router without the need for a page reload? I am currently loading different route paths depending on the selected language, like this: { path: '/' + i18n.t('url_welcome'), name: &apos ...

I am looking to retrieve a particular entry from a JSON data array and make some modifications to it

Initially, I fetched JSON data from the web server using the following code: $.getJSON(url,function(){ //my callback function; }); Now, I have received the data in the format shown below: {entries:[{title:'foo',id:'UUID',finished:nul ...

Guide on generating a PDF on the client side and opening it in a new browser tab using AngularJS

In need of assistance with creating a PDF file on the client side using AngularJS and downloading it in a new tab on the browser. Any suggestions on how to achieve this task? ...

Adjusting the size of the Toggle Switch component in Material UI

As a beginner in both Material UI and React, I'm having trouble adjusting the size of the toggle switch I'm implementing. Here's a simplified version of my code: import React, { Component } from "react"; import Switch from "@material-ui/co ...

All components in my app are being styled by CSS files

Currently, I am facing an issue with my React app in VS Code. My goal is to assign a distinct background color to each component. However, the problem arises when unwanted CSS styles from other files start affecting components even though they are not impo ...

The marriage of Vue 2.0 and Rails 5: Shifting from Reactive to Declarative Rendering

As I make my way through the Vue guide with a Rails 5 app, I've noticed that although I am able to update my Vue js object, the DOM doesn't behave as described in the Declarative Rendering section. The data and the DOM are supposed to be linke ...

Struggling with implementing checkboxes within an HTML div using JavaScript

Being a newcomer to programming, I am facing some challenges with HTML/JS. My goal is to create a dynamic checkbox list for adding tasks to complete. Despite researching on at least 10 websites, I haven't been able to make it work. I have thoroughly c ...

Error Encountered: Internet Explorer 11 Runtime Issue

Recently, I encountered an issue with my code that had been working perfectly fine in IE7 and IE8, but started giving me a runtime error in IE11. The error message stated: "JavaScript runtime error: 'SelectAllCheckboxes' is undefined" Below is t ...

Is there a reason why the Chrome browser doesn't trigger a popstate event when using the back

JavaScript: $(document).ready(function() { window.history.replaceState({some JSON}, "tittle", aHref); $(window).bind("popstate", function(){ alert("hello~"); }); }); Upon the initial loading of the www.example.com page, the above JavaScript code is ex ...

Prevent zoom function on CapacitorJS application using Android Webview

I have developed a TV WebApp using Vue, optimized for FullHD resolution 1920x1080. Now I am looking to transition it to Android TV. The app works and looks fine on browsers and TizenTV: https://i.stack.imgur.com/njPaX.png When viewed in the AndroidTV sim ...

What is the best way to arrange card-columns in a horizontal order?

My smart-scrolling list of cards uses the card-columns style, but I find it frustrating that they are ordered top to bottom like this: 1 4 7 2 5 8 3 6 9 This vertical ordering becomes impractical when dealing with a large number of items. When I have 50 ...