min-aspect-ratio和max-aspect-ratio宽高比自适应布局

什么是响应式布局

响应式布局设计,是指将桌面设备上的页内容在移动此氏设备上进行优化排版,使用户能够在移动设备上更方便地阅读并操作。其实,如果经常使用不同的设备浏览互联网网页,就会比较容易体会响应式布局设计在移动设备上的应用。

页面的设计森厅散根据使用设备环境进行相应的响应和调整,具体的实践方式由多方面组成的。最主要的是三种技术实现的:

1、流体布局,采用了百分比和像素为单位,使布局更加灵活。布伏链局上才用多种方法,呈现不同方式的实现布局设计,简单分为四种类型:固定布局、可切换的固定布局、弹性布局、混合布局。

其次,可切换的固定布局的实现成本最低,但拓展性比较差;而弹性布局与混合布局效果具响应性,都是比较理想的响应式布局实现方式。只是对于不同类型的页面排版布局实现响应式设计,需要采用不用的实现方式。通栏、等分结构的适合采用弹性布局方式、而对于非等分的多栏结构往往需要采用混合布局的实现方式。

2、媒介查询,通过使用媒介查询,可以获取到设备及设备的特性,及时的响应布局方案,从而解决之前在单纯的布局设计中遗留的问题

3、弹性图片,伴随布局的弹性,图片作为信息重要的形式之一也必须有更灵活的方式去适应布局的变化。扩大研究范围:除了图片,还应该包括图标、图表、视频等信息内容的响应方式。

布局响应是对页面进行设计,需要对相同的内容进行不同的布局设计。一种是桌面向下设计,一种是移动端向上的设计。无论那种设计,都要兼容所有的设备。

随着大屏幕移动设备的普及,随着越来越多的设计师采用这个技术,我们不仅看到很多的创新,还看到了一些成形的模式。给我们提供了更加舒适的界面体验。

php使用GD创建保持宽高比缩略图的方法

本文实例讲述了php使用GD创建保持宽高比缩略图的方法。分享给大家供大家参考。具体如下:

/** * Create a thumbnail image from $inputFileName no taller or wider than * $maxSize. Returns the new image resource or false on error. * Autho坏还方教或上贵批r: *** */ function thumbnail($inputFileName, $maxSize = 100) { $info = getimagesize($inputFileName); $type = isset($info[‘type’]) ? $info[致扬‘type’] : $info[2]; // Check support of file type if ( !(imagetypes() & $type) ) { // Server does not support file type return false; } $width = isset($info[‘width’]) ? $info[‘width’] : $info[0]; $height = isset($info[‘height’]) ? $info[‘height’] : $info[1]; // Calculate aspect 处乱阶ratio $wRatio = $maxSize / $width; $hRatio = $maxSize / $h云束永洋达eight; // Using imagecreatefromstring will automatically detect the file type $采于sourceImage = imagecreatefromst部界只检思编算ring(file_get_略说contents($inputFileName)); // Calculate a p球础分行龙杆九生roportional width and height no larger than the max size. if ( ($width <= $maxSize) && ($height <= $maxSize) ) { // Input is smaller than thumbnail, 交哪运青体纸演击半皇倒do nothing return 密示起慢取数永之觉$sourceImage; } elseif ( ($wRatio * $height) < $maxSize ) { // Image is horizontal $tHeight = ceil($wRatio * $height); $tWidth = $maxSize; } else { // Image is vertical $tWidth = ceil($hRatio * $width); $tHeight = $maxSize; } $thumb = imagecreate果究务织证truecolor($tWidth, $tHeight); if ( $sourceImage === false ) { // Could not load image return false; } 致哪突年// Copy resampled makes a smooth thumbnail imagecopyresampled($thumb,$sourceImage,0,0,0,0,$tWidth,$tHeight,$width,$height); imagedestroy($sourceImage); return 教通异独抗$thumb; } /** * Sa-v-e the image to a file. Type is determined from the exten提否考顶职绿每正么提sion. * $quality is only used for jpegs. * Author: *** */ function imageToFi互制杆于雨急工le($im, $fileName, $quality = 80) { if ( !$im || file_exists($fileName) ) { return false; } $ext = strtolower(substr($fileName, strrpos($fileName, ‘.’😉)); switch ( 磁船速座位$ext ) { case ‘.gif’: imagegif($im, $fileName); break; case ‘.jpg’: case ‘.jpeg’: imagejpeg($im, $fileName, $quality); break; case ‘.png’: imagepng($im, $fileName); break; case ‘.bmp’: imagewbmp($im, $fileName); break; default: return false; } return true; } $im = thumbnail(‘temp.jpg’, 100); imageToFile($im, ‘temp-thumbnail.jpg’😉;

希望本文所述对大家的php程序设计有所帮助。

本文内容由互联网用户自发贡献,该文观点仅代表作者本人。聚才发仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,请发送邮件至 tenspace2022@163.com 举报,一经查实,本站将立刻删除。 本文链接:https://www.jucaifa.com/post/1153387.html 商机洞察 金融谷 前沿技术

niuniuniuniu
上一篇 2023年12月4日
下一篇 2023年12月4日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注