GVKun编程网logo

织梦网站HTML5+CSS3的响应式设计原理(织梦的css样式在哪)

3

在本文中,您将会了解到关于织梦网站HTML5+CSS3的响应式设计原理的新资讯,同时我们还将为您解释织梦的css样式在哪的相关在本文中,我们将带你探索织梦网站HTML5+CSS3的响应式设计原理的奥秘

在本文中,您将会了解到关于织梦网站HTML5+CSS3的响应式设计原理的新资讯,同时我们还将为您解释织梦的css样式在哪的相关在本文中,我们将带你探索织梦网站HTML5+CSS3的响应式设计原理的奥秘,分析织梦的css样式在哪的特点,并给出一些关于15 个优秀的响应式 Web 设计 HTML 和 CSS 框架、30 个免费的响应式 HTML5 CSS3 网站模板、50 个免费的 HTML5/CSS3 响应式 Web 模板、50 个高质量的响应式 HTML5/CSS3 免费模板的实用技巧。

本文目录一览:

织梦网站HTML5+CSS3的响应式设计原理(织梦的css样式在哪)

织梦网站HTML5+CSS3的响应式设计原理(织梦的css样式在哪)

 

这几天都在修改博客上面的样式。本来用的是d83.0的源码。自己又修改了许多地方,其中自己修改的一些地方在手机里面显示的效果不是很理想,于是想改成自适应的效果。对CSS3不是非常的熟练,只能去网上找找案例看了。发现一个不错的新闻。写的比较入门,也很仔细。所以拿过来分享给大家。如果还想看图片的响应式案例可以看我找的另外的一篇《分享一个特别有用的HTML5+CSS3响应式图片案例》。

移动设备正超过桌面设备,成为访问互联网的*常见终端。于是,网页设计师不得不面对一个难题:怎么才能在不同大小的设备上呈现同样的网页?

CSS3响应式网页设计(Responsive Web Design):自动适应屏幕宽度

手机的屏幕比较小,宽度通常在600像素以下;电脑的屏幕宽度,一般都在1000像素以上(目前主流宽度是1366×768),有的还达到了2000像素。同样的内容,要在大小迥异的屏幕上,都呈现出满意的效果,并不是一件容易的事。

很多网站的解决办法,是为不同的设备提供不同的网页,比如专门提供一个mobile版本,或者iPhone / iPad版本。这样做固然保证了效果,但是比较麻烦,同时要维护好几个版本,而且如果一个网站有多个portal(入口),会大大增加架构设计的复杂度。

于是,很早就有人设想,能不能”一次设计,普遍适用”,让同一张网页自动适应不同大小的屏幕,根据屏幕宽度,自动调整布局(layout)?

Responsive Web Design

一、”自适应网页设计”的概念

2010年,Ethan Marcotte提出了“自适应网页设计”(Responsive Web Design)这个名词,指可以自动识别屏幕宽度、并做出相应调整的网页设计。

他制作了一个范例,里面是《福尔摩斯历险记》六个主人公的头像。如果屏幕宽度大于1300像素,则6张图片并排在一行。

CSS3响应式网页设计

如果屏幕宽度在600像素到1300像素之间,则6张图片分成两行。

CSS3响应式网页设计

如果屏幕宽度在400像素到600像素之间,则导航栏移到网页头部。

CSS3响应式网页设计(Responsive Web Design):自动适应屏幕宽度

如果屏幕宽度在400像素以下,则6张图片分成三行。

CSS3响应式网页设计(Responsive Web Design):自动适应屏幕宽度

mediaqueri.es上面有更多这样的例子。

这里还有一个测试小工具,可以在一张网页上,同时显示不同分辨率屏幕的测试效果,我推荐安装。

二、允许网页宽度自动调整

“自适应网页设计”到底是如何做到的?其实并不难。

首先,在网页代码的头部,加入一行viewport元标签。

<meta name=”viewport” content=”width=device-width, initial-scale=1″ />

