【Javaweb-前端】CSS

news2024/12/26 23:27:38

1. Syntax

  • Selector − A selector is an HTML tag at which a style will be applied. This could be any tag like or etc.
  • Property − A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color, border etc.
  • Value − Values are assigned to properties. For example, color property can have value either red or #F1F1F1 etc.

1.1 Selector

# 1. Type selector
h1 {
   color: #36CFFF; 
}

#2. Universal Selector
* { 
   color: #000000; 
}

#3. Descendant Selector
ul em{
    color: #0000;
}

#4. Class Selector
.black {
   color: #000000; 
}

#5. ID selector
#black {
   color: #000000; 
}

1.2 Inclusion

<style type = "text/css" media = "all">
         body {
            background-color: linen;
         }
         h1 {
            color: maroon;
            margin-left: 40px;
         }
</style>

# 1. Inline
<h1 style = "color:#36C;"> 
# 2. external
 <link type = "text/css" href = "..." media = "..." />

1.3 MeasureMent Units

2. Attribute

2.1 Background

  • The background-color property is used to set the background color of an element.
  • The background-image property is used to set the background image of an element.
  • The background-repeat property is used to control the repetition of an image in the background.
  • The background-position property is used to control the position of an image in the background.
  • The background-attachment property is used to control the scrolling of an image in the background.

2.2 font

  • The font-family property is used to change the face of a font.
  • The font-style property is used to make a font italic or oblique.
  • The font-variant property is used to create a small-caps effect.
  • The font-weight property is used to increase or decrease how bold or light a font appears.
  • The font-size property is used to increase or decrease the size of a font.

2.4 Text

  • The color property is used to set the color of a text.
  • The direction property is used to set the text direction.
  • The letter-spacing property is used to add or subtract space between the letters that make up a word.
  • The word-spacing property is used to add or subtract space between the words of a sentence.
  • The text-indent property is used to indent the text of a paragraph.
  • The text-align property is used to align the text of a document.
  • The text-decoration property is used to underline, overline, and strikethrough text.
  • The text-transform property is used to capitalize text or convert text to uppercase or lowercase letters.
  • The white-space property is used to control the flow and formatting of text.
  • The text-shadow property is used to set the text shadow around a text.

2.5 Image

  • The border property is used to set the width of an image border.
  • The height property is used to set the height of an image.
  • The width property is used to set the width of an image.
  • The -moz-opacity property is used to set the opacity of an image.

2.6 Link

  • The :link signifies unvisited hyperlinks.
  • The :visited signifies visited hyperlinks.
  • The :hover signifies an element that currently has the user’s mouse pointer hovering over it.
  • The :active signifies an element on which the user is currently clicking.
