using inline js, add two buttons with big text, the buttons have to be centered and the…
- User
using inline js, add two buttons with big text, the buttons have to be centered and the same size determined by css:
<label for="fullName">Nimi *</label> <input placeholder="Jaak Tamm" type="text" id="fullName" name="fullName" required> <label for="cardNumber">Kaardi info</label> <input placeholder="Kaardi Number" type="text" id="cardNumber" name="cardNumber" required> <div class="card-details-grid"> <div class="grid-item"> <input placeholder="CVC" type="text" id="cvc" name="cvc" maxlength="3" required> </div> <div class="grid-item"> <input placeholder="KK/AA" type="month" id="expiryDate" name="expiryDate" required> </div> </div> <label for="billingAddress">Arveaadress *</label> <input placeholder="Tänav xx, xxxxx Linn" id="billingAddress" name="billingAddress" required></textarea> <button type="submit" id="payButton">Anneta</button> <div class="icons-wrapper"> <img src="mastercard.svg" alt="Mastercard"> <img src="visa.svg" alt="Visa"> </div> </form> </div> <div> <a href="tutvu.html"></a> </div> </div> <script src="script.js"></script>body { font-family: Arial, sans-serif; margin: 0; height: 100%; background-image: url('bg.png'); background-size: cover; background-position: center; background-attachment: fixed; overflow: hidden; }
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-image: inherit; background-size: cover; background-position: center; filter: blur(10px); z-index: -1; }
.payment-container { max-width: 400px; margin: 0 auto; padding: 20px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); background: #ffffff; }
.logo { display: block; margin: 0 auto; width: 100px; height: auto; }
.title { text-align: center; margin-bottom: 5px; }
.description { color: #444444; text-align: center; margin-bottom: 20px; }
form label { display: block; margin-top: 10px; }
form input[type="text"], form input[type="date"], form input[type="month"], form input[type="number"], form input { width: 100%; padding: 10px; margin-top: 5px; margin-bottom: 10px; border: 1px solid #cccccc; background-color: rgb(247, 247, 247); box-sizing: border-box; }
form button#payButton { background-color: #007bff; color: white; border: none; padding: 10px 20px; cursor: pointer; width: auto; display: block; margin: 15px auto 0; text-align: center; }
form button#payButton:hover { background-color: #0056b3; }
input:invalid { border-color: red; }
input:invalid + span::before { content: '✖'; color: red; padding-right: 5px; }
input:valid + span::before { content: '✓'; color: green; padding-right: 5px; }
- Assistant
To add two buttons with big text centered and the same size, you can use the following inline JavaScript code:
<button style="font-size: 30px; width: 200px; height: 100px; margin: 0 auto; display: block;">Button 1</button> <button style="font-size: 30px; width: 200px; height: 100px; margin: 0 auto; display: block;">Button 2</button>This code will create two buttons with a font size of 30 pixels, a width of 200 pixels, and a height of 100 pixels. The
margin: 0 auto;anddisplay: block;properties will center the buttons on the page. - User
I want them to be solid buttons ,one blue and other yellow, the text n eeds to be big, if possible add a logo to the left of the text.
- Assistant
To add solid buttons with different colors, big text, and a logo to the left of the text, you can use the following inline JavaScript code:
<button style="font-size: 30px; width: 200px; height: 100px; margin: 0 auto; display: block; background-color: blue; color: white; border: none; padding-left: 20px;"> <img src="logo.png" alt="Logo" style="width: 40px; height: 40px; vertical-align: middle; margin-right: 10px;"> Button 1 </button> <button style="font-size: 30px; width: 200px; height: 100px; margin: 0 auto; display: block; background-color: yellow; color: black; border: none; padding-left: 20px;"> <img src="logo.png" alt="Logo" style="width: 40px; height: 40px; vertical-align: middle; margin-right: 10px;"> Button 2 </button>In this code, the
background-colorproperty is set to "blue" for the first button and "yellow" for the second button. Thecolorproperty is set to "white" for the first button and "black" for the second button to ensure proper text visibility. Theborderproperty is set to "none" to have solid buttons without any borders. Thepadding-leftproperty is used to add space between the logo and text within the button. - User
make them next to each other, also dont use inline css. the inline js was becouse i wanted you to sellect one of them and it turn darker a few shades.
- Assistant
To make the buttons appear next to each other and apply styling using CSS instead of inline styles, you can update the HTML and CSS code as follows:
HTML:
<div class="button-container"> <button class="custom-button"> <img src="logo.png" alt="Logo" class="button-logo"> Button 1 </button> <button class="custom-button"> <img src="logo.png" alt="Logo" class="button-logo"> Button 2 </button> </div>CSS:
.button-container { display: flex; justify-content: center; } .custom-button { font-size: 30px; width: 200px; height: 100px; background-color: blue; color: white; border: none; display: flex; align-items: center; justify-content: center; } .custom-button:not(:last-child) { margin-right: 10px; } .custom-button:hover { background-color: darkblue; } .button-logo { width: 40px; height: 40px; margin-right: 10px; vertical-align: middle; } - User
not when hovering, i want them to be two options, you click one of them to sellect them, if you click the other the other one desellects and you sellect the other one. the sellected one is darker, havering does nothing
- Assistant
To achieve the desired behavior where one button is selected at a time by clicking on them, and the selected button appears darker while hovering has no effect, you can update the HTML, CSS, and JavaScript code as follows:
HTML:
<div class="button-container"> <button id="button1" class="custom-button"> <img src="logo.png" alt="Logo" class="button-logo"> Button 1 </button> <button id="button2" class="custom-button"> <img src="logo.png" alt="Logo" class="button-logo"> Button 2 </button> </div>