"Alignment problems causing display issues that are not aligning as they

How come my write and check status buttons won't align horizontally with the two divs?

I am trying to position the button with id "writeMe" directly to the right of the div with id "test", and then I want the button "statusCheck" to be positioned directly to the right of the div with id "status1". However, even with the CSS property display:inline, it still remains below the div.

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />

<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="cordova-2.7.0.js"></script>
<script type="text/javascript" src="js/bluetoothSerial.js"></script>
<script type="text/javascript" src="ECMA.js"></script>

<title> My LCD code </title>
</head>
<body onload="app.initialize();">

<p>Welcome to the LCD software</p>

    <select id="list" onchange="app.prints(address,list.options[list.selectedIndex].value);">
    </select>
    <button id="connect" onclick="app.connect();">
        Connect
    </button>

<div id="address">
    macAddress
</div>

<div id="status1">
    Not Connected
</div>
<button id="statusCheck"> Click to check status </button>

<div id="test">
    No Message Received
</div>

<button id="writeMe" onclick="app.bluetoothWrite();">
 Write
</button>

CSS

body {
    background-color: white;
}

select {
    width:200px;
    margin:30px;
    margin-left:0px;
}

#connect {
    display: inline;
    margin-left: 0px;
    width: 200px;
}

#status1 {
    border: 2px solid black;
    width: 200px;
    height: 20px;
    margin: 30px;
    margin-top: 0px;
    margin-left: 0px;
}

#address {
    display: inline;
    width: 200px;
    height: 20px;
    bordrr: 2px solid black;
}

#statusCheck {
    display: inline;
    width: 200px;
    margin: 30px;
    margin-bottom: 0px;
}

#test {
    width: 200px;
    height: 20px;
    border: 2px solid black;
}

#writeMe {
    width: 200px;
    display: inline;
}

Answer №1

Check out this HTML code snippet

<p>Welcome to our software demo</p>

    <select id="list" onchange= "app.prints(address,list.
    options[list.selectedIndex].value);">
    </select>
    <button id="connect" onclick="app.connect();">
        Click here to connect
    </button>
<div id="address">
    Unique MAC Address Here
</div>

<div>
<span id="status1">
    Connection Status: Not Connected
</span>
 <button id="statusCheck"> Check connection status </button>
</div> 

<div>
<span id="test" >
    No Message Received Yet
</span>  
<button id="writeMe" onclick="app.bluetoothWrite();">
 Begin Writing
</button>
</div>

Fiddle with the code

http://jsfiddle.net/PFVxK/1323/

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

Exploring user inputs and displaying variables using JavaScript and HTML 4.01

I was testing some code and I'm facing an issue that I can't figure out: <HTML> <head> <title> Page 1 </title> <script> function myFunction() { var x=document.getElementById("myEmail") document.write(x) } </scr ...

How can nunjucks templates be accessed from NPM (node modules)?

Is there a solution to make nunjucks imports/includes resolve from the NPM node_modules directory? Let's say we have installed a package as follows: npm i -S @example/cards Now, we need to import from it in a template like this: {% import "@exampl ...

Exploring the POST method functionality in AJAX

