search
HomeWeb Front-endHTML TutorialHTML css面试题_html/css_WEB-ITnose

1.对WEB标准以及W3C的理解与认识

  标签闭合、标签小写、不乱嵌套、提高搜索机器人搜索几率、使用外链css和js脚本、结构行为表现的分离、文件下载与页面速度更快、内容能被更多的用户所访问、内容能被更广泛的设备所访问、更少的代码和组件,容易维护、改版方便,不需要变动页面内容、提供打印版本而不需要复制内容、提高网站易用性;

 

2.xhtml和html有什么区别

  HTML是一种基本的WEB网页设计语言,XHTML是一个基于XML的置标语言

  最主要的不同:

  XHTML 元素必须被正确地嵌套。

  XHTML 元素必须被关闭。

  标签名必须用小写字母。

  XHTML 文档必须拥有根元素。

 

3.Doctype? 严格模式与混杂模式-如何触发这两种模式,区分它们有何意义?

  用于声明文档使用那种规范(html/Xhtml)一般为 严格 过度 基于框架的html文档

  加入XMl声明可触发,解析方式更改为IE5.5 拥有IE5.5的bug

 

4.行内元素有哪些?块级元素有哪些?CSS的盒模型?

  块级元素:div p h1 h2 h3 h4 form ul

  行内元素: a b br i span input select

  Css盒模型:内容,border ,margin,padding

 

5.CSS引入的方式有哪些? link和@import的区别是?

  内联 内嵌 外链 导入

  区别 :同时加载

  前者无兼容性,后者CSS2.1以下浏览器不支持

  Link 支持使用javascript改变样式,后者不可

 

6.CSS选择符有哪些?哪些属性可以继承?优先级算法如何计算?内联和important哪个优先级高?

  标签选择符 类选择符 id选择符

  继承不如指定 Id>class>标签选择

  后者优先级高

 

7.前端页面有哪三层构成,分别是什么?作用是什么?

  结构层 Html 表示层 CSS 行为层 js

 

8.css的基本语句构成是?

  选择器{属性1:值1;属性2:值2;……}

 

9.你做的页面在哪些流览器测试过?这些浏览器的内核分别是什么?

  Ie(Ie内核) 火狐(Gecko) 谷歌(webkit) opear(Presto)

 

10.写出几种IE6 BUG的解决方法

  1.双边距BUG float引起的 使用display

  2.3像素问题 使用float引起的 使用dislpay:inline -3px

  3.超链接hover 点击后失效 使用正确的书写顺序 link visited hover active

  4.Ie z-index问题 给父级添加position:relative

  5.Png 透明 使用js代码 改

  6.Min-height 最小高度 !Important 解决’

  7.select 在ie6下遮盖 使用iframe嵌套

  8.为什么没有办法定义1px左右的宽度容器(IE6默认的行高造成的,使用over:hidden,zoom:0.08 line-height:1px)

  9.ie 6 不支持!important

 

11.img标签上title与alt属性的区别是什么?

  Alt 当图片不显示是 用文字代表。

  Title 为该属性提供信息

 

12.描述css reset的作用和用途。

  Reset重置浏览器的css默认属性 浏览器的品种不同,样式不同,然后重置,让他们统一

 

13.解释css sprites,如何使用。

  Css 精灵 把一堆小的图片整合到一张大的图片上,减轻服务器对图片的请求数量

 

14.浏览器标准模式和怪异模式之间的区别是什么?

  盒子模型 渲染模式的不同

  使用 window.top.document.compatMode 可显示为什么模式

 

15.你如何对网站的文件和资源进行优化?期待的解决方案包括:

  文件合并

  文件最小化/文件压缩

  使用CDN托管

  缓存的使用

 

16.什么是语义化的HTML?

  直观的认识标签 对于搜索引擎的抓取有好处

 

17.清除浮动的几种方式,各自的优缺点

  1.使用空标签清除浮动 clear:both(理论上能清楚任何标签,,,增加无意义的标签)

  2.使用overflow:auto(空标签元素清除浮动而不得不增加无意代码的弊端,,使用zoom:1用于兼容IE)

  3.是用afert伪元素清除浮动(用于非IE浏览器)

 

18.css hack

  

  _marging \\IE 6

  +margin \\IE 7

  Marging:0 auto \9 所有Ie

  Margin \0 \\IE 8

注:本文来源于网络,问题正确性未经验证。

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
The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML: Building the Structure of Web PagesHTML: Building the Structure of Web PagesApr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

From Text to Websites: The Power of HTMLFrom Text to Websites: The Power of HTMLApr 13, 2025 am 12:07 AM

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

Understanding HTML, CSS, and JavaScript: A Beginner's GuideUnderstanding HTML, CSS, and JavaScript: A Beginner's GuideApr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment