html,css初学

2023-10-27

安装VSCODE ,插件:live server ,html support

html

然后为了更好地理解,请逐步输入,并及时查看效果

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>

    </head>
    <body>
        <div class="box">        
            <h1>非顶级程序员</h1>
            <h2>hhh </h2>
            <img src="./test2.jpg" alt="图片" width="200px">
            <br>
            <a href="http://www.baidu.com" target="_blank">百度</a>//跳转页面到百度
            <br>//换行
            hello world 
        </div>

    </body>
</html>

添加style设置居中

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            .box{
                width:600px;
                height:1200px;
                margin:auto;
                top:0;
                left:0;
                right: 0;
                bottom: 0;
                text-align: center;
            }

        </style>
    </head>
    <body>
        <div class="box">        
            <h1>非顶级程序员</h1>
            <h2>hyq </h2>
            <img src="./test2.jpg" alt="图片" width="200px">
            <br>
            <a href="http://www.baidu.com" target="_blank">百度</a>
            <br>
            hello world bilibili
        </div>

    </body>
</html>

css

demo3.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <title>Document</title>
    <style>
        h2{
            color:purple;
        }
    </style>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <h1 style="color:red;">标题</h1>
    <h2>hello</h2>
    <h3>world</h3>
</body>
</html>

在这里插入图片描述
创建style.css

h3{
    color:green;
}
类选择器
.my_p{}
id选择器
#my_p{}
属性选择器
a[title=""]{}
通用选择器
*{
font-family:"  "
}

制作一个简单的登陆页面

理解box

在这里插入图片描述
在这里插入图片描述

原文链接:https://blog.csdn.net/Laollaoaolao/article/details/119454636

label