I am having trouble creating a function that uses AJAX. When I try to send information using the POST method, the function does not work, but it works fine with the GET method. Here is the function: function ajaxFunction(page,metho ...

Unable to extract the chatbox response with Selenium no matter how many methods are attempted

If the details I've supplied are insufficient, please request more information. I'm attempting to automate a dialogue with a chatbot and save the responses. Nevertheless, Selenium consistently struggles to locate and retrieve the response accura ...

Retrieve information from a webpage with webharvest

I'm attempting to scrape all the HTML pages from the website "http://www.tecomdirectory.com/" using webharvest. However, the script isn't successfully fetching all the HTML pages and is only able to scrape a few of them. Below is the script that ...

Align the label vertically with the corresponding input field

I am currently in the process of revamping an old HTML form to eliminate the use of tables. I found a solution on this site to give the label a fixed width, and here is how it looks in the current code: HTML <div id="form"> <label for="field ...

Issues with XFBML Like Buttons failing to load when generating numerous posts dynamically on a single page

On my webpage containing multiple posts, I am attempting to insert a Facebook LIKE button for each post. Utilizing XFBML code, I am trying to populate like buttons under every individual post with a unique URL, corresponding to the post URL. Here is the c ...

Adjust the canvas size to fit its parent element ion-grid

I am currently working on an Ionic 3 component that displays a grid of images connected by a canvas overlay. I have utilized Ionic's ion-grid, but I am facing an issue with resizing the canvas. The problem is that I cannot determine the correct dimens ...

HTML Selection Tool

Are there any HTML element selector libraries similar to jQuery in the world of Dot Net? I am working on an application that requires a lot of HTML parsing. For example, I need to extract all 'href's and 'src's only from selected &apos ...

Is there a light font that cannot be replicated?

I attempted to replicate the font style used in this website's menu, but after implementing it into my WordPress CSS theme, the text still appears bold. Is there a particular technique I can use to achieve the lighter version of the font? I have loade ...

Creating personalized images using HTML

Looking to create a website where you can purchase personalized shoes? One unique feature is the ability to customize your pair of shoes by selecting stickers and choosing their color. These options are conveniently displayed in a panel next to the shoe im ...

Converting a key-value pair string into an array in PHP: A comprehensive guide

When the checkbox is selected, I will extract the values listed below: attribute_value:samsung, attribute_id:1, spec_group_id:2, prod_id:1 To convert the above string into an array format and obtain a single array outside of the loop. Therefore, if I wa ...

When an li element is styled with a width of 50% and floated to the left, it does not display the bullet points

When attempting to create a 2-column list, I implemented the following CSS: ul { overflow: hidden; } ul li { float: left; width: 50%; } However, I noticed that when I have 2 items in the list, the one on the right displays a list bullet while th ...

Instructions on creating a "ripple" effect on a webpage using CSS

I am attempting to create a wavy border effect where two sections meet on a page (refer to the image below). What is the most effective way to achieve this? The waves should be uniform in size. EDIT: To whoever flagged this as 'already answered' ...

What is the best way to showcase validation errors based on required fields in PHP?

When dealing with a form, the challenge arises when there are multiple validation errors to display. The dilemma is whether to show all errors at once or individually as per each field requirement. For instance, consider having fields like Name, Email, an ...

How about adding various colors in the background with layers?

I was recently given a task by a client to convert their picture art into CSS code. While I have successfully completed most of the task, I am facing difficulty in coloring the div similar to the example provided by the client. Here is the client's ve ...

Achieving CSS Buttons That Change to Green When Clicked and STAY Green

I've been tasked with working on a front-end project for a website that involves buttons changing color when clicked and staying that color. Here is the CSS <style> code I have written for these specific buttons: .button { background-color ...

Mastering the Art of Crafting an Effortless Slide Showcase

I have created a carousel that works fine except for one issue: when I reach the last image or go back from the first image, I want the image to be displayed. For example, when you click the right arrow after reaching the last image, it should show the fir ...

Unraveling a Java String with HTML elements into a JsonObject: Step-by-step Guide

Hey there, I have a Java String that was received from an HTTP request and it looks like this: {SubRefNumber:"3243 ",QBType:"-----",Question:"<p><img title="format.jpg" src="data:image/jpeg;base64,/9j/4AAQSkZJRgAB..."></img></p>"} ...

Having issues with my toggler functionality. I attempted to place the JavaScript CDN both at the top and bottom of the code, but unfortunately, it is still not

I recently attempted to place the JavaScript CDN at the top of my code, but unfortunately, it did not have the desired effect. My intention was to make the navigation bar on my website responsive and I utilized a toggler in the process. While the navbar di ...