零基础学css
选择器:标签选择器、id选择器、类选择器
----------------------------------------------------------------------------
标签中:
<p style="color:blue;"></p>:修饰p标签的字体颜色
<p style="color:#BC8F8F"></p>
<p style="color:rgb(205,92,92)"></p>
----------------------------------------------------------------------------
<head>中:
<style type="text/css">
p{
color: red;
}
</style>
color: red; :标签内字体颜色
background: green; :背景色
------------------------------------------------------------------------------
单独的css文件:
html中引入css:<link rel="stylesheet" type="text/css" href="index.css">
html代码:
<p id="p1">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti repellendus omnis, voluptatibus dicta quidem aliquam doloribus illum, ex a harum maiores. Sed quo deleniti debitis blanditiis itaque qui totam facilis?</p>
<p class="p2">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde recusandae accusantium consequatur ex laboriosam tempora ipsa blanditiis, explicabo, quo aliquam temporibus enim natus sapiente provident eaque molestiae amet. Ut, molestiae.</p>
<p class="p2">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nulla, perferendis est, itaque, aut aliquid nisi iure soluta quisquam quibusdam sint cumque ducimus error, commodi aliquam. Quis culpa temporibus officia libero.</p>
css代码:
p{
color: lightblue;
/*background: green;*/
}
#p1{
color: red;
}
.p2{
color: blue;
}
----------------------------------------------------------------------------------
div:

------------------------------------------------------------------------------------------------------------------------
登录界面
css代码:
#container{
height: 300px;
width: 400px;
border: 1px solid;
margin-top: 300px;
margin-left: %;
background-image: url("../img/qq.jpg");
background-repeat: no-repeat;
background-position: center center;
}
.input{
height: 40px;
width: 280px;
margin-top: 50px;
margin-left: 50px;
}
.button{
margin-top: 10px;
margin-left: 100px;
}
.btn{
margin-left: 30px;
}
#user{
background-image: url("../img/head.png");
background-repeat: no-repeat;/*图片背景取消平铺*/
padding-left: 30px;
}
#password{
background-image: url("../img/key.jpg");
background-repeat: no-repeat;
padding-left: 30px;
}
html代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>QQ登录界面</title>
<link rel="stylesheet" type="text/css" href="css/index4.css">
</head>
<body>
<div id="container">
<div class="input">
用户名:<input type="text" id="user">
</div>
<div class="input">
密 码:<input type="password" id="password">
</div>
<div class="button">
<input type="button" class="btn" value="登录">
<input type="button" class="btn" value="注册">
</div>
</div>
</body>
</html>
零基础学css的更多相关文章
- 零基础学css第二天
内边距与外边距: <!DOCTYPE html> <html> <head> <title></title> <style type= ...
- 《零基础学JavaScript(全彩版)》学习笔记
<零基础学JavaScript(全彩版)>学习笔记 二〇一九年二月九日星期六0时9分 前期: 刚刚学完<零基础学HTML5+CSS3(全彩版)>,准备开始学习JavaScrip ...
- 《零基础学HTML5+CSS3(全彩版)》读书笔记
2019年1月31日星期四 1点 <零基础学HTML5+CSS3(全彩版)>开始全面学习 前提: 11月20日开始学Python,可能因为太累了,也可能遇到了瓶颈,进入了一个迷茫期,1月6 ...
- 《Windows编程零基础学》第零节
首先很开心申请到了这一个专栏<Windows编程零基础学> 这是第一篇文章,在这里,我将讲述一些基础的知识. 什么是Windows编程 所谓Windows编程就是在Windows平台上开发 ...
- 【视频】零基础学Android开发:蓝牙聊天室APP(四)
零基础学Android开发:蓝牙聊天室APP第四讲 4.1 ListView控件的使用 4.2 BaseAdapter具体解释 4.3 ListView分布与滚动事件 4.4 ListView事件监听 ...
- 【视频】零基础学Android开发:蓝牙聊天室APP(二)
零基础学Android开发:蓝牙聊天室APP第二讲 2.1 课程内容应用场景 2.2 Android UI设计 2.3 组件布局:LinearLayout和RelativeLayout 2.4 Tex ...
- [Python] 文科生零基础学编程系列二——数据类型、变量、常量的基础概念
上一篇:[Python] 文科生零基础学编程系列--对象.集合.属性.方法的基本定义 下一篇: (仍先以最简单的Excel的VBA为例,语法与Python不同,但概念和逻辑需要理解透彻) p.p1 { ...
- [Python] 文科生零基础学编程系列三——数据运算符的基本类别
上一篇:[Python] 文科生零基础学编程系列二--数据类型.变量.常量的基础概念 下一篇: ※ 程序的执行过程,就是对数据进行运算的过程. 不同的数据类型,可以进行不同的运算, 按照数据运算类型的 ...
- 零基础学python-2.8 字典
字典类型,事实上就是相当于java的map,通过key-value来记录数据,工作原理类似于哈希表 差点儿全部的python对象都能够作为key,可是一般最经常使用的还是数字和字符串 字典元素使用{} ...
随机推荐
- ScrollView监听滑动到顶部和底部的方法
不需要监听滑动位置,只需要重写ScrollView的onOverScrolled和stopNestedScroll方法就可以了 public class ReadScrollView extends ...
- Moodle-3.1.2 (Ubuntu 16.04 )
平台: Ubuntu 类型: 虚拟机镜像 软件包: moodle-3.1.2 commercial education moodle open-source 服务优惠价: 按服务商许可协议 云服务器费 ...
- OMD开源监控软件
参考 Best Monitoring Solution - OMD (Nagios + Check_MK) 官网 mathias-kettner.com OMD labs.consol.de Conf ...
- 【JavaScript 封装库】BETA 4.0 测试版发布!
/* 源码作者: 石不易(Louis Shi) 联系方式: http://www.shibuyi.net =============================================== ...
- 使用Python命令创建jenkins的job
目的:通过调用jenkins的命令,动态创建jenkins的job 如何使用,使用Python的脚本,更多API可以进入到官网去查看,http://jenkinsapi.readthedocs.io/ ...
- 从Java官网下载JDK1.6等低版本JDK
今天在浏览Java官网的时候发现旧版本(1.8之前)的JDK安装包下载地址没有在下载页面明显的提供出来.个人通过在官网查看,发现oracle官方将旧版本的JDK全都放在Java Archive模块中了 ...
- git中Bash基本操作命令
).cd : 改变目录. ).cd . . 回退到上一个目录,直接cd进入默认目录 ).pwd : 显示当前所在的目录路径. ).ls(ll): 都是列出当前目录中的所有文件,只不过ll(两个ll)列 ...
- DTcms网站伪静态逻辑
我们之前写伪静态就是web.config里面配置好.-->配置伪静态(URL重写),DTcms网站写的伪静态跟之前的不一样,他是静态页面和代码现实了分离.http://demo.dtcms.ne ...
- caffe安装中opencv的各种库问题
提示有些库 high**** opencv的问题,好像是这几个库版本冲突,不要用anaconda里的lib库,用系统的库就行了,删掉或者从新链接过去.
- JQuery 解决按钮上的倒计时问题
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...