当前位置: 首页 > news >正文

【Javascript】计算器(Calculator)网页设计案例

代码如下:
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算器</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f4f4f4;
            font-family: Arial, sans-serif;
        }
        .calculator {
            width: 300px;
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
            text-align: center;
        }
        .screen {
            width: 100%;
            height: 50px;
            font-size: 24px;
            text-align: right;
            padding: 10px;
            border: none;
            background: #eee;
            border-radius: 5px;
            margin-bottom: 10px;
        }
        .buttons {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
        }
        button {
            padding: 15px;
            font-size: 18px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: 0.3s;
        }
        .operator {
            background: #ff9500;
            color: white;
        }
        .clear {
            background: #ff3b30;<

http://www.dtcms.com/a/54146.html

相关文章:

  • NVIDIA Jetson Nano的国产替代,基于算能BM1684X+FPGA+AI算力盒子,支持deepseek边缘部署
  • 【Python项目】基于深度学习的电影评论情感分析系统
  • 机械臂路径规划方法综述(一)
  • 机器学习中的线性代数:奇异值分解 SVD
  • 汇编点亮LED
  • python文本处理openpyxl库安装与使用
  • 江科大51单片机笔记【9】DS1302时钟可调时钟(下)
  • 【五.LangChain技术与应用】【25.LangChain RAG检索器与完整案例:实战中的RAG应用】
  • Mac同时安装jdk8和jdk17,默认选择jdk8
  • 计算机组成与系统结构—袁春风阅读笔记(一)
  • 博查搜索API日调用量突破3000万次,达到Bing API的1/3。
  • 论文粗读——Isometric 3D Adversarial Examples in the Physical World
  • 【CSS】---- 纯 CSS 实现无限滚动轮播
  • Linux下AWK命令使用方法
  • JavaScript中的Math()
  • SpringBoot优雅关机,监听关机事件,docker配置
  • gbase8s数据库检测非法字符
  • VSCode 配置优化指南:打造高效的 uni-app、Vue2/3、JS/TS 开发环境
  • JS—组成:2分钟掌握什么是ECMAScript操作,什么是DOM操作,什么是BOM操作
  • 在Blender中给SP分纹理组
  • GStreamer —— 2.6、Windows下Qt加载GStreamer库后运行 - “教程6:媒体格式和Pad功能“(附:完整源码)
  • 基于Spring Boot的多级缓存架构实现
  • C++学习(十四)(使用库)
  • JVM详解
  • C# 开发工具Visual Studio下载和安装
  • vue3中子组件获取父组件的name,父组件不做修改动作
  • JavaScript中的主要知识点
  • Windows 图形显示驱动开发-WDDM 3.2-GPU-P 设备上的实时迁移(一)
  • 【vscode】一键编译运行c/c++程序
  • 深度解析 slabtop:实时监控内核缓存的利器