viewport是网页默认的宽度和高度,上面这行代码的意思是,网页宽度默认等于屏幕宽度(width=device-width),原始缩放比例(initial-scale=1)为1.0,即网页初始大小占屏幕面积的100%。

所有主流浏览器都支持这个设置,包括IE9。对于那些老式浏览器(主要是IE6、7、8),需要使用css3-mediaqueries.js。

<!–[if lt IE 9]><script src=””></script><![endif]–>

三、不使用**宽度

由于网页会根据屏幕宽度调整布局,所以不能使用**宽度的布局,也不能使用具有**宽度的元素。这一条特别重要。

具体说,CSS代码不能指定像素宽度:width:xxx px;只能指定百分比宽度:width: xx%;或者width:auto;

四、相对大小的字体

字体也不能使用**大小(px),而只能使用相对大小(em)。body {font: normal 100% Helvetica, Arial, sans-serif;}

上面的代码指定,字体大小是页面默认大小的100%,即16像素。h1 {font-size: 1.5em;}

然后,h1的大小是默认大小的1.5倍,即24像素(24/16=1.5)。small {font-size: 0.875em;}

small元素的大小是默认大小的0.875倍,即14像素(14/16=0.875)。

五、流动布局(fluid grid)

#p#分页标题#e#

“流动布局”的含义是,各个区块的位置都是浮动的,不是固定不变的。

.main {float: right;width: 70%;}.leftBar {float: left;width: 25%;}

float的好处是,如果宽度太小,放不下两个元素,后面的元素会自动滚动到前面元素的下方,不会在水平方向overflow(溢出),避免了水平滚动条的出现。

另外,**定位(position: absolute)的使用,也要特别小心。

六、选择加载CSS

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

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

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

上面的代码意思是,如果屏幕宽度小于400像素(max-device-width: 400px),就加载tinyScreen.css文件。

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

如果屏幕宽度在400像素到600像素之间,则加载smallScreen.css文件。

除了用html标签加载CSS文件,还可以在现有CSS文件中加载。

@import url("tinyScreen.css") screen and (max-device-width: 400px);

七、CSS的@media规则

同一个CSS文件中,也可以根据不同的屏幕分辨率,选择应用不同的CSS规则。

