


This article will introduce to you the responsive layout of different screen sizes on the PC and mobile terminals. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
First the renderings:
PC side effects:
Mobile side effects:
Code As follows:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> <title></title> <link rel="stylesheet" href="pc.css" media="screen and (min-width:700px)" /> <link rel="stylesheet" href="mobile.css" media="screen and (max-width:699px)" /> </head> <body> <h1 id="响应式布局">响应式布局</h1> <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> </body> </html>
pc.css Style code:
*{margin:0;padding:0;} ul{width:calc(100% - 20px);padding:0 10px;margin:100px auto;height:auto;overflow:hidden;} ul li{list-style:none;border:1px solid blue;width:calc(25% - 2px);height;100px;float:left;text-align:center;}
mobile.css Style code:
*{margin:0;padding:0;} ul{margin:100px auto;padding:0 5px;height:auto;overflow:hidden;} ul li{list-style:none;border:1px solid red;width:calc(100% - 2px);height;100px;float:left;text-align:center;}
The critical point I set is 699px. In the actual project, you can adjust it according to the project To set more accurate css for different screens, generally consider PC, Pad, and mobile phones!
Summary: The above is the entire content of this article, I hope it will be helpful to everyone's study. For more related tutorials, please visit CSS Video Tutorial!
The above is the detailed content of Responsive layout under different screen sizes on PC and mobile terminals. For more information, please follow other related articles on the PHP Chinese website!

好看又实用的Bootstrap电商源码模板可以提高建站效率,下面本文给大家分享7款实用响应式Bootstrap电商源码,均可免费下载,欢迎大家使用!更多电商源码模板,请关注php中文网电商源码栏目!

如何在Java9中使用JavaFX来构建响应式UI界面引言:在计算机应用程序的开发过程中,用户界面(UI)是非常重要的一部分。一个好的UI能够提升用户体验,使应用程序更具吸引力。JavaFX是Java平台上的一个图形用户界面(GUI)框架,它提供了一套丰富的工具和API来快速构建富有交互性的UI界面。在Java9中,JavaFX已经成为了JavaSE的

如何使用HTML和CSS创建一个响应式轮播图布局在现代的网页设计中,轮播图是一个常见的元素。它能够吸引用户的注意力,展示多个内容或图片,并且能够自动切换。在本文中,我们将介绍如何使用HTML和CSS创建一个响应式的轮播图布局。首先,我们需要创建一个基本的HTML结构,并添加所需的CSS样式。以下是一个简单的HTML结构:<!DOCTYPEhtml&g

本篇文章我们来了解 Vue2.X 响应式原理,然后我们来实现一个 vue 响应式原理(写的内容简单)实现步骤和注释写的很清晰,大家有兴趣可以耐心观看,希望对大家有所帮助!

使用Webman进行响应式网站开发的秘诀在当今数字化时代,人们越来越依赖于移动设备来访问互联网。为了提供更好的用户体验和适配不同尺寸的屏幕,响应式网站开发已经成为了一个重要的趋势。而Webman作为一个功能强大的框架,为我们提供了许多工具和技术来实现响应式网站的开发。在这篇文章中,我们将分享一些使用Webman进行响应式网站开发的秘诀,包括如何设置媒体查询、

如何使用Vue和Element-UI实现移动端响应式设计随着移动设备的普及,移动端响应式设计变得越来越重要。Vue和Element-UI是两个非常流行的前端开发工具,可以帮助我们快速实现移动端响应式设计。本文将带领大家学习如何使用Vue和Element-UI来开发移动端响应式设计,并提供代码示例。一、搭建项目环境在开始之前,我们需要先搭建一个使用Vue和El

随着当今Web前端开发技术的快速发展,许多前端框架也随之迅速崛起。而Vue.js作为其中的一员,因其轻量、易上手、灵活、高效、响应式等特点,越来越被广大前端开发者所青睐。在Vue的帮助下,我们可以很方便地实现响应式UI设计,提升用户交互体验,下面我们来详细介绍一下。一、什么是响应式UI设计?响应式UI设计是一种页面设计方法,其主要目的是根据不同设备的屏幕大小

如何使用HTML和CSS创建一个响应式图片展示布局在现代Web设计中,响应式布局已经成为一种标配,因为越来越多的人使用不同尺寸和分辨率的设备浏览网页。在本文中,我们将介绍如何使用HTML和CSS来创建一个响应式图片展示布局。首先,我们需要一个HTML文件来构建页面结构。在该文件中,我们使用HTML5的语义化标签来定义主要的布局结构。以下是一个简单的示例:&l


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Notepad++7.3.1
Easy-to-use and free code editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version
God-level code editing software (SublimeText3)
