跳到主要内容

79 篇博文 含有标签「Fullstack」

查看所有标签

HTTP Request Methods

· 阅读需 6 分钟
Kimi Gao
Fullstack & AI

HTTP 的报文结构,它是由 header+body 构成,请求头里有请求方法请求目标,响应头里有状态码原因短语,本节的主要内容就是请求头里的请求方法

Method

图:HTTP请求方法

如上图所示,本文将 HTTP 方法分为了:常用方法、非常用方法和拓展方法。其中常用方法、非常用方法是需要我们重点掌握的,而拓展方法本文不会介绍,如果需要的话可以百度学习。

GET

GET 方法自 0.9 版出现并一直被保留至今,它的含义是请求从服务器获取资源,这个资源既可以是静态的文本、页面、图片、视频,也可以是由 PHP、Java 动态生成的页面或者其他格式的数据。

TypeScript Enum

· 阅读需 11 分钟
Kimi Gao
Fullstack & AI

枚举(Enum)类型经常被用于取值在一定范围内的场景,比如一周只能有七天,角色权限设计等。枚举类型变量使用enum字段来定义,枚举成员的值可以是数字或者字符串,并且枚举成员是只读的。

枚举按照类型划分,主要分为以下三种:

CSS 像素探讨

· 阅读需 7 分钟
Kimi Gao
Fullstack & AI

物理像素与独立像素

px 像素(Pixel),相对长度单位。本来 px 还是很好理解的,但是由于 Retina 屏让 px 变得扑所迷离,也是在移动端 Web 开发的时候不得不跨越的一个坎。我们先了解一下两个概念:

  • 物理像素(实际像素):即小格子,是各个厂家所宣称的屏幕分辨率,比如:2880x1800,Retina 屏所说的像素就是物理实际像素。
  • 独立像素:即大格子,是 JS/CSS 所认为的像素
    • 非 Retina 屏 独立像素 = 物理像素
    • Retina 屏 独立像素 < 物理像素

Responsive & Adaptive Design

· 阅读需 3 分钟
Kimi Gao
Fullstack & AI

Online demo: http://www.liquidapsive.com

Basic Concept

Before introduction on responsive and adaptive design, let's start by Static and Liquid which are basis of responsive and adaptive design.

Static

Static layouts are the traditional web: one design that sits in the center of the page and requires horizontal scrolling if the window is too small for it. M dot sites (m. site is a website that's specifically designed for mobile devices, and exists on a separate subdomain) are the traditional answer to this, providing a wholly separate site for a lower resolution - and all the work of creating a separate site.

CSS Media Query

· 阅读需 2 分钟
Kimi Gao
Fullstack & AI

选择加载 CSS

"自适应网页设计"的核心,就是 CSS3 引入的 Media Query 模块。

它的意思就是,自动探测屏幕宽度,然后加载相应的 CSS 文件。

<link
rel="stylesheet"
type="text/css"
media="screen and (max-device-width: 400px)"
href="tinyScreen.css"
/>

上面的代码意思是如果屏幕宽度小于 400 像素,就加载 tinyScreen.css 文件。