@media screen and (max-device-width: 400px) {.column {float: none;width:auto;} #sidebar {display:none;}}

上面的代码意思是,如果屏幕宽度小于400像素,则column块取消浮动(float:none)、宽度自动调节(width:auto),sidebar块不显示(display:none)。

八、图片的自适应(fluid image)

除了布局和文本,”自适应网页设计”还必须实现图片的自动缩放。

这只要一行CSS代码:img { max-width: 100%;}

这行代码对于大多数嵌入网页的视频也有效,所以可以写成:img, object { max-width: 100%;}

老版本的IE不支持max-width,所以只好写成:img { width: 100%; }

此外,windows平台缩放图片时,可能出现图像失真现象。这时,可以尝试使用IE的专有命令:img { -ms-interpolation-mode: bicubic; }

或者,Ethan Marcotte的imgSizer.js。

addLoadEvent(function() {var imgs = document.getElementById("content").getElementsByTagName("img");imgSizer.collate(imgs);});

不过,有条件的话,*好还是根据不同大小的屏幕,加载不同分辨率的图片。有很多办法可以做到这一条,服务器端和客户端都可以实现。

本文章网址:http://www.ppssdd.com/code/10982.html。转载请保留出处,谢谢合作!

15 个优秀的响应式 Web 设计 HTML 和 CSS 框架

15 个优秀的响应式 Web 设计 HTML 和 CSS 框架

【推荐教程:CSS视频教程 】

响应式 Web 设计旨在为各种设备(从台式机显示器到手机)提供最佳的浏览体验。本文汇总了一些优秀的响应式 Web 设计 HTML 和 CSS 框架。这些框架都是开源的并免费的。

对响应式 Web 框架进行比较并不那么容易。有的框架适合设计更快、更精简网站的某些功能,而有些可能提供了大量功能、插件和附加组件,但是可能体积会比较庞大并且上手较难。

1. Bootstrap

Bootstrap 最受欢迎

Bootstrap 是最流行的 HTML、CSS 和 JS 框架,用于在 Web 上开发响应式、移动优先项目。Bootstrap 使前端开发更快、更轻松。他们提供了大量的文档、示例和演示,可以帮你快速进行响应式 Web 开发。在 Bootstrap 5 中做了一些重大更改,例如随意使用 jQuery 并添加了 RTL 支持,再加上现成的组件和工具类,使 Bootstrap 成为 Web 开发人员的最佳选择之一。

你还可以找到许多免费的高级 bootstrap 模板 和 UI 工具包,这使你的开发过程更加轻松。

官网:https://getbootstrap.com/

2. Tailwind CSS

Tailwind CSS

Tailwind 提供了一种基于实用工具的现代方法来构建响应站点。它有大量的实用工具类,无需编写 CSS 即可构建现代网站。它与其它框架的不同之处在于需要通过开发设置来缩小最终 CSS 的大小,因为如果使用默认值,最终将会得到一个很大的 CSS 文件。Tailwind 能够快速将样式添加到 HTML 元素中,并提供了大量的开箱即用的设计样式。这里有大量的 Tailwind CSS 资源 https://superdevresources.com/best-tailwind-css-resources-for-developers/。

官网:https://tailwindcss.com/

3. Tachyons

TACHYONS

Tachyons 也是一个基于实用工具的 CSS 库,它提供了许多即装即用的复杂功能,无需自己编写大量 CSS。这样做的好处是 Tachyons 的开箱即用样式很轻巧,不需要其他设置。如果需要的话,仍然可以通过一些方法来减小尺寸。如果你需要易用的实用工具库,那么这应该是一个不错的选择。

官网:https://tachyons.io/

4. Foundation

The most advanced responsive

Foundation 是由产品设计公司 ZURB 制作的自适应前端框架。这个框架是他们自 1998 年来构建 Web 产品和服务的结果。Foundation 是最先进的响应式前端框架,并且提供了许多自定义功能。

官网:http://foundation.zurb.com/

5. Material Design for Bootstrap (MDB)

Material Design for Bootstrap

MDB 建立在 Bootstrap 之上,并提供了开箱即用的材料设计外观。它具有出色的 CSS 库,并且与大多数流行的 JavaScript 框架(如 jQuery、Angular、React 和。Vue.js)兼容。其核心库是完全免费使用的。

官网:https://mdbootstrap.com/

6. UIkit

UIkit

UIkit 是一个轻量级的模块化前端框架,用于开发快速且强大的 Web 界面。UIkit 提供了 HTML、CSS 和 JS 组件的全面集合,这些组件易于使用,易于定制和扩展。UIkit 采用移动优先的方法,可提供从手机、平板电脑到台式机的一致体验。

官网:http://getuikit.com/

7. Pure CSS

Pure

Pure.css 是一组小型的响应式 CSS 模块,可以用在任何一个 Web 项目中。Pure 的体积小的简直过分。比如完整的时钟模块最小化压缩版本仅为 4.0 KB。Pure 基于 normalize.css 构建,并提供原声 HTML 元素以及最常见的 UI 组件的布局和样式。Pure 具有开箱即用的响应能力,所以元素在所有屏幕尺寸上都看起来不错。

官网:http://purecss.io/

8. Material Design Lite Framework (MDL)

material design light framework

Google 的 Material Design Lite 框架是最流行的 CSS 框架之一,可为你的网站添加 Material Design 外观。它不依赖任何 JavaScript 框架,可以跨设备使用,并且可以针对较旧的浏览器进行降级。它的构建充分考虑了可访问性,并提供了丰富的文档和入门模板。

官网:https://getmdl.io/

9. Materialize

materialize

Materialize 是基于 Material Design 的现代响应式前端框架。Google的材料设计是一种流行的设计趋势,涉及卡片、阴影和动画。

官网:http://materializecss.com/

10. Skeleton

Skeleton

如果你要开发较小的项目,或者只是觉得自己不需要大型框架的所有实用工具,则可以试试 Skeleton。Skeleton 仅设置了少量标准 HTML 元素的样式,并包含一个网格。

Skeleton 中的网格是一个 12 列的流体网格,最大宽度为 960px,随着浏览器或设备的缩小而缩小。可以用一行 CSS 更改最大宽度,并且所有列的大小都会相应进行调整。其语法很简单,使响应式编码更加容易。

官网:http://getskeleton.com/

11. Bulma

bulma css framework

Bulma 是基于 flexBox 的现代 CSS 框架。它提供了响应式设计和移动设备优先的 UI 组件,并具有模块化结构,可让你只导入要包含在 Web 设计中的内容。Bulma 还提供了一个基于 flexBox 的现代网格系统。

官网:http://bulma.io/

12. Semantic UI

semantic ui

Semantic UI 是一个高级 CSS 框架,提供了 50 多个 UI 元素,300 多个 CSS 变量用于自定义,并通过 EM 值构建以用于响应式设计。它也已准备好 FlexBox。

Semantic 是可用于生产环境的 CSS 框架,并能与 React、Angular、Meteor 和 Ember 等框架整合,你可以通过与这些框架中进行集成将 UI 层与应用逻辑组织在一起。

官网:https://semantic-ui.com/

13. Milligram

milligram css

Milligram 是一个极简的 CSS 框架,不依赖 JavaScript。它通过最少的样式设置用来快速、干净的创建响应式网站。它还提供了一个基于 flexBox 的网格系统。

官网:https://milligram.github.io/

14. Spectre.css

Spectrecss CSS Framework

Spectre.css 是一个轻量级的库,它提供了开箱即用的,基于 flexBox 的响应式和移动友好型布局。以在它的基础上根据自己的需要添加样式和响应实用工具。

官网:https://picturepan2.github.io/spectre/

15. Base CSS Framework

Base CSS Framework

Base 也是一个轻量级 CSS 框架,可用于构建响应式网站。它为网站项目提供了免费的基础入门软件以及许多付费的现成模板。

官网:https://getbase.org/

如果对这些框架进行比较,你会发现 Bootstrap、Tailwind 和 Foundation 的流行度远远领先于其他框架。

设计机构通常选择 Bootstrap,因为它提供了开箱即用的组件,并且易于定制。这就是 Bootstrap 主题和库数量众多的原因.

更多编程相关知识,请访问:编程视频!!

30 个免费的响应式 HTML5 CSS3 网站模板

30 个免费的响应式 HTML5 CSS3 网站模板

网站模板这种东西根本无需任何文字介绍,有图才是真相!

Free Retina Ready Responsive App Landing Page Website Template

Demo| Download

Flat Design Portfolio Template

Demo| Download

Brushed | Responsive One Page Template

Demo| Download

Big Picture HTML5 Template

Demo | Download

Tesselatte - A free responsive site template

Demo | Download

OVERFLOW

Demo | Download

Runkeeper a mobile app Responsive web Template

Demo| Download

Pinball Responsive Grid Style Blog Flat web template

Demo| Download

Bak One singlepage Flat Corporate Responsive website template

Demo| Download

Free HTML Template Andia

Demo| Download

Free Template Produkta: 4 HTML Templates in One

Demo| Download

Website – HTML5, CSS3, jQuery

Demo| Download

 

Elita – HTML/CSS website

Demo| Download

zWiseSolutions – Free Responsive Html5 Theme

Demo| Download

zValencia – Free Responsive Html5 Theme

Demo| Demo| Download” ]Download[/button]