<style type = "text/css">
   a:link {color: #000000}
   a:visited {color: #006600}
   a:hover {color: #FFCC00}
   a:active {color: #FF00CC}
</style>	

2.7 Table

  • The border-collapse specifies whether the browser should control the appearance of the adjacent borders that touch each other or whether each cell should maintain its style.
  • The border-spacing specifies the width that should appear between table cells.
  • The caption-side captions are presented in the caption element. By default, these are rendered above the table in the document. You use the caption-side property to control the placement of the table caption.
  • The empty-cells specifies whether the border should be shown if a cell is empty.
  • The table-layout allows browsers to speed up layout of a table by using the first width properties it comes across for the rest of a column rather than having to load the whole table before rendering it.
<html>
   <head>
      <style type = "text/css">
         table.one {border-collapse:collapse;}
         table.two {border-collapse:separate;}
         
         td.a {
            border-style:dotted; 
            border-width:3px; 
            border-color:#000000; 
            padding: 10px;
         }
         td.b {
            border-style:solid; 
            border-width:3px; 
            border-color:#333333; 
            padding:10px;
         }
      </style>
   </head>

   <body>
      <table class = "one">
         <caption>Collapse Border Example</caption>
         <tr><td class = "a"> Cell A Collapse Example</td></tr>
         <tr><td class = "b"> Cell B Collapse Example</td></tr>
      </table>
      <br />
      
      <table class = "two">
         <caption>Separate Border Example</caption>
         <tr><td class = "a"> Cell A Separate Example</td></tr>
         <tr><td class = "b"> Cell B Separate Example</td></tr>
      </table>
   </body>
</html>

2.8 Border

  • The border-color specifies the color of a border.
  • The border-style specifies whether a border should be solid, dashed line, double line, or one of the other possible values.
  • The border-width specifies the width of a border.
  • border-bottom-color changes the color of bottom border.
  • border-top-color changes the color of top border.
  • border-left-color changes the color of left border.
  • border-right-color changes the color of right border.

2.9 Margin

  • The margin-bottom specifies the bottom margin of an element.
  • The margin-top specifies the top margin of an element.
  • The margin-left specifies the left margin of an element.
  • The margin-right specifies the right margin of an element.

2.10 Lists

  • The list-style-type allows you to control the shape or appearance of the marker.
  • The list-style-position specifies whether a long point that wraps to a second line should align with the first line or start underneath the start of the marker.
  • The list-style-image specifies an image for the marker rather than a bullet point or number.
  • The list-style serves as shorthand for the preceding properties.
  • The marker-offset specifies the distance between a marker and the text in the list.

2.11 Paddings

  • specify how much space should appear between the content of an element and its border
  • The padding-bottom specifies the bottom padding of an element.
  • The padding-top specifies the top padding of an element.
  • The padding-left specifies the left padding of an element.
  • The padding-right specifies the right padding of an element.

2.12 Outline

  • The outline-width property is used to set the width of the outline.
  • The outline-style property is used to set the line style for the outline.
  • The outline-color property is used to set the color of the outline.
  • The outline property is used to set all the above three properties in a single statement.

2.13 Dimension

  • The height property is used to set the height of a box.
  • The width property is used to set the width of a box.
  • The line-height property is used to set the height of a line of text.
  • The max-height property is used to set a maximum height that a box can be.
  • The min-height property is used to set the minimum height that a box can be.
  • The max-width property is used to set the maximum width that a box can be.
  • The min-width property is used to set the minimum width that a box can be.

2.14 Scrollbars

  • visible:Allows the content to overflow the borders of its containing element.
  • hidden:The content of the nested element is simply cut off at the border of the containing element and no scrollbars is visible.
  • **scroll:**The size of the containing element does not change, but the scrollbars are added to allow the user to scroll to see the content.
  • **auto:**The purpose is the same as scroll, but the scrollbar will be shown only if the content does overflow.

2.16 visibility

  • visible, hidden, collapse

2.17 position

<div style = "position:fixed; left:80px; top:20px; background-color:yellow;">
<div style = "position:absolute; left:80px; top:20px; background-color:yellow;">
<div style = "position:relative; left:80px; top:2px; background-color:yellow;">

2.18 layer

  • z-index : 值越大越在上面

3. Effect

3.1 Rounded Corners

#rcorners7 {
   border-radius: 60px/15px;
   background: #FF0000;
   padding: 20px; 
   width: 200px;
   height: 150px; 
}

3.2 Border Image

  • border-img-source: used to set image path
  • border-img-slice: used to slice boarder image
  • border-img-width:
  • border-img-repeat: set boarder image as rounded, repeated, and stretched.
<style>
         #borderimg1 { 
            border: 10px solid transparent;
            padding: 15px;
            border-image-source: url(/css/images/border.png);
            border-image-repeat: round;
            border-image-slice: 30;
            border-image-width: 10px;
         }
</style>

Resource

  • css 在线查看: https://www.w3school.com.cn/css/index.asp

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/95441.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

散热材料产业SWOT分析:5G建设带动市场需求 多元化散热方案将成行业主流

传统散热材料以石墨片和导热凝胶等TIM材料&#xff08;导热界面材料&#xff09;为主&#xff0c;石墨片存在导热系数相对较低、厚度相对较大等问题。目前热管和VC&#xff08;均热板&#xff09;开始从电脑、服务器等领域渗透到智能手机终端&#xff0c;石墨烯材料也开始应用。…

Docker笔记--容器转换为镜像、Dockerfile的使用

目录 1--使用 docker commit 将容器转换为镜像 1-1--容器转换为镜像 1-2--实例代码 1-3--注意事项&#xff1a; 2--Dockerfile的使用 2-1--常用关键字 2-2--利用 dockerfile 搭建 Centos:7 镜像 1--使用 docker commit 将容器转换为镜像 1-1--容器转换为镜像 # 将容器…

家电产品出口指南,RoHs法规详解

【家电产品出口指南&#xff0c;RoHs法规详解】 受疫情影响&#xff0c;我国家电出口创新高&#xff0c;据海关总署发布的数据统计&#xff0c;2021年&#xff0c;中国家用电器出口额987.2亿美元&#xff0c;同比增长22.3%&#xff0c;出口规模远超历史同期水平&#xff0c;创近…

新款Macbook Pro可以升级固态硬盘吗?

不知道有多少用户因为预算不足而选购了256GB固态硬盘版本的Mac呢&#xff1f;在购买Mac之前&#xff0c;总觉得“省省总会有的”。实际上&#xff0c;还是很多256G的用户都在后悔&#xff1a;“为什么当初没有加钱升级固态硬盘啊&#xff01;”小编在此也提醒大家&#xff0c;如…

让人恶心的多线程代码,性能怎么优化!

Java 中最烦人的&#xff0c;就是多线程&#xff0c;一不小心&#xff0c;代码写的比单线程还慢&#xff0c;这就让人非常尴尬。 通常情况下&#xff0c;我们会使用 ThreadLocal 实现线程封闭&#xff0c;比如避免 SimpleDateFormat 在并发环境下所引起的一些不一致情况。其实…

Java+MySQL校园网络超市系统的设计与实现 开题 论文

随着我国教育模式的改革,我国的大学生数量在逐步的增加,虽然每个高校的附近都有便利店但是很是时候这些便利店不能够满足学生的日常生活和学习的需求,尤其是便利店因为成本的原因货物不全 ,而大学生很多时候更希望通过网络购买自己所需的物品,所以通过校园网络超市系统来购买自…

基于java+springmvc+mybatis+vue+mysql的大学校医院信息管理系统

项目介绍 本系统采用java语言开发&#xff0c;后端采用ssm框架&#xff0c;前端采用vue技术&#xff0c;数据库采用mysql进行数据存储。 前台&#xff1a; 首页、校医、药品信息、疫情公告、个人中心、后台管理 后台&#xff1a; 首页、个人中心、在线问诊管理、问诊回复管理…

计算机毕设Python+Vue校园新闻广播系统(程序+LW+部署)

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

[附源码]Node.js计算机毕业设计个人人际关系管理软件Express

项目运行 环境配置&#xff1a; Node.js最新版 Vscode Mysql5.7 HBuilderXNavicat11Vue。 项目技术&#xff1a; Express框架 Node.js Vue 等等组成&#xff0c;B/S模式 Vscode管理前后端分离等等。 环境需要 1.运行环境&#xff1a;最好是Nodejs最新版&#xff0c;我…

Mysql 数据库时间与系统时间不一致问题排查

NO.1 产生问题 在我们学习中使用到sysdate这个函数时&#xff0c;发现查出来的日期时间与当前的正确时间不一致&#xff0c;相差8个小时左右&#xff0c;为什么会产生这个问题&#xff1f;又该如何解决&#xff1f; – 在数据库中使用sysdate()函数查询系统时间 select sysd…

【MAX7800与ESP8266mcu串口通讯点灯】

【MAX7800与ESP8266mcu通讯】1. 前言2. 实验条件2.1 硬件条件2.2 软件条件3. 程序编写3.1 ESP8266程序解剖3.2 MAX7800程序解剖4. 实验效果4.1 esp8266打印如下4.2 max7800打印如下5. 小结1. 前言 前期搭好MAX7800 的eclipse和ESP82666的Arduino开发环境&#xff0c;现在开始慢…

计算机毕设Python+Vue校园网上二手交易系统(程序+LW+部署)

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

非零基础自学Golang 第8章 包管理 8.2 包的声明 8.3 包的导入

非零基础自学Golang 文章目录非零基础自学Golang第8章 包管理8.2 包的声明8.3 包的导入8.3.1 导入声明8.3.2 远程导入8.3.3 别名导入8.3.4 匿名导入第8章 包管理 8.2 包的声明 包是结构化代码的一种方式&#xff1a;每个程序都由包&#xff08;通常简称为pkg&#xff09;的概…

35岁程序员:被大厂裁员后,我赚到手的却是这样:

这两年互联网行业一直不平静&#xff0c;都得都懂。认识一兄弟&#xff0c;技术不错&#xff0c;p7&#xff0c;干架构的&#xff0c;也在这场风波中“光荣毕业”了&#xff0c;前段时间找我出去小聚&#xff0c;聊起了这事儿&#xff1a; “比起惆怅&#xff0c;我更多的是感到…

04-Golang的一些基本变量

Golang的一些基本变量变量介绍概念变量使用注意事项变量的使用的基本步骤程序中 号的使用变量介绍 概念 变量相当于内存中一个数据存储空间的表示&#xff0c;你可以把变量看作是一个个房间的门牌号&#xff0c;通过门牌号我们可以找到房间&#xff0c;同样的道理&#xff0c…

Mycat(1):Mycat简介

1、什么是MyCat MyCat是目前最流行的分布式数据库中间插件&#xff0c;是一个开源的分布式数据库系统&#xff0c;是一个实现了MySQL协议的服务器&#xff0c;前端用户可以把它看作是一个数据库代理&#xff0c;用MySQL客户端工具和命令行访问&#xff0c;而其后端可以用MySQL…

ODN 2395丨艾美捷CpG ODN系列参数介绍

艾美捷CpG ODN系列——ODN 2006&#xff1a;具有硫代磷酸酯骨架的CpG寡脱氧核苷酸&#xff08;C型&#xff09;。人和小鼠TLR9&#xff08;Toll样受体9&#xff09;的特异性配体。 艾美捷CpG ODN 丨ODN 2395化学性质&#xff1a; 序列&#xff1a;5-tcgtcgtttttcggcgcgcgccgcg…

基于java+springmvc+mybatis+vue+mysql的班级事务管理系统

项目介绍 学校教务管理信息化是提高办公效率的主要途径&#xff0c;随着我国高等教育的快速发展&#xff0c;学校办学规模的不断扩大&#xff0c;在校学生人数不断增多&#xff0c;办学层次出现多元化&#xff0c;由一地办学发展到多地多点办学&#xff0c;同时进一步推行学分…

一文弄懂Java中线程池原理

在工作中&#xff0c;我们经常使用线程池&#xff0c;但是你真的了解线程池的原理吗&#xff1f;同时&#xff0c;线程池工作原理和底层实现原理也是面试经常问的考题&#xff0c;所以&#xff0c;今天我们一起聊聊线程池的原理吧。 为什么要用线程池 使用线程池主要有以下三…

44 有效括号序列 45滑动窗口的最大值

44 有效括号序列 很容易想到用栈&#xff0c;但是一开始还是写得有问题 import java.util.*;public class Solution {/*** * param s string字符串 * return bool布尔型*/public boolean isValid (String s) {// write code hereStack<Character> st new Stack<>…