label

Bootstrap学习笔记(二) 表单

牧云@^-^@ 提交于 2020-02-07 04:37:45
在 Bootstrap学习笔记(一) 排版 的基础上继续学习Bootstrap的表单,编辑器及head内代码不变。 3-1 基础表单    单中常见的元素主要包括:文本输入框、下拉选择框、单选按钮、复选按钮、文本域和按钮等。   在Bootstrap框架中,通过定制了一个类名` form-control `,也就是说,如果这几个元素使用了类名“form-control”,将会实现一些设计上的定制效果。      1、宽度变成了100%   2、设置了一个浅灰色(#ccc)的边框   3、具有4px的圆角   4、设置阴影效果,并且元素得到焦点之时,阴影和边框效果会有所变化   5、设置了placeholder的颜色为#999 <form role="form"> <div class="form-group"> <label for="exampleInputEmail1">邮箱</label> <input type="email" class="form-control" id="exampleInputEmail" placeholder="请输入您的邮箱地址"> </div> <div class="form-group"> <label for="exampleInputPassword1">密码</label> <input type="password" class=

Bootstrap之表单

ε祈祈猫儿з 提交于 2020-02-07 04:35:36
基础表单 表单中常见的元素主要包括: 文本输入框 、 下拉选择框、单选按钮、复选按钮 、 文本域 和 按钮 等。 当然表单除了这几个元素之外,还有 input 、 select 、 textarea 等元素,在Bootstrap框架中,通过定制了一个类名` form-control `,也就是说,如果这几个元素使用了类名“form-control”,将会实现一些设计上的定制效果。 1、宽度变成了100% 2、设置了一个浅灰色(#ccc)的边框 3、具有4px的圆角 4、设置阴影效果,并且元素得到焦点之时,阴影和边框效果会有所变化 5、设置了placeholder的颜色为#999 注意:类名“ .form-control ”是添加在 input、select上面的。只控制输入框的样式。 注意:当 input 的类型是 checkbox 或者 radio 时,<label> 是包裹住了 <input> 的>。 水平表单 Bootstrap框架默认的表单是 垂直显示风格 ,但很多时候我们需要的 水平表单风格 (标签居左,表单控件居右)见下图。 <form class="form-horizontal" role="form"> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label"

Django账户管理部分——登录与注册

安稳与你 提交于 2020-02-06 18:37:20
个人网站功能包括发表、存储个人文章,保存网络上的图片,展示图片,保存并展示个人视频。以下为网站的登陆注册部分。 上期文章: 个人网站开发前相关项目配置 用户登录验证 再网站开发中,用户登录验证的一个简单思路通常是将用户输入的信息与数据库中的信息比对,若一致则通过,反之,验证失败. 在本项目中,也采用这种验证方式。这里要用到数据库,Django默认采用自带的sqlite数据库,在这里无需对数据库做改动,若采用MySQL等其它数据库,需要对配置文件做些改动,这里不再详细描述。 django数据模型 这里可以将数据模型简单地理解为数据表,编写数据模型即设计数据库的表中有哪些内容,数据模型需要在应用中的models.py文件中编写。 下面为一个用户个人信息示例: class UserProfile ( models . Model ) : birth = models . DateTimeField ( max_length = 100 , blank = True ) phone = models . CharField ( max_length = 20 ) def __str__ ( self ) : return 'user {}' . format ( self . user . username ) 在这个模型中,包含了用户的’phone’,'birth’信息,由此可见

K8s可视化监控告警【1】--Prometheus部署

淺唱寂寞╮ 提交于 2020-02-06 08:21:31
本文借鉴于 监控–Prometheus部署篇 1. prometheus权限设置 prometheus-rbac.yaml apiVersion : rbac.authorization.k8s.io/v1 kind : ClusterRole metadata : name : prometheus rules : - apiGroups : [ "" ] resources : - nodes - nodes/proxy - services - endpoints - pods verbs : [ "get" , "list" , "watch" ] - apiGroups : - extensions resources : - ingresses verbs : [ "get" , "list" , "watch" ] - nonResourceURLs : [ "/metrics" ] verbs : [ "get" ] --- apiVersion : v1 kind : ServiceAccount metadata : name : prometheus namespace : kube - system --- apiVersion : rbac.authorization.k8s.io/v1 kind : ClusterRoleBinding metadata

Creating Xamarin.Forms view that shows paragraph where each sentence is clickable

不羁岁月 提交于 2020-02-06 07:49:05
问题 I have a requirement to create a view on Xamarin.Forms that displays an array of strings in a paragraph. Each sentence should be: 1. Free flowing one after the other on the same line 2. Clickable so that it can be navigated upon click Also, it is desirable to have such a paragraph justify aligned. Here is the envisioned wireframe of the requirement. I have highlighted each string with alternating colors to illustrate how the list of strings (sentences) must ingest into a free flowing

二月五号博客

孤者浪人 提交于 2020-02-06 00:14:40
今天学了TensorFlow文件读取操作 一,读取图片文件 def read_picture(): """ 读取狗图片案例 :return: """ # 1、构造文件名队列 # 构造文件名列表 filename_list = os.listdir("./dog") # 给文件名加上路径 file_list = [os.path.join("./dog/", i) for i in filename_list] # print("file_list:\n", file_list) # print("filename_list:\n", filename_list) file_queue = tf.train.string_input_producer(file_list) # 2、读取与解码 # 读取 reader = tf.WholeFileReader() key, value = reader.read(file_queue) print("key:\n", key) print("value:\n", value) # 解码 image_decoded = tf.image.decode_jpeg(value) print("image_decoded:\n", image_decoded) # 将图片缩放到同一个大小 image_resized = tf.image

今日所学—jQuery基础

落爺英雄遲暮 提交于 2020-02-05 21:15:07
在使用jQuery时,首先需要导入相关库 一、使用JQ完成首页定时弹出图片 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="../js/jquery-1.8.3.js" ></script> <style> .father{ border: 0px solid red; width: 1300px; height: 2170px; margin: auto; } </style> <script> $(function(){ //1.书写显示广告图片的定时操作 time = setInterval("showAd()",3000); }); //2.书写显示广告图片的函数 function showAd(){ //3.获取广告图片,并让其显示 //$("#img2").show(1000); //$("#img2").slideDown(5000); $("#img2").fadeIn(4000); //4.清除显示图片定时操作 clearInterval(time); //5.设置隐藏图片的定时操作 time = setInterval("hiddenAd()",3000); } function hiddenAd(){

QT中在label中插入图片自适应label大小等比缩放

点点圈 提交于 2020-02-05 07:01:42
一、代码如下 QImage *img_mainicon;//主图标显示在右上角lable中 img_mainicon =new QImage;//新建一个image对象 img_mainicon->load(":/image/images/haiyan.jpg"); //载入图片到img对象中 img_mainicon->scaled(ui->label_mainicon->size(),Qt::KeepAspectRatio);//把图片 ui->label_mainicon->setScaledContents(true); ui->label_mainicon->setPixmap(QPixmap::fromImage(*img_mainicon)); //将图片放入label,使用setPixmap,注意指针*img //ui->label_mainicon->setAlignment(Qt::AlignCenter); //将图片放在label中心,用缩放了就不需要了 二、详解 其中第一,第二,第三行代码可以整合成一行 QPixmap *pixmap = new QPixmap(":/images/welcome_tlauto.png"); 其中路径可以由资源文件得到 第四条语句:设置图片缩放到label尺寸 这个是帮助中函数解释 Q Image QImage:

Django之FORM

早过忘川 提交于 2020-02-05 06:58:13
Form介绍 我们之前在HTML页面中利用form表单向后端提交数据时,都会写一些获取用户输入的标签并且用form标签把它们包起来。 与此同时我们在好多场景下都需要对用户的输入做校验,比如校验用户是否输入,输入的长度和格式等正不正确。如果用户输入的内容有错误就需要在页面上相应的位置显示对应的错误信息.。 Django form组件就实现了上面所述的功能。 总结一下,其实form组件的主要功能如下: 生成页面可用的HTML标签 对用户提交的数据进行校验 保留上次输入内容 普通方式手写注册功能 views.py # 注册 def register(request): error_msg = "" if request.method == "POST": username = request.POST.get("name") pwd = request.POST.get("pwd") # 对注册信息做校验 if len(username) < 6: # 用户长度小于6位 error_msg = "用户名长度不能小于6位" else: # 将用户名和密码存到数据库 return HttpResponse("注册成功") return render(request, "register.html", {"error_msg": error_msg}) login.html <!DOCTYPE

在FLEX中创建自定义弹出窗口.

烈酒焚心 提交于 2020-02-05 05:56:14
使用PopUpManager 和TitleWindow 类: 示例: 代码: <? xml version="1.0" encoding="utf-8" ?> <!-- http://blog.flexexamples.com/2007/08/20/creating-custom-dialog-boxes-using-the-popupmanager-and-titlewindow-classes/ --> < mx:Application xmlns:mx ="http://www.adobe.com/2006/mxml" layout ="vertical" verticalAlign ="middle" backgroundColor ="white" creationComplete ="init()" > < mx:Script > <![CDATA[ import mx.controls.Label; import mx.events.CloseEvent; import mx.containers.TitleWindow; import mx.managers.PopUpManager; private var titleWindow:TitleWindow; private function init():void { var label:Label = new