Studio Francesca

Demo| Download

 Lemar, a responsive landing page

Demo| Download

Prologue | HTML5

Demo | Download

HELIOS

Demo | Download

Telephasic | HTML5 Template

Demo | Download

Strongly Typed

Demo | Download

Escape Velocity

Demo | Download

Striped

Demo | Download

Dopetrope

Demo | Download

Verti

Demo | Download

Zerofour

Demo | Download

Jetro Flat Corporate Responsive website template

Demo| Download

Appz Single page Responsive website template

Demo| Download

iOS7 App Responsive Landingpage web template

Demo| Download

via designscrazed

50 个免费的 HTML5/CSS3 响应式 Web 模板

50 个免费的 HTML5/CSS3 响应式 Web 模板

别怪小编太懒,这 Web 模板实在没什么好介绍的:)

1. Appology

Demo

Appology is a template to be shortly released which will help you in creating your brand identity.

2. Interio

Demo

Interio is a free website template created by the team from TemplateMonster.com.  This is optimized for a screen resolution of 1024X768. It’s also CSS & XHTML valid.

3. Launchpad

Demo

Launchpad is designed by FreebiesXpress and is a minimalistic design which is totally responsive.  You can use Launchpad for your product or start a website for your company.

4. Restaurant website template

Demo