< label> 标签为 input 元素定义标注(标记

<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<p>点击其中一个文本标签选中选项:</p>

<form action="demo_form.php">
  <label for="male">Male</label>
  <input type="radio" name="sex" id="male" value="male"><br>
  <label for="female">Female</label>
  <input type="radio" name="sex" id="female" value="female"><br><br>
  <input type="submit" value="提交">
</form>

</body>
</html>

在这里插入图片描述

a href=“#”

href在是CSS代码的一种意思是指定超链接目标的URL。在HTML和JSP页面代码里的作用是标签,其作用是插入一个超链接,“#”是默认当前页面,可以把#换成想跳转的页面。

\通常有如下用法: <a href="#" onclick="window.close()">关闭</a> 。

将href="#"是指链接到当前页面,其实是无意义的,页面也不会刷新,关键是后面的onclick,当点击“关闭”时,会执行window.close()代码。

display:flex?

一:display:flex 布局
display:flex 是一种布局方式。它即可以应用于容器中,也可以应用于行内元素。是W3C提出的一种新的方案,可以简便、完整、响应式地实现各种页面布局。目前,它已经得到了所有浏览器的支持。

Flex是Flexible Box的缩写,意为"弹性布局",用来为盒状模型提供最大的灵活性。设为Flex布局以后,子元素的float、clear和vertical-align属性会失效。

二:flex的六大属性
flex-direction 容器内元素的排列方向(默认横向排列)
1:flex-direction:row; 沿水平主轴让元素从左向右排列

2:flex-direction:column; 让元素沿垂直主轴从上到下垂直排列

3:flex-direction:row-reverse;沿水平主轴让元素从右向左排列

原文链接:https://blog.csdn.net/Vodka688/article/details/115190822

代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="box">
        <h2>Login</h2>
        <div class="input-box">
            <label >账号</label>
            <input type="text">
        </div>
        <br>
        <div class="input-box">
            <label>密码</label>
            <input type="password" >
        </div>
        <div class="btn-box">
            <a href="#">忘记密码</a>
            <div>
                <botton>登陆</botton>
                <botton>注册</botton>
            </div>
        </div>
    </div>
</body>
</html>
@charset "utf-8";

*{
    margin:0;
    padding:0;
}
body{
    display:flex;
    flex-direction: column;
    justify-content:center;
    align-items: center;
    height: 100vh;
    background: url(./test2.jpg) no-repeat;
    background-size: cover;
}
.box{
    display:flex;
    flex-direction: column;
    justify-content:center;
    align-items: center; 
    width: 350px;
    height: 380px;
    border-top: 1px solid rgba(255,255,255,0.5);
    border-left: 1px solid rgba(s255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    border-right: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);

}
.box > h2 {
    color: rgba(22, 21, 21, 0.9);
    margin-bottom: 20px;
}
.box .input-box {
    display: felx;
    flex-direction: column;
    justify-content: center;
    align-items: start;
}

.box .input-box > label {
    color: rgba(85, 36, 36, 0.9);
    margin: 10px;
    font-size: 15px;
}

.box .input-box > input {
    color: rgba(85, 36, 36, 0.9);
    font-size: 14px;
    height:20px;
    width: 200px;
    background: rgba(255,255,255,0.3);
    border:1px solid rgba(255,255,255,0.5);
    border-radius: 5px;
    transparent:3s;
    outline: none;
    padding:0 10px;


}
.box .input-box > input:focus {
    border: 1px solid rgba(255,255,255,0.2);


}
.box .btn-box{
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 250px;
    align-items: start;
    text-align:center
    
}

.box .btn-box > a:hover{
  
    color:rgba(255,255,255,1);  
   
}

.box .btn-box > div{
    display: flex;
    flex-direction: rows;
    
    justify-content: center;
    align-item:start;

   
}
.box .btn-box > div >botton{
    margin:0px;
    
    width:130px;
    border:1px solid rgba(41, 33, 33, 0.5);
    height:25px;
    padding:1px;
    border-radius: 5px;
    background-color: rgb(232, 236, 240);
}

.box .btn-box > div >botton:nth-of-type(2){
    margin-left: 10px;
    
    width:130px;
   
}

在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

html,css初学 的相关文章

随机推荐

  • 阿里开源的缓存框架JetCache

    之前一直在用Spring Cache进行接口数据的缓存 主要是Spring Cache在对具体key缓存失效时间的设置不是很方法 还要自己去扩展 无意中发现了阿里的JetCache 大部分的需求都能满足 并且有一些很实用的功能 今天给大家介
  • activate : 无法将“activate”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1

    在pycharm里面错误展示 无法激活虚拟环境 解决方法 以管理员身份运行 PowerShell 并输入 set executionpolicy remotesigned 再输入 y 如图 输入完后重新打开pycharm 再次输入 acti
  • SpringBoot项目整合Mybatis时Mapper.xml文件的存放位置

    目录 方式一 放在与Mapper接口同级目录 方式二 在resources创建Mapper接口同名文件夹用来存放Mapper xml文件 方式三 在resources目录下创建mapper文件夹存放mapper xml 推荐 方式一 放在与
  • git 签出(恢复)指定文件

    在项目开发中 偶尔会因为误删文件或其他原因需要从git仓库中恢复某些文件 此篇文章将介绍如何通过git从历史提交记录 分支记录恢复指定文件 1 git checkout 说明 使用git checkout除了可以切换分支外 还可以签出指定文
  • Elasticsearch Java High Level REST Client(Exists API)

    Exists API 如果文档存在 则existsAPI返回true 否则返回false Exists请求 它就像Get API一样使用GetRequest 支持所有可选参数 由于exists 只返回true或false 我们建议关闭获取
  • 目标检测之Yolov3与Anchor-Free

    原文 目标检测之RCNN Yolo SSD RetinaNet与Anchor Free dagongji10的博客 CSDN博客 2 2 Yolo v3 2018 Yolo v3 论文比 Yolo v2 还要随意 具体优化内容主要有 bbo
  • 用python绘制曼彻斯特编码等八种常见数据编码方式的波形图

    用python绘制八种数据编码方式的波形图 2020春季北京航空航天大学计算机学院物联网引论课程作业 介绍八种常见数据编码方式并实践画出波形图 本文使用了python中的二维图像模块matplotlib 博主在信号与通信原理方面功底不深 如
  • deepin的踩坑问题与解决方案,以及使用分享(持续更新)

    笔者目前的电脑环境是Redmibook 14 AMD的锐龙版 R5 3700U 只有集成显卡 不同换环境下问题原因不一定相同 如驱动等兼容性问题 可以借鉴解决思路 但更多问题还是具有共性 Q1 u盘安装的时候 卡在蓝色背景图 无安装程序启动
  • e3 服务器虚拟机,e3 虚拟机

    e3 虚拟机 内容精选 换一换 Hypervisor能实现同一物理机上不同虚拟机之间的资源隔离 避免虚拟机之间的数据窃取或恶意攻击 保证虚拟机的资源使用不受周边虚拟机的影响 用户使用虚拟机时 仅能访问属于自己的虚拟机的资源 如硬件 软件和数
  • 【Ethernet】以太网卡LAN8720A分析和使用

    文章目录 1 LAN8720A简介 2 PHYAD 0 PHY地址配置 3 MODE 2 0 Mode配置 4 nINTSEL nINT REFCLKO配置 5 REGOFF 配置内部 1 2V电压源 6 SMI MDC MDIO 总线接口
  • android studio jdk se 8,java - Is JDK 1.8 fully supported by Android Studio? - Stack Overflow

    Actually you get all sorts of crazy Gradle errors when trying to build Android Studio projects with Java 8 like 2016 04
  • C++避坑——most vexing parse问题

    1 坑 的问题是什么 先看一段代码 class Functor public void operator std cout lt lt 我是线程的初始函数 lt lt std endl int main std thread t Funct
  • 第六章:认识Java的API-使用Java函数库

    该系列文章系个人读书笔记及总结性内容 任何组织和个人不得转载进行商业活动 第六章 认识Java的API 使用Java函数库 Java内置有数百个类 如果你知道如何从统称Java API的Java的函数库中查找所需功能 那就不用再造轮子了 核
  • 检测属性

    点上面关注免费学习前端知识 JavaScript对象可以看做属性的集合 我们经常会检测集合中成员的所属关系 判断某个属性是否存在于某个对象中 可以通过in运算符 hasOwnPreperty 和propertyIsEnumerable 方法
  • HTML常见标签总结

    目录 1 标题标签 2 段落标签 3 字体修饰标签 4 图片标签 5 超链接标签 6 表格标签 7 列表标签 8 表单标签 9 下拉菜单 10 多行文本框 1 标题标签 一级标题是 h1 h1 中间填上标题的内容 一共可以设置六级标题 数字
  • 【Git笔记】添加暂存区与提交本地库

    本文以提交 hello txt 为例 在开始之前普及一个快捷方式 在 Linux 中 文本复制为 esc gt yy 粘贴为 d 查看本地库状态 git status 当文本只停留在工作区时 本地状态如下 添加暂存区 git add hel
  • Naviact无法连接到MySQL数据库

    无法连接到MySQL数据库 省流版 服务器没有开MySQL的端口 之所以还要写一篇文章 是因为开端口只需要一分钟 而根据各种现象与线索推断出没有开端口则需要三个小时 问题背景 在服务器上安装了Linux虚拟机 然后在虚拟机上安装MySQL
  • 文本分类之模型初探

    这里写自定义目录标题 简说回归模型 逻辑回归模型介绍 逻辑回归模型应用 简说回归模型 回归模型是对统计关系进行定量描述的数学模型 研究的是因变量和自变量之间的关系 研究回归模型要用到回归方法 常见的回归方法有线性回归 逻辑回归 多项式回归等
  • C语言编写一个简单的选择题答题系统

    上个星期 我们老师给我们布置了一道非常变态的作业题 开始一看只有一道题 欣喜若狂 以为老师终于大发慈悲了一回 结果点开一看 长这样 顿时就傻了眼 对于一个刚接触C语言一两个月的小白来说 不能说不会做 只能说看不懂 哭笑 哭笑 但是经过几天的
  • html,css初学

    安装VSCODE 插件 live server html support html 然后为了更好地理解 请逐步输入 并及时查看效果 div class box h1 非顶级程序员 h1 h2 hhh h2 img src tes div