search
HomeWeb Front-endHTML Tutorial前端工程师技能之photoshop巧用(从效果图到雪碧图)3--切图篇_html/css_WEB-ITnose

【哪些是需要切出来的】
  [1]修饰性的(一般用在background属性)
    [注意]修饰性图片一般保存为png24(IE6不支持半透明)和png8格式
    [a]图标、logo
    [b]有特殊效果的按钮、文字等(如果设计师设计的字体不太常见的话,把文字当图片来切出来)
    [c]非纯色的背景

  [2]内容性的(一般用在img标签)
    [注意]内容性图片一般是服务器的数据,一般不用切图,只用前端工程师技能之photoshop巧用(从效果图到雪碧图)3--切图篇_html/css_WEB-ITnose占位即可
    [a]Banner、广告图片
    [b]文章中的配图
    [c]内容性图片颜色较丰富,一般存为JPG格式,且需要一定的压缩

 

【切图步骤】
  【1】隐藏文字只留背景(若文字上有特殊效果,无法用代码写出,则把文字和背景一起切出来)
    【1.1】若文字为独立图层,则隐藏文字图片
      【a】找到文字图层
      【b】去掉眼睛图标


    【1.2】若文字和背景合并,平铺背景覆盖文字
      【1.2.1】若背景是可以拉伸的,用矩形选框工具在背景上画一个小的矩形框,用自由变换工具(ctrl+t)拉伸背景,将文字覆盖,然后双击或按回车键


      【1.2.2】若背景有纹理,不可以拉伸,用矩形选框工具在背景上画一个小的矩形框,用移动工具【v】+alt来复制当前图层,一次次地按下方向键或用鼠标移动(鼠标移动时,按住shift键时可以保证图层按照直线移动),最终将文字全部覆盖为止


  【2】移动工具选中所需图层(ctrl+点击图层的矩形区域),出现蚂蚁线

  【3】合并图层(ctrl+e)(可选):勾选自动选择,然后将需要的多个图层合并

  【4】复制图层(ctrl+c) ->新建文件(ctrl+n),并按确定 -> 粘贴图层(ctrl+v)

【实战】

  【切png8】png8不支持半透明,所以需要带背景切
    【1】合并可见图层(shift+ctrl+e)
    【2】矩形选框工具选择一个大的区域
    【3】魔棒工具去除多余部分(从选区中减去:按住alt)

 

  【切不规则小图标】:切法和png8的切法类似
    [注意]选择镂空小图标时,一定要取消[连续]

 

  【切可平铺背景】
    【1】用矩形选框工具选取一块区域
    【2】复制粘贴到新文件中(平铺内容充满文件的宽(x轴)或高(y轴))
      [a]若沿x轴平铺,则铺满x轴
      [b]若沿y轴平铺,则铺满y轴

  【切片工具一刀切】:适用于可以一刀切的活动页
    【1】拉参考线
    【2】选择切片工具
    【3】点击基于参考线的切片按钮
    【4】从切片工具切换到切片选择工具(在同一个按钮下)
    【5】双击切片,更改需要的名称
    【6】保存(全选切片,不可用ctrl+a,只能拖动矩形框来选中所有的切片,选中后颜色变亮,然后统一设置存储格式)

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Give an example of an HTML tag with an attribute.Give an example of an HTML tag with an attribute.May 16, 2025 am 12:02 AM

The usage methods of HTML tags and attributes include: 1. Basic usage: Use tags such as and, and add necessary information through attributes such as src and href. 2. Advanced usage: Use data-* custom attributes to achieve complex interactions. 3. Avoid common mistakes: Make sure the property values ​​are surrounded by quotes. 4. Performance optimization: Keep it simple, use standard attributes and CSS class names to ensure that the image has alt attributes. Mastering these will improve web development skills.

What is the difference between an HTML tag and an HTML attribute?What is the difference between an HTML tag and an HTML attribute?May 14, 2025 am 12:01 AM

HTMLtagsdefinethestructureofawebpage,whileattributesaddfunctionalityanddetails.1)Tagslike,,andoutlinethecontent'splacement.2)Attributessuchassrc,class,andstyleenhancetagsbyspecifyingimagesources,styling,andmore,improvingfunctionalityandappearance.

The Future of HTML: Evolution and TrendsThe Future of HTML: Evolution and TrendsMay 13, 2025 am 12:01 AM

The future of HTML will develop in a more semantic, functional and modular direction. 1) Semanticization will make the tag describe the content more clearly, improving SEO and barrier-free access. 2) Functionalization will introduce new elements and attributes to meet user needs. 3) Modularity will support component development and improve code reusability.

Why are HTML attributes important for web development?Why are HTML attributes important for web development?May 12, 2025 am 12:01 AM

HTMLattributesarecrucialinwebdevelopmentforcontrollingbehavior,appearance,andfunctionality.Theyenhanceinteractivity,accessibility,andSEO.Forexample,thesrcattributeintagsimpactsSEO,whileonclickintagsaddsinteractivity.Touseattributeseffectively:1)Usese

What is the purpose of the alt attribute? Why is it important?What is the purpose of the alt attribute? Why is it important?May 11, 2025 am 12:01 AM

The alt attribute is an important part of the tag in HTML and is used to provide alternative text for images. 1. When the image cannot be loaded, the text in the alt attribute will be displayed to improve the user experience. 2. Screen readers use the alt attribute to help visually impaired users understand the content of the picture. 3. Search engines index text in the alt attribute to improve the SEO ranking of web pages.

HTML, CSS, and JavaScript: Examples and Practical ApplicationsHTML, CSS, and JavaScript: Examples and Practical ApplicationsMay 09, 2025 am 12:01 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

How do you set the lang attribute on the  tag? Why is this important?How do you set the lang attribute on the tag? Why is this important?May 08, 2025 am 12:03 AM

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

What is the purpose of HTML attributes?What is the purpose of HTML attributes?May 07, 2025 am 12:01 AM

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.