This is a responsive free template and can be used for any restaurant or cafe site. The color green dominates in this design, which sets up a positive tone.  High resolution images  in this design look very appealing.

5. FlexApp

Demo

FlexApp is a fully responsive CSS/HTML template that’s ideal for marketing a mobile application. It uses jQuery technology to give an enjoyable and consistent viewing experience.

6. Art School Template

Demo

This is an elegant and polished website template which can be used to represent your arts academy.

7. Fotos

Demo

Fotos website is a mobile template that’s under construction currently. It’s a responsive css and pure html representation.

8. Website template for design studio

Demo

This template is perfect for company websites, workshop, firm and design studio. Black represents style and using it for your template gives it a contemporary tone.

9. Liquid Gem

Demo

Liquid Gem makes use of percentage layouts and CSS media queries to provide a totally responsive design. In addition, it has a fully functioning PHP contact form and an image carousel.

10. Folder

Demo

Folder is a HTML 5 responsive template that adapts to any browser size or device. It’s ideal for business and creative showcase.

11. Hostcompare

Demo

HostCompare is a crisp and clean flat responsive template which has its inspiration in BlazRobar’s Hostcompare.  It includes floating header, price table and plan selection.

12. Tasty looking skin for culinary site

Demo

This template is a tasty looking skin for your cooking project. The soft colors in this design add value to the site’s whole idea rendering it yummy for visitors.

13. Respond1.5

Demo

Respond 1.5 is fully responsive template which uses the framework of Twitter’s Bootstrap.

14. Template for business project

Demo

This template will assist you to build a strategy for your business start-up.

15. Limelight

Demo

Limelight template can be used to begin a design resource website, wherein design resources like PSD’s, icons and Fonts can be provided for sale or free download.

16. BisLite Html5 Theme

Demo

This responsive theme has clean and crisp icons, and is based on 960 grid. It scales down elegantly to downsized mobile phones, tablets and browser windows.

17. Brownie

Demo

Created by using the latest CSS3 and HTML5 techiques, Brownie is a clean, simple and free website template.

18. Nova

Demo

Nova is free website template with unlimited color styles. It’s fully responsive and has a built in photo gallery support.

19. Agro Farm

Demo

Agrofarm is a mobile web template to create a site for agro farms, agriculture related products, agro product makers and agro vehicles.

20. Nina HTML 5 theme

Demo

Nina is a minimalistic HTMS5 template used for corporate, business and portfolio website.

21. Zeni

Demo

Zeni is a responsive HTML5 theme and works excellent for creative’s portfolio, business and corporate sites.

22. CSS3 seascape two

Demo

CSS3 seascape two is a professional style template having two columns-fixed layout and left sidebar.

23. Fore

Demo

Fore is responsive, free and pageless HTML template created by Papaya.

24. Madison

Demo

Madison is an outstanding HTML template meant for those who require a personal portfolio to display their work or offer their services.

25. Kroft

Demo

Kroft is a free template ideal for designers and creative agencies.

26. Wedding site

Demo

Wedding Site is a template used to begin a design resource site where design resources can be provided for sales or free download.

27. OnePager

Demo

OnePager is a HTML5 responsive template for business and portfolio websites.

28. Thom Sander

Demo

Thom Sander template has been designed by templatemonster and is ideal for those who require a website design of fixed width.

29. Caprice

Demo

Caprice can be used for a business resource webiste where design resources can be sold or downloaded free.

30. Brushed

Demo

Brushed is a HTML template based on the framework of Twitter Bootstrap.

31. Scenic Photo

Demo

Scenic Photo is a fixed width template and uses plenty of CSS3 features.

32. BrandIdentity

Demo

BrandIdentity has 5 kinds of pages-Home Page, Contact Page, About Page, Services Page and Portfolio Page.

33. CoffeeCols

Demo

CoffeeCols is a creative and amusing magazine-style template that makes uses of boxes on its home page to give your content a unique appearance. Irrespective of the number of boxes you have, they align on their own-so you don’t have to deal with that.

34. Hatha Yoga

Demo

Hatha Yoga is a free template ideal for your yoga webpage.

35. Organic

Demo

Organic helps you to set up a stylish website with its clear and clean design.

36. Modus

Demo

Modus is a great template which can be used for your blog, business portfolio or portfolio showcase.

37. Connoisseur

Demo

Connoisseur is a modern template suitable for sites pertaining to cuisines, dining and fine arts.

38. Zeenceslight

Demo

Zeenceslight, designed by Elemisdesign, is a responsive template having four kinds of pages.

39. Abc

Demo 

Elegant HTML code and simple website design make this template extremely attractive.

40. Point

Demo

Point is a corporate and business style template.

41. Bizz

Demo

Bizz is a free template, suitable for business and company websites.

42. It Fits

Demo

It Fits is a template that supports various sizes of devices.

43. Vivid Photo

Demo

Vivid Photo is an exquisite photography template designed to showcase portfolio images.

44. Garden truck

Demo

Garden Truck is ideal for food and drink sites.

45. Serendipity

Demo

Serendipity is a free theme with gallery featuring lightbox like Tumblr.

46. Pro Soft

Demo

Pro Soft is ideal for a fixed width website design.

47. Elementary

Demo

Elementary has a fixed width layout and uses HTML5 doctype.

48. Responsiva

Demo

Responsiva has been built in unique retro style and is perfect for those who want to stand out.

49. Brainstorm

Demo

Brainstorm, designed by Chocotemplates, is a technology and design type template.

50. Obscura

Demo

Obscura is perfect for photography or magazine website.

via designinspirationmagazine

50 个高质量的响应式 HTML5/CSS3 免费模板

50 个高质量的响应式 HTML5/CSS3 免费模板

没什么好说的,上图!够你看一阵子的了,哇哈哈哈!

Enzyme Responsive Theme

Telephasic Responsive Site Template

ZEROFOUR FREE RESPONSIVE SITE TEMPLATE

Responsive Business Portfolio Template

Type & Grids: Free Responsive HTML5 Template

Legend: Free Responsive One Page Template

Vintage – HTML Template

Striped HTML5 Site Template

Flexapp Responsive HTML/CSS Template

Madison Template

Codester: Free Responsive Bootstrap Template

Liquid Gem

jQuery Camera Slideshow

overflow html5

Obscura – Free Responsive HTML Template

Responsive Business Portfolio HTML Template

Brushed Template

Parallelism

Responsive App Landing Page Website Template 

MiniPort

Zeences Light – Free HTML Template

Clean Corporate Style

OnePager HTML5 Single Page Portfolio

one page free html template

DeadStocker

via inspiretrends

我们今天的关于织梦网站HTML5+CSS3的响应式设计原理织梦的css样式在哪的分享就到这里,谢谢您的阅读,如果想了解更多关于15 个优秀的响应式 Web 设计 HTML 和 CSS 框架、30 个免费的响应式 HTML5 CSS3 网站模板、50 个免费的 HTML5/CSS3 响应式 Web 模板、50 个高质量的响应式 HTML5/CSS3 免费模板的相关信息,可以在本站进行搜索。

本文标签: